-
Notifications
You must be signed in to change notification settings - Fork 43
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-773] LiveObjects product docs #2463
base: integration/liveobjects
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
3bfe8d2
to
145457e
Compare
1f7289e
to
2f870cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, thanks for this! A few comments
7c9bad3
to
25b2298
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, thanks Andrii. Final review from me and then this looks good - apologies for the high volume of nit picky comments, but I've attempted to suggest changes to ensure we have a consistent use of terminology:
- "LiveObjects" is used to refer to the product name, rather than object instance (and is never "Live Objects")
objects
is used to refer to object instances- avoid use of
state
and preferchannel objects
Hopefully in suggestion format these changes are relatively easy to apply. Thanks again for this :)
content/liveobjects/batch.textile
Outdated
|
||
To batch operations together, use the @channel.objects.batch()@ method. This method accepts a callback function, which is provided with a batch context object. The batch context object provides a synchronous API to work with LiveObjects on a channel that stores operations inside the batch instead of applying them immediately. | ||
|
||
Using the batch context ensures that operations are grouped and sent after the batch callback function has run, which means that all clients receive them as a single message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the emphasis here should be that they are applied atomically (both by the server and any clients), rather than just being received simultaneously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not seen anything explaining how this works offline. I think somewhere we should explain the model in that LiveObjects is an online-oriented feature; object creation and mutation operations initiated by a client are processed by the backend at the time. In this iteration at least, there's no offline mode, or synchronisation of changes made locally by a client while disconnected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great, Andrii.
I've made a few suggestions for fixes and enhancements. I've commented in a few places, but you don't need to include blang[]
as that just hides/shows content only relevant to 1 language (see here for info).
I also wonder if we can include something a diagram, or something visual to help explain LiveObjects on the 'about' page.
* "Composability":#composability | ||
* "Batching operations":#batch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we consider batching and composability as features on par with LiveMap and LiveCounter, or are they more key functionality that the features implement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
batching
Batching probably deserves to be a separate feature, similarly like we have for message batching on channels.
Also I guess batching can be considered as a feature of the state synchronization engine - to enable applying operations to state atomically.
On the other hand, if we really want to make it a "functionallity of the feature", then I'm not sure where to add it. Batching is available on the top level channel.objects
instance. Do we consider the Objects
instance "a feature" that has batching functionallity? And following this thought, should we then add an Objects
header to navigation to describe the API available on the Objects
instance at channel.objects
?
composability
This one is probably not a "feature", agree. Should probably just remove it from this list and unite the section with LiveMap
On a similar not, regarding Typing in the navigation:
It's not necessarily a "feature" by itself, but a pretty vital part of LiveObjects, we want developers to know that then can type their liveobjects and enjoy TypeScript with this product. Having it as a separate header in the navigation makes it more visible than hiding it under other features like Objects
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Batching provides a dedicated API in its own right, so I think it's sensible to include that with its own heading
content/liveobjects/batch.textile
Outdated
|
||
The Batching API in LiveObjects allows multiple updates to be grouped into a single channel message and applied atomically. It ensures that all operations in a batch either succeed together or are discarded entirely. Batching operations is essential when multiple related updates to the state must be applied as a single atomic unit, for example, when application logic depends on multiple LiveObjects being updated simultaneously. Without batching, if one operation succeeds while another fails, your application state could become inconsistent. | ||
|
||
Note that this differs from "Message batching":/docs/messages/batch, the native Pub/Sub messages feature. LiveObjects provides a separate API specifically for grouping LiveObjects operations into a single channel message, allowing the Ably system to guarantee the atomicity of the applied changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Paddy here: I made that page to cover the different types of batching in Pub/Sub because the term was becoming very overloaded.
70e3d74
to
0d1c04b
Compare
This is actually great! I was struggling a bit with the correct way to address different concepts (for example, 'state on a channel') after the renaming change we made, so this really helps set things in stone. I'll also add that terminology to the naming PR for future reference when I have a bit more time more time. I've applied your suggestions and did another pass to remove additional instances of "Live Object" and "state" terminology where necessary. |
This was intentional, see my comment #2463 (comment)
The simplest thing would be to do some kind of the object tree diagram, but that alone doesn’t effectively convey the "realtime state synchronization" aspect of LiveObjects. Rather than a purely technical diagram, a more marketing-oriented illustration - similar to the one we have for LiveSync - might be a better fit here. Since LiveObjects is quite similar in nature, we can use the similar concept: Objects on the channel on the left, the Ably realtime system in the center, and two clients with some JSON data on the right being synced. |
It would be good to get a diagram, but we need to get design to make one, so let's not block this on that basis. I've created a ticket: https://ably.atlassian.net/browse/PUB-1533 This looks good to me, @VeskeR can we redeploy the latest version to Heroku so I can take a final look at the result please? @m-hulbert is it possible to feature flag these docs so we can merge this but they don't appear on the website until we're ready? There are other docs changes that are coming re. the REST API, which @zknill is working on, so if we can't feature flag we might need to merge this into an integration branch that other docs PRs can target. |
56c767d
to
326fde2
Compare
… feature This commit does next changes: - removes `state` mentions in comments / internal API. Uses `objects` instead where possible - normalizes terminology used when referencing "LiveObjects" product and objects on a channel according to LiveObjects product docs PR [1] - `STATE` message action -> `OBJECT` - `STATE_SYNC` message action -> `OBJECT_SYNC` - `HAS_STATE` flag -> `HAS_OBJECT` - `StateMessage` type -> `ObjectMessage` - `StateOperation` type -> `ObjectOperation` - `StateObject` type -> `ObjectState` - `StateData` type -> `ObjectData` - `StateValue` type -> `ObjectValue` This brings ably-js LiveObjects implementation in line with the naming changes introduced in the spec PR [2]. [1] ably/docs#2463 (review) [2] ably/specification#279 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have the open question around channel modes, but happy to merge this to the integration branch and address separately for ease.
Regardless of its outcome, can we add the new modes to channels/options#modes
first though please?
I have another PR in flight that aligns existing pub/sub docs with any live objects related changes, which will include modes |
@m-hulbert PR with modes changes here: #2503 |
… feature This commit does next changes: - removes `state` mentions in comments / internal API. Uses `objects` instead where possible - normalizes terminology used when referencing "LiveObjects" product and objects on a channel according to LiveObjects product docs PR [1] - `STATE` message action -> `OBJECT` - `STATE_SYNC` message action -> `OBJECT_SYNC` - `HAS_STATE` flag -> `HAS_OBJECT` - `StateMessage` type -> `ObjectMessage` - `StateOperation` type -> `ObjectOperation` - `StateObject` type -> `ObjectState` - `StateData` type -> `ObjectData` - `StateValue` type -> `ObjectValue` This brings ably-js LiveObjects implementation in line with the naming changes introduced in the spec PR [2]. [1] ably/docs#2463 (review) [2] ably/specification#279 (comment)
326fde2
to
4d498e1
Compare
… feature This commit does next changes: - removes `state` mentions in comments / internal API. Uses `objects` instead where possible - normalizes terminology used when referencing "LiveObjects" product and objects on a channel according to LiveObjects product docs PR [1] - `STATE` message action -> `OBJECT` - `STATE_SYNC` message action -> `OBJECT_SYNC` - `HAS_STATE` flag -> `HAS_OBJECT` - `StateMessage` type -> `ObjectMessage` - `StateOperation` type -> `ObjectOperation` - `StateObject` type -> `ObjectState` - `StateData` type -> `ObjectData` - `StateValue` type -> `ObjectValue` This brings ably-js LiveObjects implementation in line with the naming changes introduced in the spec PR [2]. [1] ably/docs#2463 (review) [2] ably/specification#279 (comment)
… feature This commit does next changes: - removes `state` mentions in comments / internal API. Uses `objects` instead where possible - normalizes terminology used when referencing "LiveObjects" product and objects on a channel according to LiveObjects product docs PR [1] - `STATE` message action -> `OBJECT` - `STATE_SYNC` message action -> `OBJECT_SYNC` - `HAS_STATE` flag -> `HAS_OBJECT` - `StateMessage` type -> `ObjectMessage` - `StateOperation` type -> `ObjectOperation` - `StateObject` type -> `ObjectState` - `StateData` type -> `ObjectData` - `StateValue` type -> `ObjectValue` This brings ably-js LiveObjects implementation in line with the naming changes introduced in the spec PR [2]. [1] ably/docs#2463 (review) [2] ably/specification#279 (comment)
… feature This commit does next changes: - removes `state` mentions in comments / internal API. Uses `objects` instead where possible - normalizes terminology used when referencing "LiveObjects" product and objects on a channel according to LiveObjects product docs PR [1] - `STATE` message action -> `OBJECT` - `STATE_SYNC` message action -> `OBJECT_SYNC` - `HAS_STATE` flag -> `HAS_OBJECT` - `StateMessage` type -> `ObjectMessage` - `StateOperation` type -> `ObjectOperation` - `StateObject` type -> `ObjectState` - `StateData` type -> `ObjectData` - `StateValue` type -> `ObjectValue` This brings ably-js LiveObjects implementation in line with the naming changes introduced in the spec PR [2]. [1] ably/docs#2463 (review) [2] ably/specification#279 (comment)
4d498e1
to
451c972
Compare
451c972
to
b782e1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just one small change for sentence case.
@@ -0,0 +1,66 @@ | |||
--- | |||
title: Lifecycle Events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be sentence case please? In the table of contents too (and the same for 'Batch Operations'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b782e1f
to
6532e7f
Compare
Description
Adds LiveObjects product documentation to
content
section. Final docs structure can be found here: https://ably.atlassian.net/wiki/spaces/LOB/pages/3839623174/LORFC-001+LiveObjects+Product+Docs+structure.This PR adds documentation for next LiveObjects pages:
Resolves PUB-773
Site navigation for LiveObjects is added in #2464, but can be moved into this PR if requested.
Checklist