Add element live users and update APIs - #430
Open
spencerc99 wants to merge 3 commits into
Open
Conversation
commit: |
Owner
Author
Preview evidenceElement live/users documentation and both starters use one per-user rendering model. Open preview · Review all evidence · Commit Vanilla live users guideThe custom-elements guide now explains live, users, setLive, and one update renderer with a complete vanilla HTML example. Open captured page · 1280×720 React starter live hoverHovering the React reaction button publishes live state and renders one current user. Open captured page · 1280×720 Vanilla starter live hoverThe vanilla starter uses the same live/users API and renders one current user while hovered. Open captured page · 1280×720 Published by PR Evidence. Media is temporary and is removed after retention expires. |
Deploying playhtml with
|
| Latest commit: |
c6708d1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1e1d9b07.playhtml.pages.dev |
| Branch Preview URL: | https://cx-element-live-users-update.playhtml.pages.dev |
Deploying we-were-online-website with
|
| Latest commit: |
c6708d1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://51c6c99b.we-were-online-website.pages.dev |
| Branch Preview URL: | https://cx-element-live-users-update.we-were-online-website.pages.dev |
Owner
Author
Code review
|
Owner
Author
Code reviewNo issues found. Verified the changes addressing the previous review findings. |
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
live,users,setLive,getLive, andgetUsersfor element-scoped per-user dataupdateas the preferred imperative renderer and run it for shared data and live-user changesupdateElementspellings as deprecated compatibility aliases, with errors when both alias names are suppliedWhy
Element-scoped presence previously required separate awareness callbacks and raw value collections. The new API gives each renderer one model:
liveis my ephemeral value,usersjoins every current value with its user identity, andupdaterenders both shared data and user changes.This is the core element naming/render slice from #289. Page-level Users live channels, cursor renderer changes, data/useData, read tracking, drag/onClick cleanup, awareness fallback removal, and teardown renames remain out of scope.
Verification
bun run -C packages/playhtml testequivalent from the package directory: 538 tests passedbun run -C packages/react testequivalent from the package directory: 57 tests passed, including type and real-core integration testsbun run build-packagesbun run lintbun run -C apps/docs buildequivalent from the docs directorybunx vite buildintemplates/react-starter0 hereto1 here; fresh starter tabs had no console errorsPart of #289.