-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PUB-1242] Rename "LiveObjects" to "Objects" when referencing a channel feature #1982
base: integration/liveobjects
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request performs a comprehensive renaming of the “LiveObjects” plugin to “Objects” throughout the codebase. The changes update build tasks, configuration files, import and export statements, type definitions, and documentation. All references, whether in task names, file paths, or comments, have been modified to reflect the new naming convention without altering the underlying functionality or control flow. Changes
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
liveobjects.d.tsOops! Something went wrong! :( ESLint: 7.32.0 No files matching the pattern "liveobjects.d.ts" were found. src/plugins/liveobjects/batchcontext.tsOops! Something went wrong! :( ESLint: 7.32.0 No files matching the pattern "src/plugins/liveobjects/batchcontext.ts" were found. src/plugins/liveobjects/batchcontextlivecounter.tsOops! Something went wrong! :( ESLint: 7.32.0 No files matching the pattern "src/plugins/liveobjects/batchcontextlivecounter.ts" were found.
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
test/package/browser/template/README.md (2)
11-11
: Documentation updated correctly to reflect new naming.The README has been properly updated to reference the new naming convention, changing from "LiveObjects" to "Objects".
Note: The hyphen in "Objects ably-js" isn't necessary since "ably" is followed by an adverb ending in 'ly'.
Consider removing the hyphen:
-src/index-objects.ts` imports the Objects ably-js plugin +src/index-objects.ts` imports the Objects ably js plugin🧰 Tools
🪛 LanguageTool
[uncategorized] ~11-~11: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...c/index-objects.tsimports the Objects ably-js plugin (
import Objects from 'ably/obje...(HYPHENATED_LY_ADVERB_ADJECTIVE)
29-29
: Bundle reference correctly updated.The bundle reference has been properly updated from using
src/index-liveobjects.ts
tosrc/index-objects.ts
.Same minor issue with hyphenation as mentioned above.
Consider removing the hyphen:
-a bundle containing `src/index-objects.ts` and ably-js. +a bundle containing `src/index-objects.ts` and ably js.🧰 Tools
🪛 LanguageTool
[uncategorized] ~29-~29: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...e containingsrc/index-objects.ts
and ably-js. 3. a bundle containing `src/index-mo...(HYPHENATED_LY_ADVERB_ADJECTIVE)
README.md (1)
591-593
: Rename Header and Description:
The header and its description have been updated to "Using the Objects plugin," which correctly reflects the new naming convention. Consider shortening or simplifying the description slightly to improve conciseness (see static analysis suggestion).🧰 Tools
🪛 LanguageTool
[style] ~593-~593: Consider a shorter alternative to avoid wordiness.
Context: ...ealtime clients via the Objects plugin. In order to use Objects on a channel, you must pass...(IN_ORDER_TO_PREMIUM)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (41)
Gruntfile.js
(3 hunks)README.md
(11 hunks)ably.d.ts
(12 hunks)grunt/esbuild/build.js
(2 hunks)objects.d.ts
(1 hunks)package.json
(3 hunks)scripts/cdn_deploy.js
(1 hunks)scripts/moduleReport.ts
(5 hunks)src/common/lib/client/baserealtime.ts
(2 hunks)src/common/lib/client/modularplugins.ts
(2 hunks)src/common/lib/client/realtimechannel.ts
(7 hunks)src/common/lib/transport/comettransport.ts
(1 hunks)src/common/lib/transport/connectionmanager.ts
(1 hunks)src/common/lib/transport/protocol.ts
(1 hunks)src/common/lib/transport/transport.ts
(1 hunks)src/common/lib/transport/websockettransport.ts
(1 hunks)src/common/lib/types/protocolmessage.ts
(10 hunks)src/plugins/index.d.ts
(1 hunks)src/plugins/liveobjects/index.ts
(0 hunks)src/plugins/objects/batchcontext.ts
(3 hunks)src/plugins/objects/batchcontextlivecounter.ts
(1 hunks)src/plugins/objects/batchcontextlivemap.ts
(2 hunks)src/plugins/objects/index.ts
(1 hunks)src/plugins/objects/livecounter.ts
(7 hunks)src/plugins/objects/livemap.ts
(16 hunks)src/plugins/objects/liveobject.ts
(4 hunks)src/plugins/objects/objects.ts
(18 hunks)src/plugins/objects/objectspool.ts
(4 hunks)src/plugins/objects/syncobjectsdatapool.ts
(4 hunks)test/common/globals/named_dependencies.js
(2 hunks)test/common/modules/objects_helper.js
(4 hunks)test/common/modules/private_api_recorder.js
(3 hunks)test/package/browser/template/README.md
(2 hunks)test/package/browser/template/package.json
(1 hunks)test/package/browser/template/server/resources/index-objects.html
(1 hunks)test/package/browser/template/server/server.ts
(1 hunks)test/package/browser/template/src/ably.config.d.ts
(1 hunks)test/package/browser/template/src/index-objects.ts
(4 hunks)test/package/browser/template/test/lib/package.test.ts
(1 hunks)test/support/browser_file_list.js
(1 hunks)typedoc.json
(1 hunks)
💤 Files with no reviewable changes (1)
- src/plugins/liveobjects/index.ts
✅ Files skipped from review due to trivial changes (3)
- test/package/browser/template/server/resources/index-objects.html
- src/plugins/objects/index.ts
- test/common/modules/objects_helper.js
🧰 Additional context used
🧠 Learnings (3)
src/plugins/objects/syncobjectsdatapool.ts (1)
Learnt from: VeskeR
PR: ably/ably-js#1897
File: src/plugins/liveobjects/syncliveobjectsdatapool.ts:57-57
Timestamp: 2024-11-12T07:31:53.691Z
Learning: When methods with the same name exist in different classes, references to these methods may remain valid even if a similar method is renamed in another class.
README.md (1)
Learnt from: VeskeR
PR: ably/ably-js#1897
File: src/plugins/liveobjects/livecounter.ts:93-93
Timestamp: 2024-11-12T07:31:53.691Z
Learning: In the `LiveCounter` class's `_applyCounterCreate` method, it's intentional to increment the counter's value using `+=` instead of initializing it with `=` because the counter may have a pre-existing non-zero value.
ably.d.ts (1)
Learnt from: VeskeR
PR: ably/ably-js#1880
File: liveobjects.d.ts:26-26
Timestamp: 2024-11-12T07:31:53.691Z
Learning: For plugins like `LiveObjects`, the `any` type is intentionally used to maintain flexibility.
🪛 LanguageTool
README.md
[style] ~593-~593: Consider a shorter alternative to avoid wordiness.
Context: ...ealtime clients via the Objects plugin. In order to use Objects on a channel, you must pass...
(IN_ORDER_TO_PREMIUM)
[style] ~648-~648: Try using a synonym here to strengthen your writing.
Context: ... point for Objects within a channel. It gives access to all other nested Live Objects...
(GIVE_PROVIDE)
[uncategorized] ~838-~838: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...g its data or trying to update its value and you should remove all references to the...
(COMMA_COMPOUND_SENTENCE)
test/package/browser/template/README.md
[uncategorized] ~11-~11: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...c/index-objects.ts imports the Objects ably-js plugin (
import Objects from 'ably/obje...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~29-~29: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...e containing src/index-objects.ts
and ably-js. 3. a bundle containing `src/index-mo...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
🪛 markdownlint-cli2 (0.17.2)
README.md
595-595: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
609-609: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
615-615: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
622-622: Bare URL used
null
(MD034, no-bare-urls)
622-622: Bare URL used
null
(MD034, no-bare-urls)
622-622: Bare URL used
null
(MD034, no-bare-urls)
622-622: Bare URL used
null
(MD034, no-bare-urls)
622-622: Spaces inside emphasis markers
null
(MD037, no-space-in-emphasis)
633-633: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
650-650: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
664-664: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
723-723: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
784-784: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
826-826: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
840-840: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
891-891: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: test-node (20.x)
- GitHub Check: test-browser (webkit)
- GitHub Check: test-node (18.x)
- GitHub Check: test-browser (firefox)
- GitHub Check: test-browser (chromium)
- GitHub Check: test-node (16.x)
🔇 Additional comments (173)
typedoc.json (1)
24-24
: Renaming '__global.LiveObjectsTypes' to '__global.ObjectsTypes' is consistent with PR objectivesThis change updates the TypeDoc configuration to exclude the renamed "ObjectsTypes" interface from export documentation, maintaining consistency with the broader renaming initiative.
test/support/browser_file_list.js (1)
42-42
:✅ Verification successful
Updated test file path to reflect new 'objects' naming convention
The test file path has been updated from 'test/realtime/live_objects.test.js' to 'test/realtime/objects.test.js', which aligns with the PR objective of renaming "LiveObjects" to "Objects".
Let's verify that the referenced test file has actually been renamed:
🏁 Script executed:
#!/bin/bash # Verify that the test file has been renamed ls -la test/realtime/objects.test.js echo "Checking if old file still exists:" ls -la test/realtime/live_objects.test.js 2>&1 || echo "Old file no longer exists, which is expected"Length of output: 423
Test File Rename Verified
The file update has been successfully validated. The new file at
test/realtime/objects.test.js
exists while the old file (test/realtime/live_objects.test.js
) is no longer present, confirming that the renaming aligns with the PR objective of updating "LiveObjects" to "Objects".scripts/cdn_deploy.js (1)
24-24
:✅ Verification successful
Updated UMD bundle naming pattern in CDN deployment script
The regular expression used for file matching during CDN deployment has been updated to reference 'objects.umd' instead of 'liveobjects.umd', which aligns with the PR objective of renaming across the codebase.
Let's verify that the UMD bundles have been renamed accordingly:
🏁 Script executed:
#!/bin/bash # Check for the existence of the renamed UMD bundle find . -name "objects.umd*.js" -type f echo "Checking if old bundle files still exist:" find . -name "liveobjects.umd*.js" -type f 2>&1 || echo "Old bundle files no longer exist, which is expected"Length of output: 178
CDN Deployment Script: UMD Bundle Naming Verified
The verification script confirms that no files matching
liveobjects.umd*.js
exist, which is expected after the renaming. The regex now correctly targets the updated bundle naming withobjects.umd
. No further changes are needed.test/package/browser/template/src/ably.config.d.ts (1)
18-18
:✅ Verification successful
Renamed interface from 'LiveObjectsTypes' to 'ObjectsTypes'
This update to the interface name follows the PR's objective of renaming "LiveObjects" to "Objects" throughout the codebase. The structure of the interface remains unchanged, preserving functionality.
Let's verify that related references to this interface have been updated throughout the codebase:
🏁 Script executed:
#!/bin/bash # Search for any remaining references to 'LiveObjectsTypes' that may need to be updated echo "Checking for any remaining references to 'LiveObjectsTypes':" rg "LiveObjectsTypes" --type ts --type js # Search for updated references to 'ObjectsTypes' echo "Checking for updated references to 'ObjectsTypes':" rg "ObjectsTypes" --type ts --type jsLength of output: 2357
Interface rename verified – all references updated
The grep outputs confirm that no residual references to "LiveObjectsTypes" remain and that all usages have been updated to "ObjectsTypes" (e.g., in
test/package/browser/template/src/ably.config.d.ts
andtest/package/browser/template/src/index-objects.ts
). The interface structure remains unchanged, preserving functionality as intended.objects.d.ts (1)
8-9
: Naming convention updated correctlyThe renaming from "LiveObjects" to "Objects" has been implemented consistently throughout this declaration file, including in documentation comments, import statements, examples, and the main export. This aligns properly with the PR objective to rename "LiveObjects" to "Objects" when referring to the channel feature.
Also applies to: 14-16, 18-18, 22-24, 26-28
test/common/modules/private_api_recorder.js (1)
21-22
: Private API identifiers updated correctlyThe renaming from "LiveObjects" to "Objects" has been consistently applied across all private API identifiers in the array. The internal property naming has also been updated from "_liveObjectsPool" to "_objectsPool", maintaining consistency throughout the codebase.
Also applies to: 123-124, 141-142
test/package/browser/template/server/server.ts (1)
8-8
: Static file reference updated correctlyThe filename in the array has been properly updated from 'index-liveobjects.js' to 'index-objects.js', ensuring that the server will serve the correct static file after the renaming.
src/common/lib/transport/transport.ts (1)
134-135
: Internal plugin reference updated correctlyThe reference to the internal plugin has been updated from "_LiveObjectsPlugin" to "_objectsPlugin" in the
stringifyProtocolMessage
function call. This maintains consistency with the renaming effort across the codebase.src/common/lib/transport/connectionmanager.ts (1)
1808-1808
: Property name updated correctlyThe reference to
this.realtime._LiveObjectsPlugin
has been changed tothis.realtime._objectsPlugin
as part of the LiveObjects to Objects renaming effort.test/package/browser/template/test/lib/package.test.ts (1)
6-6
: Test scenario and path name updated correctlyTest scenario name has been updated from 'LiveObjects plugin export' to 'Objects plugin export' and the corresponding path has been changed from '/index-liveobjects.html' to '/index-objects.html'.
src/common/lib/transport/comettransport.ts (1)
359-359
: Property name updated correctlyThe reference to
this.connectionManager.realtime._LiveObjectsPlugin
has been changed tothis.connectionManager.realtime._objectsPlugin
in the protocol message deserialization process.src/common/lib/transport/protocol.ts (1)
84-84
: Property name updated correctlyThe reference to
this.transport.connectionManager.realtime._LiveObjectsPlugin
has been changed tothis.transport.connectionManager.realtime._objectsPlugin
in the protocol message stringification process.src/common/lib/transport/websockettransport.ts (1)
143-143
: Property name updated correctly from_LiveObjectsPlugin
to_objectsPlugin
This change correctly implements the renaming from "LiveObjects" to "Objects" for the plugin property in the deserializeProtocolMessage call, aligning with the PR objectives.
test/common/globals/named_dependencies.js (2)
14-17
: Module path and key name updated correctlyThe module key has been properly renamed from
live_objects
toobjects
, and the corresponding build paths have been updated from'build/liveobjects'
to'build/objects'
for both browser and node environments.
30-33
: Helper module path and key name updated correctlyThe helper module key has been properly renamed from
live_objects_helper
toobjects_helper
, and the corresponding paths have been updated from'test/common/modules/live_objects_helper'
to'test/common/modules/objects_helper'
for both browser and node environments.src/plugins/index.d.ts (2)
1-1
: Import statement updated correctlyThe import statement has been properly updated from importing
LiveObjects
from'./liveobjects'
to importingObjects
from'./objects'
.
5-5
: StandardPlugins interface property updated correctlyThe property in the
StandardPlugins
interface has been properly renamed fromLiveObjects?: typeof LiveObjects
toObjects?: typeof Objects
.test/package/browser/template/package.json (2)
7-7
: Build script updated to use new filenameThe build script has been properly updated to reference the new file name
src/index-objects.ts
instead ofsrc/index-liveobjects.ts
.
1-29
:✅ Verification successful
Verify existence of renamed files
While the build script references have been updated correctly, let's ensure that the referenced file
src/index-objects.ts
exists and contains the appropriate code migrated fromsrc/index-liveobjects.ts
.
🏁 Script executed:
#!/bin/bash # Check if the new file exists and compare with the old file name pattern echo "Checking for the existence of new files:" fd -t f "index-objects.ts" test/package/browser/template/src/ echo -e "\nChecking if old files still exist (these should be gone or renamed):" fd -t f "index-liveobjects.ts" test/package/browser/template/src/Length of output: 422
Verification successful: File renaming is correct
The file
test/package/browser/template/src/index-objects.ts
is present, and the legacy filetest/package/browser/template/src/index-liveobjects.ts
is absent as expected. The build scripts inpackage.json
correctly reference the renamed file.
- Verified file:
test/package/browser/template/src/index-objects.ts
exists.- Legacy file check:
test/package/browser/template/src/index-liveobjects.ts
is not found.src/plugins/objects/batchcontextlivecounter.ts (3)
4-4
: Variable renaming looks goodThe import has been correctly updated from
LiveObjects
toObjects
as part of the systematic renaming throughout the codebase.
11-11
: Property renaming is consistentThe private property has been properly renamed from
_liveObjects
to_objects
to match the new naming convention.
14-14
: Method call updates are applied consistentlyAll references to the former
_liveObjects
property have been properly updated to use_objects
instead, ensuring consistent behavior while adhering to the new naming standard.Also applies to: 18-18, 24-24, 26-26, 31-31
src/common/lib/client/baserealtime.ts (3)
16-16
: Import statement correctly updatedThe import type has been properly changed from
LiveObjectsPlugin
toObjectsPlugin
to align with the renaming initiative.
23-23
: Class property correctly renamedThe property has been renamed from
_LiveObjectsPlugin
to_objectsPlugin
, maintaining proper casing conventions for TypeScript private variables.
63-63
: Plugin reference updated correctlyThe reference to the plugin in the options has been updated from
this.options.plugins?.LiveObjects
tothis.options.plugins?.Objects
, ensuring proper integration with the renamed feature.src/plugins/objects/syncobjectsdatapool.ts (5)
3-3
: Import statement correctly updatedThe import statement has been properly modified to use the new
Objects
class name.
25-25
: Class renamed appropriatelyThe class has been successfully renamed from
SyncLiveObjectsDataPool
toSyncObjectsDataPool
in line with the PR objectives.
30-33
: Constructor and property references updated consistentlyThe parameter type has been changed from
_liveObjects: LiveObjects
to_objects: Objects
, and all references within the constructor have been updated accordingly.
58-58
: Logger method names updatedThe logger references have been correctly updated to reflect the new class name in error messages.
Also applies to: 74-74
6-17
: Retained interface names are consistent with PR objectivesThe interface names like
LiveObjectDataEntry
,LiveCounterDataEntry
, andLiveMapDataEntry
still use the "Live" prefix, which aligns with the PR objective to retain individual entity names like "LiveObject," "LiveMap," and "LiveCounter" to avoid conflicts with native language classes.src/plugins/objects/batchcontextlivemap.ts (4)
5-5
: Import statement correctly updatedThe import has been properly changed from
LiveObjects
toObjects
to match the new naming convention.
10-10
: Property correctly renamedThe private property has been properly renamed from
_liveObjects
to_objects
to align with the new terminology.
15-15
: Method call references consistently updatedAll method calls to
throwIfInvalidAccessApiConfiguration()
andthrowIfInvalidWriteApiConfiguration()
now correctly referencethis._objects
instead ofthis._liveObjects
.Also applies to: 26-26, 32-32, 38-38, 44-44, 50-50, 57-57
52-52
: Static method parameters updatedThe parameters to the static methods
LiveMap.createMapSetMessage
andLiveMap.createMapRemoveMessage
have been updated to use the renamed propertythis._objects
.Also applies to: 59-59
src/plugins/objects/objectspool.ts (5)
7-7
: Import statement updated correctly.The import has been properly updated to reflect the renamed class.
14-14
: Class renaming successfully implemented.The class has been properly renamed from
LiveObjectsPool
toObjectsPool
as specified in the PR objectives.
19-20
: Constructor parameter and client initialization updated correctly.The constructor parameter has been properly renamed from
_liveObjects
to_objects
with its type updated toObjects
. The client initialization in line 20 correctly uses the renamed parameter.
61-61
: Zero value method calls updated consistently.The calls to
LiveMap.zeroValue
andLiveCounter.zeroValue
have been updated to use the renamed_objects
parameter instead of_liveObjects
, maintaining functionality while adhering to the new naming convention.Also applies to: 66-66, 76-76
85-85
: Comment properly updated to reference Objects plugin.The documentation comment has been updated to reference "Objects plugin" instead of "LiveObjects plugin", maintaining consistency with the renaming effort throughout the codebase.
src/common/lib/client/modularplugins.ts (2)
14-14
: Import statement updated correctly.The import statement has been properly updated to import from the renamed module path.
36-36
: Interface property renamed appropriately.The property in the
ModularPlugins
interface has been renamed fromLiveObjects
toObjects
to align with the new naming convention.src/plugins/objects/liveobject.ts (4)
3-3
: Import statement updated correctly.The import has been properly updated to reference the renamed
Objects
class.
65-65
: Constructor parameter and client initialization updated correctly.The constructor parameter has been properly renamed from
_liveObjects
to_objects
with its type updated toObjects
. The client initialization in line 68 correctly uses the renamed parameter.Also applies to: 68-68
80-80
: Method call updated to use the renamed parameter.The call to
throwIfInvalidAccessApiConfiguration
has been updated to use the renamed_objects
parameter instead of_liveObjects
.
238-238
: Comment updated for clarity.The comment has been slightly updated to clarify the purpose of merging initial data from the create operation into the live object.
test/package/browser/template/src/index-objects.ts (6)
2-2
: Import path updated correctlyThe import path and module name have been properly updated from
LiveObjects
toObjects
to reflect the renaming change.
13-13
: Plugin initialization updated correctlyThe Realtime initialization now correctly uses the renamed
Objects
plugin.
15-15
: Channel modes updated consistentlyChannel modes have been updated from
STATE_SUBSCRIBE
andSTATE_PUBLISH
toOBJECT_SUBSCRIBE
andOBJECT_PUBLISH
to align with the renaming effort.
17-21
: Variable name and comments updated accuratelyThe variable name has been changed from
liveObjects
toobjects
, and all related comments have been updated to reflect the new terminology while preserving the original meaning.
36-36
: Type reference updated properlyThe type reference has been correctly updated from
LiveObjectsTypes
toObjectsTypes
for type consistency.
64-65
: Type reference in getRoot method updatedThe custom types for the
getRoot
method have been correctly updated to maintain type safety and consistency with the renaming.src/common/lib/client/realtimechannel.ts (7)
33-33
: Import type updated correctlyThe import type has been properly updated from
LiveObjects
toObjects
, maintaining the same functionality.
104-104
: Private member variable renamed consistentlyThe private member variable has been renamed from
_liveObjects
to_objects
to maintain consistency with the new nomenclature.
144-146
: Plugin initialization logic updated accuratelyThe initialization logic now correctly checks for the
Objects
plugin and instantiates it when available.
156-161
: Getter method renamed appropriatelyThe getter method has been renamed from
liveObjects
toobjects
, and the error message updated to reflect the plugin's new name.
553-556
: Comment and object reference updatedThe comment about state re-syncing has been updated to reference "Objects state" instead of "LiveObjects state", and the corresponding code now uses
_objects
instead of_liveObjects
.
618-634
: State handling logic updatedAll references to the plugin in the state handling logic have been updated to use
_objects
instead of_liveObjects
, maintaining the same functionality while using the new terminology.
833-835
: Channel state handling updatedThe channel state handling code has been updated to use the new
_objects
reference, ensuring consistent behavior with the renamed plugin.grunt/esbuild/build.js (4)
80-85
: Build configuration updated appropriatelyThe build configuration has been properly updated to reflect the renaming from "LiveObjects" to "Objects", including entry points, output files, and the UMD library name.
88-93
: CDN configuration updated correctlyThe CDN build configuration has been properly renamed and updated with the correct entry points and output paths.
95-100
: Minified CDN configuration updatedThe minified CDN build configuration has been correctly updated with the new naming convention while maintaining the same functionality.
111-113
: Export references updatedThe exports at the end of the file have been updated to reference the newly named configuration objects.
src/plugins/objects/batchcontext.ts (5)
7-8
: Import paths updated correctlyThe import paths have been properly updated, with
Objects
now imported from the correct location andROOT_OBJECT_ID
imported from the renamed file.
19-24
: Class member and constructor updatedThe class member variable has been renamed from
_liveObjects
to_objects
, and the constructor has been updated to use the new variable name.
27-30
: Method calls updated consistentlyThe
getRoot
method now correctly calls methods on the renamed_objects
property instead of_liveObjects
.
40-60
: Object pool access updatedThe code to access the object pool has been updated to use the renamed
_objects
property, maintaining the same functionality.
95-106
: Publishing logic updatedThe flush method now correctly publishes queued messages using the renamed
_objects
property.Gruntfile.js (4)
76-76
: LGTM: Task dependency rename from 'liveobjects' to 'objects'The task list has been correctly updated to use the new 'build:objects' task instead of 'build:liveobjects'.
141-141
: LGTM: Renamed build task to use new terminologyTask renamed from 'build:liveobjects' to 'build:objects', aligning with the PR objectives.
145-147
: LGTM: Updated ESBuild configurations with new naming conventionThe ESBuild configurations have been correctly updated to use the new naming convention:
- objectsPluginConfig
- objectsPluginCdnConfig
- minifiedObjectsPluginCdnConfig
160-160
: LGTM: Task dependency rename in test:webserver taskThe test:webserver task correctly references the renamed 'build:objects' task.
package.json (4)
33-36
: LGTM: Export path renamed to 'objects'The package.json export path has been correctly updated from 'liveobjects' to 'objects' with appropriate type definitions and import paths.
41-41
: LGTM: Updated reference in files arrayThe TypeScript definition file reference has been updated from 'liveobjects.d.ts' to 'objects.d.ts'.
148-149
: LGTM: Updated test scripts to use new build task namesTest scripts have been updated to use 'build:objects' instead of 'build:liveobjects'.
163-163
: LGTM: Updated build script commandBuild script has been renamed from 'build:liveobjects' to 'build:objects'.
scripts/moduleReport.ts (5)
47-50
: LGTM: Updated type definition and plugin recordThe buildablePlugins record has been updated to use 'objects' instead of 'liveObjects' with the correct path to the new build file.
218-220
: LGTM: Renamed plugin size calculation functionFunction renamed from 'calculateLiveObjectsPluginSize' to 'calculateObjectsPluginSize' with appropriate implementation updates.
320-338
: LGTM: Updated file path checking functionThe 'checkObjectsPluginFiles' function has been updated with the correct file paths in the allowedFiles set, ensuring all references to 'liveobjects' in paths have been changed to 'objects'.
394-394
: LGTM: Updated function call in run functionFunction call updated from 'calculateLiveObjectsPluginSize' to 'calculateObjectsPluginSize'.
403-403
: LGTM: Updated function call in error collectionFunction call updated from 'checkLiveObjectsPluginFiles' to 'checkObjectsPluginFiles'.
src/plugins/objects/livecounter.ts (9)
3-3
: LGTM: Updated import to use new interface nameImport statement updated to use 'Objects' instead of 'LiveObjects'.
20-22
: LGTM: Updated parameter type and name in zeroValue methodParameter renamed from 'liveObjects' to 'objects' with the appropriate type.
30-34
: LGTM: Updated parameter type and name in fromStateObject methodParameter renamed from 'liveObjects' to 'objects' with the appropriate type.
42-46
: LGTM: Updated parameter type and name in fromStateOperation methodParameter renamed from 'liveObjects' to 'objects' with the appropriate type.
51-71
: LGTM: Updated parameter type and name in createCounterIncMessage methodParameter renamed from 'liveObjects' to 'objects' with the appropriate type.
🧰 Tools
🪛 Biome (1.9.4)
[error] 54-54: isFinite is unsafe. It attempts a type coercion. Use Number.isFinite instead.
See the MDN documentation for more details.
Unsafe fix: Use Number.isFinite instead.(lint/suspicious/noGlobalIsFinite)
76-112
: LGTM: Updated parameter type and name in createCounterCreateMessage methodParameter renamed from 'liveObjects' to 'objects' with the appropriate type.
125-128
: LGTM: Updated internal method call in value methodInternal property reference updated from '_liveObjects' to '_objects'.
139-143
: LGTM: Updated references in increment methodProperty and method references updated from '_liveObjects' to '_objects'.
148-157
: LGTM: Updated reference in decrement methodProperty reference updated from '_liveObjects' to '_objects'.
🧰 Tools
🪛 Biome (1.9.4)
[error] 152-152: isFinite is unsafe. It attempts a type coercion. Use Number.isFinite instead.
See the MDN documentation for more details.
Unsafe fix: Use Number.isFinite instead.(lint/suspicious/noGlobalIsFinite)
README.md (14)
597-597
: Updated Import Statement:
The import has been correctly changed to:import Objects from 'ably/objects';Ensure that the module path matches the new file structure.
600-602
: Client Plugin Configuration:
The client instantiation now uses the updated configuration withplugins: { Objects }
, which is consistent with the renaming effort.
605-609
: Plugin Description and CDN Script Update:
The documentation now indicates that the "Objects plugin" works with the modular variant, and the CDN script tag has been updated to loadhttps://cdn.ably.com/lib/objects.umd.min-2.js
. Both changes align well with the new naming.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
609-609: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
616-619
: Global Plugin Instantiation Update:
In the code snippet, the client is now instantiated with:const client = new Ably.Realtime({ ...options, plugins: { Objects: AblyObjectsPlugin }, });This update correctly replaces the old naming. Please verify that
AblyObjectsPlugin
is properly exposed on the global object.
627-632
: Channel Modes Renaming:
The channel modes have been updated toobject_subscribe
andobject_publish
. This change correctly reflects the functionality needed for Objects channels. Ensure that any backend or integration documentation is updated accordingly.
637-643
: Channel Objects API Update:
The instantiation using:const channelOptions = { modes: ['object_subscribe', 'object_publish'] }; const channel = client.channels.get('my_objects_channel', channelOptions); const objects = channel.objects;is now consistent with the new naming conventions. This update improves clarity when accessing the Objects API on a channel.
646-653
: Root Object Access:
The snippet:const root = await objects.getRoot();is correctly updated. Note that while the API now uses the term "Objects," the returned root object remains a
LiveMap
(as intended) to avoid conflicts with core language features.🧰 Tools
🪛 LanguageTool
[style] ~648-~648: Try using a synonym here to strengthen your writing.
Context: ... point for Objects within a channel. It gives access to all other nested Live Objects...(GIVE_PROVIDE)
🪛 markdownlint-cli2 (0.17.2)
650-650: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
693-699
: Objects Creation Method:
The usage of:const counter = await objects.createCounter();demonstrates the proper update from LiveObjects to Objects. Ensure that similar methods (e.g.,
createMap
) are updated consistently across the documentation.
705-713
: Consistency in Object Creation Examples:
Additional examples showing object creation (like passing an initial value withobjects.createCounter(123)
) now follow the updated naming pattern. This consistency helps users correctly understand the API usage.
872-889
: Type Declaration Update:
The TypeScript type definitions have been updated to use theObjectsTypes
interface (e.g., on line ~883). This change clearly distinguishes the API naming from the product name and ensures consistency in editor hints and code completion.
826-834
: Lifecycle Event Handling:
The event subscription examples for synchronization (usingobjects.on('syncing', …)
andobjects.on('synced', …)
) are now updated to match the new naming. The examples are clear and follow the revised API.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
826-826: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
841-848
: Object Deletion Event:
The subscription to the deletion event (e.g.,counter.on('deleted', …)
) remains unchanged, which is appropriate. Confirm that similar events continue to work as documented.
853-862
: Unsubscription Pattern:
The provided examples for deregistering event listeners using.off
, dedicated unsubscribe functions, and.offAll
remain clear and correctly function with the updated API nomenclature.
624-625
: Product Name Consistency:
The reference "For more information about the LiveObjects product" is still present. This is acceptable since the product name is retained even though the API is now referred to as "Objects." Please confirm that this distinction is intentional.ably.d.ts (8)
628-630
: Rename from "LiveObjects functionality" to "Objects functionality" in comment is consistent with PR intent.The rename in the JSDoc comment along with the interface property correctly implements the change from "LiveObjects" to "Objects" as specified in the PR objectives.
875-881
: Appropriately renamed channel mode flags from STATE_ to OBJECT_ naming.**The change from
STATE_PUBLISH
toOBJECT_PUBLISH
andSTATE_SUBSCRIBE
toOBJECT_SUBSCRIBE
correctly aligns with the PR objective to minimize the use of the term "state" in relation to the Objects feature.
1571-1572
: Renamed callback type from LiveObjectsEventCallback to ObjectsEventCallback.This change follows the consistent pattern of renaming "LiveObjects" to "Objects" while maintaining the same functionality.
2055-2071
: Successfully renamed LiveObjectsEvents namespace to ObjectsEvents.The namespace has been properly renamed along with the appropriate documentation updates. The export type
ObjectsEvent
is correctly referencing the new namespace.
2089-2091
: Interface renamed from LiveObjects to Objects with updated documentation.The interface renaming correctly follows the PR's intent to rename from "LiveObjects" to "Objects" while maintaining the same functionality and purpose.
2195-2202
: Updated DefaultRoot type definition to reference ObjectsTypes.The reference to
ObjectsTypes
(replacingLiveObjectsTypes
) is consistent with the renaming strategy, maintaining the same type checking logic while updating terminology.
2629-2631
: Updated property type in RealtimeChannel interface.The
objects
property in the RealtimeChannel interface is now correctly typed with the renamedObjects
interface, completing the consistent renaming throughout the codebase.
1547-1587
: Correctly maintained batch operation naming while updating Objects references.The
BatchCallback
properly references theBatchContext
for grouping "Objects operations" (rather than "LiveObjects operations") while maintaining the method signature and functionality.src/plugins/objects/objects.ts (29)
10-10
: Import path updated correctly.The
ObjectsPool
import path has been properly updated to reflect the new naming convention.
12-12
: Import path updated correctly.The
SyncObjectsDataPool
import path has been properly updated to reflect the new naming convention.
14-17
: Enum renamed appropriately.The enum has been properly renamed from
LiveObjectsEvent
toObjectsEvent
while maintaining the same event values.
19-23
: Enum renamed appropriately.The enum has been properly renamed from
LiveObjectsState
toObjectsState
while maintaining the same state values.
25-29
: Record updated correctly.The
StateToEventsMap
has been appropriately updated to reference the newObjectsEvent
enum values.
31-31
: Type renamed appropriately.The callback type has been properly renamed from
LiveObjectsEventCallback
toObjectsEventCallback
.
33-35
: Interface renamed appropriately.The interface has been properly renamed from
OnLiveObjectsEventResponse
toOnObjectsEventResponse
while maintaining the same interface structure.
39-50
: Class and private fields renamed correctly.The class name has been changed from
LiveObjects
toObjects
and all relevant private fields have been updated to reflect the new naming convention.
60-65
: Constructor implementation updated correctly.All references to state enums and pool initializations have been updated to use the new naming conventions.
69-71
: Documentation updated correctly.The references to "LiveObjects" have been replaced with "Objects" in the documentation comments.
77-82
: Event handling updated correctly.The check for
ObjectsState.synced
and waiting for theObjectsEvent.synced
event have been properly implemented.
85-86
: Documentation updated correctly.The references to "LiveObjects" have been replaced with "Objects" in the documentation comments.
164-184
: Event handler methods updated correctly.The
on
andoff
methods have been updated to use the newObjectsEvent
type andObjectsEventCallback
type.
194-196
: Method signature updated correctly.The return type of
getPool()
has been updated to returnObjectsPool
instead ofLiveObjectsPool
.
222-222
: Method call updated correctly.The call to
_syncObjectsDataPool.applyStateSyncMessages
has been properly updated.
236-243
: State check updated correctly.The condition to check against
ObjectsState.synced
has been properly updated.
255-256
: Logger message updated correctly.The log action reference to 'Objects.onAttached()' has been updated from 'LiveObjects.onAttached()'.
259-273
: State transitions updated correctly.The state checking against
ObjectsState.initialized
and the calls to reset pools have been properly updated.
287-289
: Pool reset calls updated correctly.The calls to reset the object pools have been properly updated to use the new naming conventions.
323-324
: Channel mode check updated correctly.The call to check for the object_subscribe channel mode has been properly updated.
331-332
: Channel mode check updated correctly.The call to check for the object_publish channel mode has been properly updated.
338-342
: State data pool reset call updated correctly.The call to reset the sync objects data pool has been properly updated.
351-355
: End sync state transitions updated correctly.The calls to reset the sync objects data pool and transition to the
ObjectsState.synced
state have been properly updated.
376-379
: Data pool check updated correctly.The check against
_syncObjectsDataPool.isEmpty()
has been properly updated.
383-386
: Pool iteration and access updated correctly.The iteration over the sync objects data pool entries and access to the objects pool have been properly updated.
411-416
: Pool operations updated correctly.The object pool operations for setting and deleting object IDs have been properly updated to use the new naming conventions.
427-458
: Log statements updated correctly.The logger references to 'Objects._applyStateMessages()' have been updated from 'LiveObjects._applyStateMessages()'.
463-472
: Channel mode check updated correctly.The method to check for missing channel modes has been properly updated to validate 'object_subscribe' and 'object_publish'.
474-494
: State transition method updated correctly.The
_stateChange
method has been updated to handleObjectsState
and corresponding events.src/common/lib/types/protocolmessage.ts (12)
15-15
: Import statement updated correctly.The import has been properly updated from
LiveObjectsPlugin
toObjectsPlugin
to reflect the new naming convention.
58-60
: Channel mode flags renamed appropriately.The flags have been renamed from
STATE_SUBSCRIBE
andSTATE_PUBLISH
toOBJECT_SUBSCRIBE
andOBJECT_PUBLISH
, maintaining the same bit positions.
68-69
: MODE_ALL flag composition updated correctly.The
MODE_ALL
flag now correctly references the renamedOBJECT_SUBSCRIBE
andOBJECT_PUBLISH
flags.
86-87
: Channel modes array updated correctly.The channel modes array now includes the renamed
'OBJECT_SUBSCRIBE'
and'OBJECT_PUBLISH'
modes.
96-100
: Deserialization function parameter updated correctly.The parameter has been renamed from
liveObjectsPlugin
toobjectsPlugin
to reflect the new naming convention.
106-107
: fromDeserialized function parameter updated correctly.The parameter has been renamed from
liveObjectsPlugin
toobjectsPlugin
to reflect the new naming convention.
129-137
: State message handling updated correctly.The variable type annotation and conditional blocks have been updated to use
ObjectsPlugin
instead ofLiveObjectsPlugin
.
145-147
: Documentation comment updated correctly.The comment has been updated to reference "Objects" instead of "LiveObjects" for clarity.
148-154
: Function parameter and usage updated correctly.The
makeFromDeserializedWithDependencies
function now correctly referencesObjectsPlugin
instead ofLiveObjectsPlugin
.
165-166
: Stringify function parameter updated correctly.The parameter has been renamed from
liveObjectsPlugin
toobjectsPlugin
to reflect the new naming convention.
180-182
: State message serialization updated correctly.The conditional code for state message stringification now uses
objectsPlugin
instead ofliveObjectsPlugin
.
219-222
: Property documentation updated correctly.The comment has been updated to reference "Objects" instead of "LiveObjects" functionality.
src/plugins/objects/livemap.ts (21)
7-10
: Import statement updated correctly.The import path has been updated to use
Objects
from './objects' replacing the previous import ofLiveObjects
.
56-60
: Constructor parameter renamed appropriately.The constructor parameter has been renamed from
liveObjects
toobjects
to reflect the new naming convention.
68-70
: Static method parameter renamed appropriately.The
zeroValue
static method parameter has been renamed fromliveObjects
toobjects
.
78-82
: Static method parameter renamed appropriately.The
fromStateObject
static method parameter has been renamed fromliveObjects
toobjects
.
90-94
: Static method parameter renamed appropriately.The
fromStateOperation
static method parameter has been renamed fromliveObjects
toobjects
.
100-104
: Static method parameter renamed appropriately.The
createMapSetMessage
static method parameter has been renamed fromliveObjects
toobjects
.
105-107
: Method call updated correctly.The call to
getClient()
now uses the renamed parameterobjects
instead ofliveObjects
.
136-140
: Static method parameter renamed appropriately.The
createMapRemoveMessage
static method parameter has been renamed fromliveObjects
toobjects
.
140-140
: Method call updated correctly.The call to
getClient()
now uses the renamed parameterobjects
instead ofliveObjects
.
165-168
: Static method parameter renamed appropriately.The
validateKeyValue
static method parameter has been renamed fromliveObjects
toobjects
.
169-169
: Method call updated correctly.The call to
getClient()
now uses the renamed parameterobjects
instead ofliveObjects
.
189-190
: Static method parameter renamed appropriately.The
createMapCreateMessage
static method parameter has been renamed fromliveObjects
toobjects
.
196-196
: Method call updated correctly.The call to
validateKeyValue
now uses the renamed parameterobjects
instead ofliveObjects
.
266-267
: Instance method implementation updated correctly.The call to
throwIfInvalidAccessApiConfiguration
now uses_objects
instead of_liveObjects
.
287-288
: Instance method implementation updated correctly.The call to
throwIfInvalidAccessApiConfiguration
now uses_objects
instead of_liveObjects
.
303-304
: Instance method implementation updated correctly.The call to
throwIfInvalidAccessApiConfiguration
now uses_objects
instead of_liveObjects
.
339-342
: Instance method implementation updated correctly.References to
_objects
have replaced_liveObjects
in theset
method implementation.
354-357
: Instance method implementation updated correctly.References to
_objects
have replaced_liveObjects
in theremove
method implementation.
679-680
: Pool access updated correctly.The call to
getPool()
now uses_objects
instead of_liveObjects
.
801-802
: Pool access updated correctly.The call to
getPool()
now uses_objects
instead of_liveObjects
.
822-823
: Pool access updated correctly.The call to
getPool()
now uses_objects
instead of_liveObjects
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this LGTM. We should just wait for https://github.com/ably/realtime/pull/7190 to land in sandbox before merging and ensure tests pass against this
This reminded me that we also changed the REST API route from /state to something else. I forgot to change it in this PR, will fix. Definitely let's wait for sandbox to be updated and test in case I forgot something else |
Isolate API naming from Product naming by using `Objects` in API and code instead of the `LiveObjects` name. Based on the DR [1]. This commit does not change the names of the files (some of them are still using `liveObjects` name) in order to ensure that the changes will not get shadowed by the file renaming and make the review process easier. File names will be change in the following commit. Overview of changes in this commit: - replaced "LiveObjects" naming with "Objects" where it's not referencing the product name. Also tried to minimize the usage of word "state" when talking about Objects feature. For example, replaced phrases like "state on a channel" with "Objects on a channel", "LiveObjects state tree" with "channel Objects", and "channel state" with "channel Objects" or "Objects on a channel". - renamed the interface for `channel.objects` to "Objects". However, "LiveObject", "LiveMap", and "LiveCounter" (this one kept for parity) remain unchanged to avoid conflicts with native language classes like "Map" and "Object". - standardized references in comments and documentation to describe the "Objects" feature on a channel rather than using "LiveObjects" name. In rare cases, the product name is still used to clarify the relationship between the "Objects" feature/plugin and the "LiveObjects" product. - changed the REST API endpoint for LiveObjects to `/channels/{name}/objects`. [1] https://ably.atlassian.net/wiki/spaces/LOB/pages/3819896841/LODR-033+Isolating+API+naming+from+Product+naming+Renaming+state+and+liveobjects+to+objects+in+APIs
b5b04b9
to
706d4ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/package/browser/template/README.md (1)
1-33
: Ensure Overall Documentation ConsistencyThe documentation in the README is clear and coherent with the updated naming convention. As future commits address file name changes and import updates, please verify that all references (including those in code examples, headers, and task descriptions) remain consistent and avoid ambiguity when referring to product versus feature naming.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~1-~1: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: # ably-js NPM package test (for browser) This di...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~3-~3: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...or testing the following aspects of the ably-js NPM package when used in a browser-base...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~5-~5: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...rectly configured and provide access to ably-js’s functionality - that its TypeScript t...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~8-~8: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...tains three files, each of which import ably-js in different manners, and provide a way...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~10-~10: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...c/index-default.tsimports the default ably-js package (
import { Realtime } from 'abl...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~11-~11: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...c/index-objects.tsimports the Objects ably-js plugin (
import Objects from 'ably/obje...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[style] ~12-~12: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ly/objects'). -
src/index-modular.tsimports the tree-shakable ably-js package (
imp...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~12-~12: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...x-modular.tsimports the tree-shakable ably-js package (
import { BaseRealtime, WebSoc...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[style] ~13-~13: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... 'ably/modular'). -
src/ReactApp.tsximports React hooks from the ably-js package (
...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~13-~13: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...ctApp.tsximports React hooks from the ably-js package (
import { useChannel } from 'a...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~17-~17: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ..., without needing to modify it whenever ably-js’s dependencies change. ## React hooks ...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...t are to be used for testing: -build
: Uses esbuild to create: 1. a bundle c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~28-~28: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...e containingsrc/index-default.ts
and ably-js; 2. a bundle containing `src/index-ob...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~29-~29: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...e containingsrc/index-objects.ts
and ably-js. 3. a bundle containing `src/index-mo...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~30-~30: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...e containingsrc/index-modular.ts
and ably-js. -test
: Using the bundles created by...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~31-~31: Loose punctuation mark.
Context: .../index-modular.tsand ably-js. -
test: Using the bundles created by
build` an...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~31-~31: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...tup, tests that the code that exercises ably-js’s functionality is working correctly in...(HYPHENATED_LY_ADVERB_ADJECTIVE)
[uncategorized] ~32-~32: Loose punctuation mark.
Context: ...ng correctly in a browser. -typecheck
: Type-checks the code that imports ably-...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~32-~32: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...eck`: Type-checks the code that imports ably-js.(HYPHENATED_LY_ADVERB_ADJECTIVE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (62)
Gruntfile.js
(3 hunks)README.md
(11 hunks)ably.d.ts
(12 hunks)grunt/esbuild/build.js
(2 hunks)liveobjects.d.ts
(1 hunks)package.json
(3 hunks)scripts/cdn_deploy.js
(1 hunks)scripts/moduleReport.ts
(5 hunks)src/common/lib/client/baserealtime.ts
(2 hunks)src/common/lib/client/modularplugins.ts
(2 hunks)src/common/lib/client/realtimechannel.ts
(7 hunks)src/common/lib/transport/comettransport.ts
(1 hunks)src/common/lib/transport/connectionmanager.ts
(1 hunks)src/common/lib/transport/protocol.ts
(1 hunks)src/common/lib/transport/transport.ts
(1 hunks)src/common/lib/transport/websockettransport.ts
(1 hunks)src/common/lib/types/protocolmessage.ts
(10 hunks)src/plugins/index.d.ts
(1 hunks)src/plugins/liveobjects/batchcontext.ts
(3 hunks)src/plugins/liveobjects/batchcontextlivecounter.ts
(1 hunks)src/plugins/liveobjects/batchcontextlivemap.ts
(2 hunks)src/plugins/liveobjects/index.ts
(1 hunks)src/plugins/liveobjects/livecounter.ts
(7 hunks)src/plugins/liveobjects/livemap.ts
(16 hunks)src/plugins/liveobjects/liveobject.ts
(4 hunks)src/plugins/liveobjects/liveobjects.ts
(18 hunks)src/plugins/liveobjects/liveobjectspool.ts
(4 hunks)src/plugins/liveobjects/syncliveobjectsdatapool.ts
(4 hunks)test/common/globals/named_dependencies.js
(2 hunks)test/common/modules/live_objects_helper.js
(5 hunks)test/common/modules/private_api_recorder.js
(3 hunks)test/package/browser/template/README.md
(1 hunks)test/package/browser/template/server/resources/index-liveobjects.html
(1 hunks)test/package/browser/template/src/ably.config.d.ts
(1 hunks)test/package/browser/template/src/index-liveobjects.ts
(4 hunks)test/package/browser/template/test/lib/package.test.ts
(1 hunks)typedoc.json
(1 hunks)grunt/esbuild/build.js
(1 hunks)package.json
(1 hunks)scripts/moduleReport.ts
(1 hunks)src/common/lib/client/baserealtime.ts
(1 hunks)src/common/lib/client/modularplugins.ts
(1 hunks)src/common/lib/client/realtimechannel.ts
(1 hunks)src/common/lib/types/protocolmessage.ts
(1 hunks)src/plugins/index.d.ts
(1 hunks)src/plugins/objects/batchcontext.ts
(1 hunks)src/plugins/objects/batchcontextlivecounter.ts
(1 hunks)src/plugins/objects/batchcontextlivemap.ts
(1 hunks)src/plugins/objects/index.ts
(1 hunks)src/plugins/objects/livecounter.ts
(1 hunks)src/plugins/objects/livemap.ts
(1 hunks)src/plugins/objects/liveobject.ts
(1 hunks)src/plugins/objects/objects.ts
(1 hunks)src/plugins/objects/objectspool.ts
(1 hunks)src/plugins/objects/syncobjectsdatapool.ts
(1 hunks)test/common/globals/named_dependencies.js
(1 hunks)test/package/browser/template/README.md
(2 hunks)test/package/browser/template/package.json
(1 hunks)test/package/browser/template/server/resources/index-objects.html
(1 hunks)test/package/browser/template/server/server.ts
(1 hunks)test/package/browser/template/test/lib/package.test.ts
(1 hunks)test/support/browser_file_list.js
(1 hunks)
✅ Files skipped from review due to trivial changes (9)
- src/plugins/objects/liveobject.ts
- test/package/browser/template/server/resources/index-liveobjects.html
- src/plugins/objects/syncobjectsdatapool.ts
- src/plugins/objects/livecounter.ts
- src/plugins/objects/batchcontextlivemap.ts
- src/plugins/objects/livemap.ts
- src/plugins/objects/objects.ts
- src/plugins/objects/batchcontextlivecounter.ts
- src/plugins/objects/batchcontext.ts
🚧 Files skipped from review as they are similar to previous changes (36)
- test/package/browser/template/server/resources/index-objects.html
- test/package/browser/template/server/server.ts
- src/plugins/index.d.ts
- src/common/lib/types/protocolmessage.ts
- typedoc.json
- src/plugins/index.d.ts
- src/common/lib/transport/connectionmanager.ts
- grunt/esbuild/build.js
- test/package/browser/template/test/lib/package.test.ts
- src/common/lib/transport/protocol.ts
- scripts/moduleReport.ts
- src/common/lib/client/modularplugins.ts
- src/common/lib/transport/comettransport.ts
- test/common/globals/named_dependencies.js
- test/support/browser_file_list.js
- test/common/globals/named_dependencies.js
- src/common/lib/client/realtimechannel.ts
- src/common/lib/transport/transport.ts
- test/package/browser/template/test/lib/package.test.ts
- scripts/cdn_deploy.js
- test/package/browser/template/package.json
- src/plugins/liveobjects/index.ts
- src/common/lib/client/baserealtime.ts
- src/common/lib/client/baserealtime.ts
- test/package/browser/template/README.md
- src/common/lib/client/modularplugins.ts
- test/package/browser/template/src/ably.config.d.ts
- src/plugins/objects/objectspool.ts
- src/common/lib/transport/websockettransport.ts
- package.json
- grunt/esbuild/build.js
- src/plugins/objects/index.ts
- test/common/modules/private_api_recorder.js
- scripts/moduleReport.ts
- Gruntfile.js
- package.json
🧰 Additional context used
🧠 Learnings (3)
src/plugins/liveobjects/syncliveobjectsdatapool.ts (1)
undefined
<retrieved_learning>
Learnt from: VeskeR
PR: #1897
File: src/plugins/liveobjects/syncliveobjectsdatapool.ts:57-57
Timestamp: 2024-11-12T07:31:53.691Z
Learning: When methods with the same name exist in different classes, references to these methods may remain valid even if a similar method is renamed in another class.
</retrieved_learning>
ably.d.ts (1)
Learnt from: VeskeR
PR: ably/ably-js#1880
File: liveobjects.d.ts:26-26
Timestamp: 2024-11-12T07:31:53.691Z
Learning: For plugins like `LiveObjects`, the `any` type is intentionally used to maintain flexibility.
README.md (1)
Learnt from: VeskeR
PR: ably/ably-js#1897
File: src/plugins/liveobjects/livecounter.ts:93-93
Timestamp: 2024-11-12T07:31:53.691Z
Learning: In the `LiveCounter` class's `_applyCounterCreate` method, it's intentional to increment the counter's value using `+=` instead of initializing it with `=` because the counter may have a pre-existing non-zero value.
🪛 LanguageTool
README.md
[style] ~593-~593: Consider a shorter alternative to avoid wordiness.
Context: ...ealtime clients via the Objects plugin. In order to use Objects on a channel, you must pass...
(IN_ORDER_TO_PREMIUM)
[style] ~648-~648: Try using a synonym here to strengthen your writing.
Context: ... point for Objects within a channel. It gives access to all other nested Live Objects...
(GIVE_PROVIDE)
[uncategorized] ~838-~838: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...g its data or trying to update its value and you should remove all references to the...
(COMMA_COMPOUND_SENTENCE)
test/package/browser/template/README.md
[uncategorized] ~11-~11: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...c/index-objects.ts imports the Objects ably-js plugin (
import Objects from 'ably/obje...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
🪛 markdownlint-cli2 (0.17.2)
README.md
595-595: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
609-609: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
615-615: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
622-622: Bare URL used
null
(MD034, no-bare-urls)
622-622: Bare URL used
null
(MD034, no-bare-urls)
622-622: Bare URL used
null
(MD034, no-bare-urls)
622-622: Bare URL used
null
(MD034, no-bare-urls)
622-622: Spaces inside emphasis markers
null
(MD037, no-space-in-emphasis)
633-633: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
650-650: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
664-664: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
723-723: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
784-784: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
826-826: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
840-840: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
891-891: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: test-browser (webkit)
- GitHub Check: test-node (20.x)
- GitHub Check: test-browser (firefox)
- GitHub Check: test-node (18.x)
- GitHub Check: test-browser (chromium)
- GitHub Check: test-node (16.x)
🔇 Additional comments (103)
test/package/browser/template/README.md (1)
11-11
: Consistent Update to Plugin ReferenceThe import reference now correctly indicates the renaming by showing that
src/index-liveobjects.ts
imports the Objects ably‑js plugin (import Objects from 'ably/objects'
). This aligns well with the PR objective of replacing “LiveObjects” with “Objects” in user‑facing documentation.🧰 Tools
🪛 LanguageTool
[uncategorized] ~11-~11: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...c/index-objects.tsimports the Objects ably-js plugin (
import Objects from 'ably/obje...(HYPHENATED_LY_ADVERB_ADJECTIVE)
liveobjects.d.ts (2)
8-8
: Consistent renaming of "LiveObjects" to "Objects"The changes properly implement the renaming of "LiveObjects" to "Objects" throughout the declaration file, including in documentation comments, import statements, usage examples, and the exported constant declaration.
Also applies to: 14-15, 18-18, 22-24, 26-26, 28-28
14-15
: Note about import path updatesThe import path has been updated to
'ably/objects'
, which aligns with the planned file renaming in the second commit. This ensures that once the file renaming is complete, imports will work correctly without further changes.ably.d.ts (7)
628-630
: Rename to "Objects" looks correct.
The updated doc comment and type property align well with the new Objects feature.
875-880
: ChannelModes rename for Objects publishing and subscribing is consistent.
These additions logically match the renamed feature.
896-897
: OBJECT_PUBLISH and OBJECT_SUBSCRIBE enum members are coherent with ChannelModes.
No issues identified; they match the newly introduced modes.
1570-1572
: ObjectsEventCallback rename is consistent.
Renaming from a "LiveObjects" callback to "Objects" is a sound change.
1580-1583
: Batch callback docs updated for Objects.
Reference toObjects.batch
is accurate; no concerns found.
2090-2092
: Interface documentation for Objects reflects the rename accurately.
The new phrasing clearly describes the "Objects" functionality.
2157-2157
: Updated event handlers for Objects.
Use ofObjectsEvent
andObjectsEventCallback
is consistent with the rename; no issues noted.Also applies to: 2165-2165
src/plugins/liveobjects/liveobject.ts (4)
3-3
: Import renamed correctly fromLiveObjects
toObjects
The import has been correctly updated as part of the renaming effort from "LiveObjects" to "Objects" throughout the codebase.
65-65
: Constructor parameter and internal references correctly renamedBoth the constructor parameter and internal reference have been properly renamed from
_liveObjects
to_objects
, maintaining consistency with the renaming strategy outlined in the PR objectives.Also applies to: 68-68
80-80
: Method call updated to use the renamed fieldThe method call has been correctly updated to use
this._objects
instead ofthis._liveObjects
when validating the API configuration.
238-238
: Comment updated to minimize use of "state"The comment has been appropriately modified to indicate that initial data is merged into the live object rather than the "live object state," which aligns with the PR objective of minimizing references to "state" in relation to the Objects feature.
test/common/modules/live_objects_helper.js (5)
3-7
: Properly updated module imports and documentation.The changes correctly update the documentation comment and import statement to reference "Objects" instead of "LiveObjects". The
ObjectsPlugin
parameter in themakeProtocolMessageFromDeserialized
call has also been properly updated to match the new naming convention.
22-22
: Class name updated correctly.The class has been appropriately renamed from
LiveObjectsHelper
toObjectsHelper
, aligning with the PR objective to update terminology throughout the codebase.
34-35
: Documentation comment updated correctly.The comment has been properly updated to reference "Objects state tree" instead of "LiveObjects state tree", maintaining consistency with the new terminology.
313-314
: REST API endpoint updated correctly.The path has been properly changed from
/channels/${channelName}/state
to/channels/${channelName}/objects
, ensuring that the client code uses the updated endpoint. This resolves the issue mentioned in the PR comments about updating the REST API route.
332-332
: Module export updated to match new class name.The module export has been correctly updated to reference the renamed
ObjectsHelper
class, maintaining consistency with the new naming convention.src/plugins/liveobjects/batchcontextlivecounter.ts (4)
4-4
: Naming convention update looks good.The import has been correctly updated from
LiveObjects
toObjects
while keeping the file path unchanged, which aligns with the two-phase approach mentioned in the PR (where file renaming will be handled in a separate commit).
11-11
: Parameter renaming looks good.The constructor parameter has been consistently renamed from
_liveObjects
to_objects
along with its usage in the constructor body.Also applies to: 14-14
18-18
: Method references updated correctly.All method calls that previously used
_liveObjects
have been properly updated to use_objects
consistently throughout the class methods.Also applies to: 24-24, 31-31
26-26
: Static method call updated correctly.The parameter passed to
LiveCounter.createCounterIncMessage()
has been updated from_liveObjects
to_objects
while correctly maintaining theLiveCounter
class name (as mentioned in the PR objectives about retaining certain class names).src/plugins/liveobjects/batchcontextlivemap.ts (6)
5-5
: The import update looks goodThe import statement has been correctly updated to use
Objects
instead ofLiveObjects
while maintaining the same import path, which aligns with the PR's first commit goals of updating references while leaving file paths for a subsequent commit.
10-10
: Private member variable rename looks goodThe private member variable has been correctly renamed from
_liveObjects
to_objects
, which aligns with the PR objective to rename "LiveObjects" to "Objects" throughout the codebase.
15-15
: Method reference update is consistentThe method call has been updated to reference
_objects
instead of_liveObjects
, maintaining functionality while updating the naming.
26-26
: Method reference updates in accessor methods are consistentAll accessor methods (
size
,entries
,keys
,values
) have been consistently updated to use_objects
instead of_liveObjects
for validation checks.Also applies to: 32-32, 38-38, 44-44
50-53
: Method reference updates in the set method are consistentThe
set
method has been updated to use_objects
instead of_liveObjects
for both validation and state message creation, maintaining the same functionality while updating the naming.
57-59
: Method reference updates in the remove method are consistentThe
remove
method has been updated to use_objects
instead of_liveObjects
for both validation and state message creation, maintaining the same functionality while updating the naming.src/common/lib/client/realtimechannel.ts (10)
33-33
: Type import correctly renamedThe import statement has been updated to use
Objects
instead ofLiveObjects
, which aligns with the renaming initiative.
104-104
: Property rename is consistentThe private member variable has been renamed from
_liveObjects
to_objects
, maintaining the same naming pattern.
144-145
: Plugin initialization correctly updatedThe initialization code now properly instantiates
_objects
instead of_liveObjects
when the Objects plugin is available.
156-160
: Getter method appropriately renamedThe public getter method has been renamed from
liveObjects
toobjects
, and the error handling for missing plugins has been updated accordingly.
554-556
: Comment and implementation updated consistentlyBoth the comment and implementation code have been updated to reference "Objects state" instead of "LiveObjects state".
618-618
: Conditional check properly renamedThe conditional check has been updated to use
_objects
instead of_liveObjects
.
625-627
: Plugin reference correctly renamedThe reference to the plugin has been updated from
_liveObjectsPlugin
to_objectsPlugin
while preserving the error handling logic.
631-631
: Method call updated properlyThe method call has been updated to use
_objects.handleStateMessages()
instead of_liveObjects.handleStateMessages()
.
633-633
: Method call correctly renamedThe method call has been updated to use
_objects.handleStateSyncMessages()
while maintaining the same parameter structure.
833-834
: Channel state handler correctly updatedThe reference in the channel state handling logic has been updated from
_liveObjects
to_objects
.src/plugins/liveobjects/batchcontext.ts (9)
7-7
: Import renamed from LiveObjects to ObjectsThe import statement has been correctly updated to use the new Objects naming convention while maintaining the same file path.
13-13
: Comment syntax updatedThe comment syntax has been properly formatted with JSDoc style to document the private class property.
19-19
: Parameter renamed from _liveObjects to _objectsThe private parameter has been properly renamed to follow the new naming convention specified in the PR objectives.
22-23
: Method calls updated to use _objectsThe method calls have been correctly updated to use the renamed _objects parameter instead of _liveObjects, ensuring functionality is maintained.
27-27
: Method call updated to use _objectsThe call to throwIfInvalidAccessApiConfiguration has been properly updated to use the renamed parameter.
40-40
: Pool access updated to use _objectsThe call to getPool().get() has been correctly updated to use the renamed _objects parameter.
47-47
: BatchContextLiveMap constructor parameter updatedThe BatchContextLiveMap constructor call has been properly updated to use the renamed _objects parameter.
49-49
: BatchContextLiveCounter constructor parameter updatedThe BatchContextLiveCounter constructor call has been properly updated to use the renamed _objects parameter.
100-100
: Publish method call updatedThe call to publish() has been correctly updated to use the renamed _objects parameter.
src/plugins/liveobjects/liveobjectspool.ts (4)
6-6
: LGTM - Consistent renaming from LiveObjects to ObjectsThe changes correctly implement the renaming from "LiveObjects" to "Objects" in import statements, class name, and constructor parameter while maintaining the actual functionality.
Also applies to: 14-14, 19-20
61-61
: LGTM - Updated references in zeroValue methodsReferences to
this._liveObjects
have been properly updated tothis._objects
in the zeroValue method calls for both LiveMap and LiveCounter classes.Also applies to: 66-66
76-76
: LGTM - Updated reference in _getInitialPool methodThe reference to
this._liveObjects
has been correctly updated tothis._objects
in the _getInitialPool method.
85-85
: LGTM - Updated reference in commentThe comment has been properly updated to reference "Objects plugin" instead of "LiveObjects plugin", maintaining consistency with the renaming throughout the codebase.
src/plugins/liveobjects/syncliveobjectsdatapool.ts (4)
3-3
: Correctly updating import to use the new "Objects" naming.This change aligns with the PR objective to rename "LiveObjects" to "Objects" while maintaining the original file path (which will be updated in a subsequent commit).
25-25
: Class name updated to follow new naming convention.The class has been renamed from
SyncLiveObjectsDataPool
toSyncObjectsDataPool
in line with the PR objectives.
30-33
: Constructor parameter and references updated correctly.The constructor now uses
_objects: Objects
instead of the previous_liveObjects: LiveObjects
, with corresponding updates to property references. This maintains functionality while implementing the new naming convention.
58-58
: Log message identifiers updated consistently.Log messages have been updated to use the new class name
SyncObjectsDataPool
instead ofSyncLiveObjectsDataPool
, ensuring consistent naming throughout the code including diagnostic output.Also applies to: 74-74
test/package/browser/template/src/index-liveobjects.ts (7)
2-2
: Import statement correctly updated to use ObjectsThe import statement has been properly updated to import
Objects
from 'ably/objects' instead of LiveObjects, aligning with the PR objective to rename all instances of "LiveObjects" to "Objects".
13-13
: Plugin configuration successfully updatedThe Ably.Realtime initialization has been properly updated to use
Objects
in the plugins configuration instead of LiveObjects, maintaining the functionality while adopting the new naming convention.
15-21
: Channel modes and objects reference updated correctlyThe channel modes have been appropriately updated from STATE_SUBSCRIBE/STATE_PUBLISH to OBJECT_SUBSCRIBE/OBJECT_PUBLISH, and the
objects
property is now being accessed instead ofliveObjects
. The comments have also been updated to reference "Objects" while still correctly referring to the underlying structures as LiveMap.
26-27
: Comment updated to use ObjectsTypesThe comment has been correctly updated to reference ObjectsTypes instead of LiveObjectsTypes, maintaining consistency with the renamed feature.
36-36
: Type reference properly updatedThe type reference has been updated from LiveObjectsTypes to ObjectsTypes, ensuring type safety and maintaining consistency with the renamed feature.
64-65
: Custom type references updated correctlyThe comment and the getRoot method call have been properly updated to use
objects
and reference the global ObjectsTypes interface, maintaining consistency with the renamed feature while preserving the custom type functionality.
1-67
: Verify file name matches the contentWhile the code changes themselves look good, I noticed that the file name is still
index-liveobjects.ts
. As mentioned in the PR objectives, the second commit will address file names and import statements, so this is expected at this stage. Just confirming that this file will be renamed in the upcoming commit.src/plugins/liveobjects/livecounter.ts (9)
2-2
: Import renamed from LiveObjects to Objects.The import statement has been correctly updated to use the new naming convention, importing
Objects
instead of what was likelyLiveObjects
previously. This change aligns with the PR objective to rename LiveObjects to Objects.
20-21
: Parameter name updated from 'liveobjects' to 'objects' in static method.The
zeroValue
method's parameter has been properly renamed while maintaining its type and functionality. The constructor call has been updated accordingly to use the new parameter name.
30-31
: Parameter name updated from 'liveobjects' to 'objects' in fromStateObject method.The parameter renaming in this static method is consistent with the naming convention change, and the constructor call on the following line has been correctly updated to match.
42-43
: Parameter name updated from 'liveobjects' to 'objects' in fromStateOperation method.The parameter renaming is consistent with the overall pattern, and the constructor call on line 43 has been properly updated to use the new parameter name.
51-52
: Parameter and method call updated in createCounterIncMessage.The parameter has been renamed from 'liveobjects' to 'objects', and the subsequent method call to get the client has been updated to use the new parameter name.
76-77
: Parameter and method call updated in createCounterCreateMessage.The async method's parameter has been renamed from 'liveobjects' to 'objects', and the client retrieval method call has been updated to match the new naming convention.
126-126
: Instance variable reference updated from '_liveObjects' to '_objects'.The instance method is now referencing the renamed instance variable
_objects
instead of what was previously_liveObjects
, maintaining consistent naming throughout the class.
140-142
: Multiple instance variable references updated in increment method.All references to the instance variable have been consistently renamed from '_liveObjects' to '_objects', including the API configuration check and the static method call with the new parameter name.
149-149
: Instance variable reference updated in decrement method.The instance variable reference has been correctly renamed in the API configuration validation call, maintaining consistency with the other method updates.
src/plugins/liveobjects/liveobjects.ts (12)
10-10
: Import paths still use old naming patternsWhile the class and variable names have been updated to use "Objects" instead of "LiveObjects", the import paths still use the old naming convention (e.g., './liveobjectspool', './syncliveobjectsdatapool'). This is likely intentional for the first commit as mentioned in the PR objectives, where file names will be addressed in a subsequent commit.
Make sure that the second commit addresses these import paths to maintain consistency in the codebase.
Also applies to: 12-12
14-17
: Enum and Record updates look goodThe renaming of enums from
LiveObjectsEvent
toObjectsEvent
andLiveObjectsState
toObjectsState
is consistent, and all related references in theStateToEventsMap
have been updated properly.Also applies to: 19-23, 25-29
31-35
: Consistent rename of class and type definitionsThe
ObjectsEventCallback
type,OnObjectsEventResponse
interface, andObjects
class have been renamed consistently from their "LiveObjects" equivalents while maintaining the same structure and functionality.Also applies to: 39-52
57-66
: Constructor correctly initializes new class namesThe constructor has been updated to properly initialize state using
ObjectsState
and create instances ofObjectsPool
andSyncObjectsDataPool
with the new naming convention.
68-82
: Documentation and state checks properly updatedThe method comments now correctly refer to the "Objects feature" instead of "LiveObjects", and the state checks and event references have been updated to use the new enum names.
117-131
: Object pool references consistently updatedAll references to
_objectsPool
have been updated to use the new name while maintaining the same object retrieval and storage functionality.Also applies to: 149-162
164-178
: Event handling methods updated correctlyThe
on
andoff
method signatures have been updated to useObjectsEvent
instead ofLiveObjectsEvent
, and thegetPool
method now correctly returnsObjectsPool
instead ofLiveObjectsPool
.Also applies to: 191-196
219-225
: Sync and state handling methods properly updatedReferences to data pools, state checks, and log messages have been consistently updated to use the "Objects" terminology instead of "LiveObjects".
Also applies to: 233-239, 252-262
265-272
: Pool reset operations updated correctlyAll references to
_objectsPool
and_syncObjectsDataPool
in reset operations have been updated to use the new naming convention.Also applies to: 284-291
373-388
: Sync application methods consistently updatedAll references to pools, object operations, and log messages in the sync application methods have been updated to use the "Objects" terminology.
Also applies to: 408-418, 424-430
445-466
: Object creation and state change methods properly renamedMethods for creating objects and changing state now use the updated class and enum names consistently.
Also applies to: 471-477
320-344
:❓ Verification inconclusive
Validation methods and sync operations properly renamed
The method
_throwIfMissingChannelMode
now checks forobject_subscribe
andobject_publish
instead of what was likelyliveobject_subscribe
andliveobject_publish
. State change calls now useObjectsState
enum values.Also applies to: 348-357
🏁 Script executed:
#!/bin/bash # Check if there are any remaining references to `liveobject_subscribe` or `liveobject_publish` in the codebase echo "Checking for any remaining references to old channel modes..." rg -i "liveobject_(subscribe|publish)" --type tsLength of output: 183
Renaming verification and code consistency confirmation
The changes in the validation methods and synchronization operations appear to be correct. The check for any remaining references to
liveobject_subscribe
andliveobject_publish
returned no results, supporting that the renaming (to usingobject_subscribe
,object_publish
, and theObjectsState
enum) has been correctly implemented across the affected code segments (lines 320-344 and 348-357 insrc/plugins/liveobjects/liveobjects.ts
).Please perform a manual verification to ensure that all instances and related logic were fully refactored as expected.
README.md (8)
591-593
: Terminology update looks goodThe renaming from "LiveObjects" to "Objects" for the plugin section is clear and consistent with the stated PR objectives.
🧰 Tools
🪛 LanguageTool
[style] ~593-~593: Consider a shorter alternative to avoid wordiness.
Context: ...ealtime clients via the Objects plugin. In order to use Objects on a channel, you must pass...(IN_ORDER_TO_PREMIUM)
597-602
: API import and plugin registration updated properlyThe import statement and plugin registration have been correctly updated to use the new "Objects" naming.
605-623
: CDN references and global object naming updated correctlyAll references to CDN paths, UMD bundle names, and global object variables have been properly renamed for consistency with the Objects plugin naming.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
609-609: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
615-615: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
622-622: Bare URL used
null(MD034, no-bare-urls)
622-622: Bare URL used
null(MD034, no-bare-urls)
622-622: Bare URL used
null(MD034, no-bare-urls)
622-622: Bare URL used
null(MD034, no-bare-urls)
622-622: Spaces inside emphasis markers
null(MD037, no-space-in-emphasis)
626-642
: Updated channel modes to use "object_" prefixThe channel modes have been appropriately renamed from
state_subscribe
andstate_publish
toobject_subscribe
andobject_publish
, and the channel reference has been updated fromchannel.liveObjects
tochannel.objects
.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
633-633: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
648-655
: Root object access API updated correctlyThe method for accessing the root object has been updated from
liveObjects.getRoot()
toobjects.getRoot()
while maintaining the same functionality.🧰 Tools
🪛 LanguageTool
[style] ~648-~648: Try using a synonym here to strengthen your writing.
Context: ... point for Objects within a channel. It gives access to all other nested Live Objects...(GIVE_PROVIDE)
🪛 markdownlint-cli2 (0.17.2)
650-650: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
778-808
: Object creation and batch operations API updatedThe method calls for creating objects and performing batch operations have been correctly updated to use the new
objects
namespace.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
784-784: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
806-806: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
824-865
: Lifecycle event handling updated properlyThe synchronization event handlers and lifecycle event management APIs have been correctly updated to use
objects
instead ofliveObjects
.🧰 Tools
🪛 LanguageTool
[uncategorized] ~838-~838: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...g its data or trying to update its value and you should remove all references to the...(COMMA_COMPOUND_SENTENCE)
🪛 markdownlint-cli2 (0.17.2)
826-826: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
840-840: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
852-852: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
868-913
: TypeScript type definitions renamed appropriatelyThe TypeScript interface has been renamed from
LiveObjectsTypes
toObjectsTypes
while maintaining the same functionality and type structure.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
871-871: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
891-891: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
901-901: Code block style
Expected: indented; Actual: fenced(MD046, code-block-style)
src/common/lib/types/protocolmessage.ts (8)
15-15
: Import statement updated correctlyThe import statement has been properly updated to import
ObjectsPlugin
instead ofLiveObjectsPlugin
.
58-69
: Flag constants renamed correctlyThe channel mode flags
STATE_SUBSCRIBE
andSTATE_PUBLISH
have been properly renamed toOBJECT_SUBSCRIBE
andOBJECT_PUBLISH
, and theMODE_ALL
flag has been updated to include these new flags.
86-88
: Channel modes array updatedThe channel modes array has been updated to include the new mode names
OBJECT_SUBSCRIBE
andOBJECT_PUBLISH
.
92-101
: Deserialize function signature updatedThe function signature and implementation of
deserialize
have been updated to useobjectsPlugin
instead ofliveObjectsPlugin
.
103-137
: FromDeserialized function updated correctlyThe
fromDeserialized
function has been properly updated to useobjectsPlugin
andObjectsPlugin.StateMessage
types and methods.
145-156
: Test helper function updated properlyThe comments and implementation of
makeFromDeserializedWithDependencies
have been updated to reflect the renamed plugin.
162-182
: Stringify function updated to use objectsPluginThe
stringify
function has been properly updated to useobjectsPlugin
when handling state messages.
219-222
: ProtocolMessage class property documentation updatedThe JSDoc comment and type annotation for the
state
property have been updated to reference "Objects functionality" instead of "LiveObjects functionality".src/plugins/liveobjects/livemap.ts (3)
6-6
: Import statement correctly updated.The import statement has been properly updated to reflect the renaming from 'LiveObjects' to 'Objects', while maintaining the same file path structure.
56-60
: Constructor and static method parameters consistently renamed.All method parameters and constructor arguments have been systematically updated from 'liveObjects' to 'objects' to align with the new naming convention. The parameter type has also been properly updated from 'LiveObjects' to 'Objects'. This also includes consistent updates to associated method calls like getClient() and validateKeyValue().
Also applies to: 68-69, 78-79, 90-91, 100-107, 136-140, 165-169, 189-196
266-266
: Instance property accesses successfully renamed.All instance property accesses have been correctly renamed from '_liveObjects' to '_objects' throughout the class. This includes accesses to methods like throwIfInvalidAccessApiConfiguration(), throwIfInvalidWriteApiConfiguration(), publish(), and getPool(). These consistent changes help maintain the codebase's readability while following the rename refactoring objectives without altering functionality.
Also applies to: 287-287, 303-303, 339-341, 354-356, 679-679, 801-801, 822-822
@VeskeR https://github.com/ably/realtime/pull/7190 is now merged, so should be in sandbox soon |
PR is split into two commits to simplify the review process.
First one renames all mentiones of "LiveObjects" to "Objects" where necessary, without changing the file names themselves.
The second commit changes only the file names and import statements.
This PR isolates API naming from Product naming by using
Objects
in API andcode instead of the
LiveObjects
name. Based on the DR [1].This commit does not change the names of the files (some of them are
still using
liveObjects
name) in order to ensure that the changes willnot get shadowed by the file renaming and make the review process easier.
File names will be change in the following commit.
Overview of changes in this commit:
referencing the product name. Also tried to minimize the usage of word
"state" when talking about Objects feature. For example, replaced
phrases like "state on a channel" with "Objects on a channel",
"LiveObjects state tree" with "channel Objects", and "channel state"
with "channel Objects" or "Objects on a channel".
channel.objects
to "Objects". However,"LiveObject", "LiveMap", and "LiveCounter" (this one kept for parity)
remain unchanged to avoid conflicts with native language classes like
"Map" and "Object".
"Objects" feature on a channel rather than using "LiveObjects" name.
In rare cases, the product name is still used to clarify the
relationship between the "Objects" feature/plugin and the "LiveObjects"
product.
[1] https://ably.atlassian.net/wiki/spaces/LOB/pages/3819896841/LODR-033+Isolating+API+naming+from+Product+naming+Renaming+state+and+liveobjects+to+objects+in+APIs
Resolves PUB-1242
Summary by CodeRabbit
Refactor
Documentation
Tests