docs(liveobjects): updated path-based LiveObjects API proposal (v2)#1212
Draft
sacOO7 wants to merge 1 commit into
Draft
docs(liveobjects): updated path-based LiveObjects API proposal (v2)#1212sacOO7 wants to merge 1 commit into
sacOO7 wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
path-base-api-proposal-updated.mdat the repo root — a v2 design proposal for the path-based LiveObjects public API inably-java. It supersedes PR #1190 by folding in the review feedback (primarily from @sacOO7) and reconciling the design against the actual source tree.This is a docs-only change — no source files are modified.
Why a new proposal
PR #1190 sketched a path-based API but the review surfaced design
questions that materially change the shape:
PathObjectshould not be statically typed (types at a path are dynamic); strong typing belongs on instances.RootPathObject— it's the only position whose type is fixed.LiveMap/LiveCounterare spec-internal names; the path API should exposeLiveMapInstance/LiveCounterInstance.LivePrimitivetype is needed.compact()can't return an anonymous object in Java; needs a typed shape (Map<String, LiveValue>+ a separate JSON-safe variant).MessageOptionsdoesn't exist inably-js— drop it.LiveListPathObjectshouldn't exist (noLiveListin the spec).channel.object().get()reads better thanchannel.getObject().get().What's in the proposal
RealtimeObjectsAPI) and goals/non-goals.PathObject,RootPathObject,LiveValue/LiveInstance/LiveMapInstance/LiveCounterInstance/LivePrimitive,ChannelObject,PathChangeEvent/PathChangeListener,PathSubscriptionOptions, and a new publicObjectMessage` interface — all Java 8 compatible.ably-js, the Kotlin draft and Python draft (fromLiveObjects-path-base-api.pdf).lib/Java surface,liveobjects/Kotlin internals), phased delivery, and migration table.Key design decisions (highlights)
PathObjectis a single, untyped handle*InstancetypesRootPathObject(the only fixed-type path)channel.object().get()(Java) /channel.realtimeObject.getRoot()(Kotlin)LivePrimitiveLiveMapInstance/LiveCounterInstanceextend internal typesLiveListPathObjectcompact()→Map<String, LiveValue>;compactJson()→JsonElementMessageOptions@Blocking(matchesLiveMap/LiveCountersource)Out of scope
batch(...)operationsAblyRestobjects ops)LiveListThese are called out explicitly in §4 (Non-Goals) and tracked as future
work; none affect the decisions above.