Skip to content
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

Open
wants to merge 2 commits into
base: integration/liveobjects
Choose a base branch
from

Conversation

VeskeR
Copy link
Contributor

@VeskeR VeskeR commented Mar 5, 2025

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 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.

[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

    • Renamed the "LiveObjects" plugin to "Objects" throughout the codebase for consistency.
    • Updated task names, build commands, and logging references to reflect the new naming.
  • Documentation

    • Revised documentation, API examples, and configuration instructions to use "Objects" instead of "LiveObjects".
  • Tests

    • Adjusted test scripts and helper modules to align with the renamed plugin.

@VeskeR VeskeR requested a review from mschristensen March 5, 2025 07:30
Copy link

coderabbitai bot commented Mar 5, 2025

Walkthrough

This 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

File(s) Change Summary
Gruntfile.js, grunt/.../build.js Renamed build tasks and configuration constants from build:liveobjects to build:objects, updating entry points, output filenames, and plugin names.
README.md, test/package/browser/template/README.md Updated documentation and code examples to replace “LiveObjects” with “Objects”, including import statements, channel modes, and type references.
ably.d.ts, objects.d.ts, typedoc.json, test/package/browser/template/src/ably.config.d.ts Refactored type declarations, interfaces, enums, and global type references to the new “Objects” naming convention.
package.json, scripts/cdn_deploy.js, scripts/moduleReport.ts Revised package exports, test/build scripts, file references, and reporting functions to use “objects” instead of “liveobjects”.
src/common/lib/client/{baserealtime.ts, modularplugins.ts, realtimechannel.ts} and src/common/lib/transport/* Modified client and transport modules to update plugin property names (e.g., _LiveObjectsPlugin to _objectsPlugin) and revised related function arguments.
src/plugins/index.d.ts, src/plugins/liveobjects/index.ts (deleted), src/plugins/objects/* Reworked plugin implementation files by renaming classes, methods, and internal variables from “LiveObjects” to “Objects”, including pools, maps, counters, and helper modules.
test/{common/globals/named_dependencies.js, common/modules/objects_helper.js, common/modules/private_api_recorder.js, support/browser_file_list.js} and test/package/browser/template/{package.json, server/resources/index-objects.html, server/server.ts, test/lib/package.test.ts} Adjusted test files and helper modules to update file names, keys, scenario names, and module references from “liveobjects” to “objects”.

Possibly related PRs

Suggested reviewers

  • mschristensen
  • zknill
  • kaschula

Poem

I’m a little rabbit, hopping through the code,
Renaming LiveObjects to Objects down the old road.
Tasks and types now wear a fresh new name,
In every file, they’re never quite the same.
With every hop, our project springs to life—
A bundle of changes, joyful as can be! 🐇

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

liveobjects.d.ts

Oops! Something went wrong! :(

ESLint: 7.32.0

No files matching the pattern "liveobjects.d.ts" were found.
Please check for typing mistakes in the pattern.

src/plugins/liveobjects/batchcontext.ts

Oops! Something went wrong! :(

ESLint: 7.32.0

No files matching the pattern "src/plugins/liveobjects/batchcontext.ts" were found.
Please check for typing mistakes in the pattern.

src/plugins/liveobjects/batchcontextlivecounter.ts

Oops! Something went wrong! :(

ESLint: 7.32.0

No files matching the pattern "src/plugins/liveobjects/batchcontextlivecounter.ts" were found.
Please check for typing mistakes in the pattern.

  • 10 others

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot temporarily deployed to staging/pull/1982/features March 5, 2025 07:30 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1982/bundle-report March 5, 2025 07:30 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1982/typedoc March 5, 2025 07:30 Inactive
Copy link

@coderabbitai coderabbitai bot left a 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.ts imports 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 to src/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 containing src/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

📥 Commits

Reviewing files that changed from the base of the PR and between 24aba84 and b5b04b9.

📒 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 objectives

This 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 with objects.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 js

Length 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 and test/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 correctly

The 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 correctly

The 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 correctly

The 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 correctly

The 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 correctly

The reference to this.realtime._LiveObjectsPlugin has been changed to this.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 correctly

Test 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 correctly

The reference to this.connectionManager.realtime._LiveObjectsPlugin has been changed to this.connectionManager.realtime._objectsPlugin in the protocol message deserialization process.

src/common/lib/transport/protocol.ts (1)

84-84: Property name updated correctly

The reference to this.transport.connectionManager.realtime._LiveObjectsPlugin has been changed to this.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 correctly

The module key has been properly renamed from live_objects to objects, 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 correctly

The helper module key has been properly renamed from live_objects_helper to objects_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 correctly

The import statement has been properly updated from importing LiveObjects from './liveobjects' to importing Objects from './objects'.


5-5: StandardPlugins interface property updated correctly

The property in the StandardPlugins interface has been properly renamed from LiveObjects?: typeof LiveObjects to Objects?: typeof Objects.

test/package/browser/template/package.json (2)

7-7: Build script updated to use new filename

The build script has been properly updated to reference the new file name src/index-objects.ts instead of src/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 from src/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 file test/package/browser/template/src/index-liveobjects.ts is absent as expected. The build scripts in package.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 good

The import has been correctly updated from LiveObjects to Objects as part of the systematic renaming throughout the codebase.


11-11: Property renaming is consistent

The private property has been properly renamed from _liveObjects to _objects to match the new naming convention.


14-14: Method call updates are applied consistently

All 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 updated

The import type has been properly changed from LiveObjectsPlugin to ObjectsPlugin to align with the renaming initiative.


23-23: Class property correctly renamed

The property has been renamed from _LiveObjectsPlugin to _objectsPlugin, maintaining proper casing conventions for TypeScript private variables.


63-63: Plugin reference updated correctly

The reference to the plugin in the options has been updated from this.options.plugins?.LiveObjects to this.options.plugins?.Objects, ensuring proper integration with the renamed feature.

src/plugins/objects/syncobjectsdatapool.ts (5)

3-3: Import statement correctly updated

The import statement has been properly modified to use the new Objects class name.


25-25: Class renamed appropriately

The class has been successfully renamed from SyncLiveObjectsDataPool to SyncObjectsDataPool in line with the PR objectives.


30-33: Constructor and property references updated consistently

The 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 updated

The 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 objectives

The interface names like LiveObjectDataEntry, LiveCounterDataEntry, and LiveMapDataEntry 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 updated

The import has been properly changed from LiveObjects to Objects to match the new naming convention.


10-10: Property correctly renamed

The private property has been properly renamed from _liveObjects to _objects to align with the new terminology.


15-15: Method call references consistently updated

All method calls to throwIfInvalidAccessApiConfiguration() and throwIfInvalidWriteApiConfiguration() now correctly reference this._objects instead of this._liveObjects.

Also applies to: 26-26, 32-32, 38-38, 44-44, 50-50, 57-57


52-52: Static method parameters updated

The parameters to the static methods LiveMap.createMapSetMessage and LiveMap.createMapRemoveMessage have been updated to use the renamed property this._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 to ObjectsPool 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 to Objects. The client initialization in line 20 correctly uses the renamed parameter.


61-61: Zero value method calls updated consistently.

The calls to LiveMap.zeroValue and LiveCounter.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 from LiveObjects to Objects 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 to Objects. 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 correctly

The import path and module name have been properly updated from LiveObjects to Objects to reflect the renaming change.


13-13: Plugin initialization updated correctly

The Realtime initialization now correctly uses the renamed Objects plugin.


15-15: Channel modes updated consistently

Channel modes have been updated from STATE_SUBSCRIBE and STATE_PUBLISH to OBJECT_SUBSCRIBE and OBJECT_PUBLISH to align with the renaming effort.


17-21: Variable name and comments updated accurately

The variable name has been changed from liveObjects to objects, and all related comments have been updated to reflect the new terminology while preserving the original meaning.


36-36: Type reference updated properly

The type reference has been correctly updated from LiveObjectsTypes to ObjectsTypes for type consistency.


64-65: Type reference in getRoot method updated

The 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 correctly

The import type has been properly updated from LiveObjects to Objects, maintaining the same functionality.


104-104: Private member variable renamed consistently

The private member variable has been renamed from _liveObjects to _objects to maintain consistency with the new nomenclature.


144-146: Plugin initialization logic updated accurately

The initialization logic now correctly checks for the Objects plugin and instantiates it when available.


156-161: Getter method renamed appropriately

The getter method has been renamed from liveObjects to objects, and the error message updated to reflect the plugin's new name.


553-556: Comment and object reference updated

The 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 updated

All 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 updated

The 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 appropriately

The 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 correctly

The CDN build configuration has been properly renamed and updated with the correct entry points and output paths.


95-100: Minified CDN configuration updated

The minified CDN build configuration has been correctly updated with the new naming convention while maintaining the same functionality.


111-113: Export references updated

The 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 correctly

The import paths have been properly updated, with Objects now imported from the correct location and ROOT_OBJECT_ID imported from the renamed file.


19-24: Class member and constructor updated

The 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 consistently

The getRoot method now correctly calls methods on the renamed _objects property instead of _liveObjects.


40-60: Object pool access updated

The code to access the object pool has been updated to use the renamed _objects property, maintaining the same functionality.


95-106: Publishing logic updated

The 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 terminology

Task renamed from 'build:liveobjects' to 'build:objects', aligning with the PR objectives.


145-147: LGTM: Updated ESBuild configurations with new naming convention

The ESBuild configurations have been correctly updated to use the new naming convention:

  • objectsPluginConfig
  • objectsPluginCdnConfig
  • minifiedObjectsPluginCdnConfig

160-160: LGTM: Task dependency rename in test:webserver task

The 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 array

The 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 names

Test scripts have been updated to use 'build:objects' instead of 'build:liveobjects'.


163-163: LGTM: Updated build script command

Build script has been renamed from 'build:liveobjects' to 'build:objects'.

scripts/moduleReport.ts (5)

47-50: LGTM: Updated type definition and plugin record

The 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 function

Function renamed from 'calculateLiveObjectsPluginSize' to 'calculateObjectsPluginSize' with appropriate implementation updates.


320-338: LGTM: Updated file path checking function

The '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 function

Function call updated from 'calculateLiveObjectsPluginSize' to 'calculateObjectsPluginSize'.


403-403: LGTM: Updated function call in error collection

Function call updated from 'checkLiveObjectsPluginFiles' to 'checkObjectsPluginFiles'.

src/plugins/objects/livecounter.ts (9)

3-3: LGTM: Updated import to use new interface name

Import statement updated to use 'Objects' instead of 'LiveObjects'.


20-22: LGTM: Updated parameter type and name in zeroValue method

Parameter renamed from 'liveObjects' to 'objects' with the appropriate type.


30-34: LGTM: Updated parameter type and name in fromStateObject method

Parameter renamed from 'liveObjects' to 'objects' with the appropriate type.


42-46: LGTM: Updated parameter type and name in fromStateOperation method

Parameter renamed from 'liveObjects' to 'objects' with the appropriate type.


51-71: LGTM: Updated parameter type and name in createCounterIncMessage method

Parameter 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 method

Parameter renamed from 'liveObjects' to 'objects' with the appropriate type.


125-128: LGTM: Updated internal method call in value method

Internal property reference updated from '_liveObjects' to '_objects'.


139-143: LGTM: Updated references in increment method

Property and method references updated from '_liveObjects' to '_objects'.


148-157: LGTM: Updated reference in decrement method

Property 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 with plugins: { 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 load https://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 to object_subscribe and object_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 with objects.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 the ObjectsTypes 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 (using objects.on('syncing', …) and objects.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 to OBJECT_PUBLISH and STATE_SUBSCRIBE to OBJECT_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 (replacing LiveObjectsTypes) 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 renamed Objects interface, completing the consistent renaming throughout the codebase.


1547-1587: Correctly maintained batch operation naming while updating Objects references.

The BatchCallback properly references the BatchContext 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 to ObjectsEvent while maintaining the same event values.


19-23: Enum renamed appropriately.

The enum has been properly renamed from LiveObjectsState to ObjectsState while maintaining the same state values.


25-29: Record updated correctly.

The StateToEventsMap has been appropriately updated to reference the new ObjectsEvent enum values.


31-31: Type renamed appropriately.

The callback type has been properly renamed from LiveObjectsEventCallback to ObjectsEventCallback.


33-35: Interface renamed appropriately.

The interface has been properly renamed from OnLiveObjectsEventResponse to OnObjectsEventResponse while maintaining the same interface structure.


39-50: Class and private fields renamed correctly.

The class name has been changed from LiveObjects to Objects 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 the ObjectsEvent.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 and off methods have been updated to use the new ObjectsEvent type and ObjectsEventCallback type.


194-196: Method signature updated correctly.

The return type of getPool() has been updated to return ObjectsPool instead of LiveObjectsPool.


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 handle ObjectsState and corresponding events.

src/common/lib/types/protocolmessage.ts (12)

15-15: Import statement updated correctly.

The import has been properly updated from LiveObjectsPlugin to ObjectsPlugin to reflect the new naming convention.


58-60: Channel mode flags renamed appropriately.

The flags have been renamed from STATE_SUBSCRIBE and STATE_PUBLISH to OBJECT_SUBSCRIBE and OBJECT_PUBLISH, maintaining the same bit positions.


68-69: MODE_ALL flag composition updated correctly.

The MODE_ALL flag now correctly references the renamed OBJECT_SUBSCRIBE and OBJECT_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 to objectsPlugin to reflect the new naming convention.


106-107: fromDeserialized function parameter updated correctly.

The parameter has been renamed from liveObjectsPlugin to objectsPlugin 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 of LiveObjectsPlugin.


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 references ObjectsPlugin instead of LiveObjectsPlugin.


165-166: Stringify function parameter updated correctly.

The parameter has been renamed from liveObjectsPlugin to objectsPlugin to reflect the new naming convention.


180-182: State message serialization updated correctly.

The conditional code for state message stringification now uses objectsPlugin instead of liveObjectsPlugin.


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 of LiveObjects.


56-60: Constructor parameter renamed appropriately.

The constructor parameter has been renamed from liveObjects to objects to reflect the new naming convention.


68-70: Static method parameter renamed appropriately.

The zeroValue static method parameter has been renamed from liveObjects to objects.


78-82: Static method parameter renamed appropriately.

The fromStateObject static method parameter has been renamed from liveObjects to objects.


90-94: Static method parameter renamed appropriately.

The fromStateOperation static method parameter has been renamed from liveObjects to objects.


100-104: Static method parameter renamed appropriately.

The createMapSetMessage static method parameter has been renamed from liveObjects to objects.


105-107: Method call updated correctly.

The call to getClient() now uses the renamed parameter objects instead of liveObjects.


136-140: Static method parameter renamed appropriately.

The createMapRemoveMessage static method parameter has been renamed from liveObjects to objects.


140-140: Method call updated correctly.

The call to getClient() now uses the renamed parameter objects instead of liveObjects.


165-168: Static method parameter renamed appropriately.

The validateKeyValue static method parameter has been renamed from liveObjects to objects.


169-169: Method call updated correctly.

The call to getClient() now uses the renamed parameter objects instead of liveObjects.


189-190: Static method parameter renamed appropriately.

The createMapCreateMessage static method parameter has been renamed from liveObjects to objects.


196-196: Method call updated correctly.

The call to validateKeyValue now uses the renamed parameter objects instead of liveObjects.


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 the set method implementation.


354-357: Instance method implementation updated correctly.

References to _objects have replaced _liveObjects in the remove 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.

Base automatically changed from PUB-1235/enumerate-map-keys to integration/liveobjects March 5, 2025 09:38
Copy link
Contributor

@mschristensen mschristensen left a 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

@VeskeR
Copy link
Contributor Author

VeskeR commented Mar 11, 2025

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

VeskeR added 2 commits March 11, 2025 08:57
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
Copy link

@coderabbitai coderabbitai bot left a 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 Consistency

The 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.ts imports 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.ts imports 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.ts imports 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.ts imports 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.tsx imports 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.tsx imports 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 containing src/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 containing src/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 containing src/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)

📥 Commits

Reviewing files that changed from the base of the PR and between b5b04b9 and 706d4ba.

📒 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 Reference

The 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.ts imports 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 updates

The 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 to Objects.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 of ObjectsEvent and ObjectsEventCallback is consistent with the rename; no issues noted.

Also applies to: 2165-2165

src/plugins/liveobjects/liveobject.ts (4)

3-3: Import renamed correctly from LiveObjects to Objects

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 renamed

Both 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 field

The method call has been correctly updated to use this._objects instead of this._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 the makeProtocolMessageFromDeserialized 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 to ObjectsHelper, 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 to Objects 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 the LiveCounter 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 good

The import statement has been correctly updated to use Objects instead of LiveObjects 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 good

The 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 consistent

The 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 consistent

All 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 consistent

The 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 consistent

The 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 renamed

The import statement has been updated to use Objects instead of LiveObjects, which aligns with the renaming initiative.


104-104: Property rename is consistent

The private member variable has been renamed from _liveObjects to _objects, maintaining the same naming pattern.


144-145: Plugin initialization correctly updated

The initialization code now properly instantiates _objects instead of _liveObjects when the Objects plugin is available.


156-160: Getter method appropriately renamed

The public getter method has been renamed from liveObjects to objects, and the error handling for missing plugins has been updated accordingly.


554-556: Comment and implementation updated consistently

Both the comment and implementation code have been updated to reference "Objects state" instead of "LiveObjects state".


618-618: Conditional check properly renamed

The conditional check has been updated to use _objects instead of _liveObjects.


625-627: Plugin reference correctly renamed

The reference to the plugin has been updated from _liveObjectsPlugin to _objectsPlugin while preserving the error handling logic.


631-631: Method call updated properly

The method call has been updated to use _objects.handleStateMessages() instead of _liveObjects.handleStateMessages().


633-633: Method call correctly renamed

The method call has been updated to use _objects.handleStateSyncMessages() while maintaining the same parameter structure.


833-834: Channel state handler correctly updated

The 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 Objects

The import statement has been correctly updated to use the new Objects naming convention while maintaining the same file path.


13-13: Comment syntax updated

The comment syntax has been properly formatted with JSDoc style to document the private class property.


19-19: Parameter renamed from _liveObjects to _objects

The private parameter has been properly renamed to follow the new naming convention specified in the PR objectives.


22-23: Method calls updated to use _objects

The 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 _objects

The call to throwIfInvalidAccessApiConfiguration has been properly updated to use the renamed parameter.


40-40: Pool access updated to use _objects

The call to getPool().get() has been correctly updated to use the renamed _objects parameter.


47-47: BatchContextLiveMap constructor parameter updated

The BatchContextLiveMap constructor call has been properly updated to use the renamed _objects parameter.


49-49: BatchContextLiveCounter constructor parameter updated

The BatchContextLiveCounter constructor call has been properly updated to use the renamed _objects parameter.


100-100: Publish method call updated

The 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 Objects

The 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 methods

References to this._liveObjects have been properly updated to this._objects in the zeroValue method calls for both LiveMap and LiveCounter classes.

Also applies to: 66-66


76-76: LGTM - Updated reference in _getInitialPool method

The reference to this._liveObjects has been correctly updated to this._objects in the _getInitialPool method.


85-85: LGTM - Updated reference in comment

The 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 to SyncObjectsDataPool 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 of SyncLiveObjectsDataPool, 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 Objects

The 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 updated

The 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 correctly

The 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 of liveObjects. 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 ObjectsTypes

The comment has been correctly updated to reference ObjectsTypes instead of LiveObjectsTypes, maintaining consistency with the renamed feature.


36-36: Type reference properly updated

The 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 correctly

The 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 content

While 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 likely LiveObjects 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 patterns

While 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 good

The renaming of enums from LiveObjectsEvent to ObjectsEvent and LiveObjectsState to ObjectsState is consistent, and all related references in the StateToEventsMap have been updated properly.

Also applies to: 19-23, 25-29


31-35: Consistent rename of class and type definitions

The ObjectsEventCallback type, OnObjectsEventResponse interface, and Objects 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 names

The constructor has been updated to properly initialize state using ObjectsState and create instances of ObjectsPool and SyncObjectsDataPool with the new naming convention.


68-82: Documentation and state checks properly updated

The 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 updated

All 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 correctly

The on and off method signatures have been updated to use ObjectsEvent instead of LiveObjectsEvent, and the getPool method now correctly returns ObjectsPool instead of LiveObjectsPool.

Also applies to: 191-196


219-225: Sync and state handling methods properly updated

References 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 correctly

All 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 updated

All 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 renamed

Methods 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 for object_subscribe and object_publish instead of what was likely liveobject_subscribe and liveobject_publish. State change calls now use ObjectsState 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 ts

Length 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 and liveobject_publish returned no results, supporting that the renaming (to using object_subscribe, object_publish, and the ObjectsState enum) has been correctly implemented across the affected code segments (lines 320-344 and 348-357 in src/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 good

The 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 properly

The import statement and plugin registration have been correctly updated to use the new "Objects" naming.


605-623: CDN references and global object naming updated correctly

All 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_" prefix

The channel modes have been appropriately renamed from state_subscribe and state_publish to object_subscribe and object_publish, and the channel reference has been updated from channel.liveObjects to channel.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 correctly

The method for accessing the root object has been updated from liveObjects.getRoot() to objects.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 updated

The 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 properly

The synchronization event handlers and lifecycle event management APIs have been correctly updated to use objects instead of liveObjects.

🧰 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 appropriately

The TypeScript interface has been renamed from LiveObjectsTypes to ObjectsTypes 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 correctly

The import statement has been properly updated to import ObjectsPlugin instead of LiveObjectsPlugin.


58-69: Flag constants renamed correctly

The channel mode flags STATE_SUBSCRIBE and STATE_PUBLISH have been properly renamed to OBJECT_SUBSCRIBE and OBJECT_PUBLISH, and the MODE_ALL flag has been updated to include these new flags.


86-88: Channel modes array updated

The channel modes array has been updated to include the new mode names OBJECT_SUBSCRIBE and OBJECT_PUBLISH.


92-101: Deserialize function signature updated

The function signature and implementation of deserialize have been updated to use objectsPlugin instead of liveObjectsPlugin.


103-137: FromDeserialized function updated correctly

The fromDeserialized function has been properly updated to use objectsPlugin and ObjectsPlugin.StateMessage types and methods.


145-156: Test helper function updated properly

The comments and implementation of makeFromDeserializedWithDependencies have been updated to reflect the renamed plugin.


162-182: Stringify function updated to use objectsPlugin

The stringify function has been properly updated to use objectsPlugin when handling state messages.


219-222: ProtocolMessage class property documentation updated

The 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

@mschristensen
Copy link
Contributor

@VeskeR https://github.com/ably/realtime/pull/7190 is now merged, so should be in sandbox soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants