-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: Add JS RPC Support for getYDoc and updateYDoc #50
Conversation
🦋 Changeset detectedLatest commit: 4b6afef The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying yjs-worker with Cloudflare Pages
|
25346b8
to
44f2be2
Compare
commit:
|
📊 Package size report 21%↑
Unchanged files
🤖 This report was automatically generated by pkg-size-action |
Hi, @tobimori I have pre-released an enhanced version of y-durableobjects with JSRPC added. It is available from If it seems to be working well, I will release it. Usage ExamplesUsage including fetch (https://github.com/napolab/y-durableobjects/blob/6c2063d8b5745cab03c47d6f01fe6a70a7146868/src/e2e/e2e.test.ts)
|
Partial support: #20 |
closed: #49
closed: #46
This PR introduces several significant updates to the
y-durableobjects
library, with a major focus on adding new JS RPC support forgetYDoc
andupdateYDoc
APIs. These enhancements significantly improve the library's functionality and ease of integration with Hono. Key changes include:Major Features:
getYDoc
andupdateYDoc
:getYDoc
) and update (updateYDoc
) YDocs within Durable Objects.Hono Integration:
y-durableobjects
with Hono, using both shorthand and detailed methods.Extending with JS RPC:
y-durableobjects
for advanced operations, including accessing and manipulating protected fields:app
: The Hono app instance used to handle requests.doc
: An instance ofWSSharedDoc
managing the YDoc state.storage
: AYTransactionStorageImpl
instance for storing and retrieving YDoc updates.sessions
: A map to manage active WebSocket sessions.awarenessClients
: A set to track client awareness states.YDurableObjects
.Client-side Typed Fetch with Hono RPC:
hc
fromhono/client
to facilitate Hono RPC on the client side.Documentation Updates:
These enhancements aim to provide developers with more robust tools and clearer guidance for integrating Yjs and Durable Objects within the Cloudflare Workers environment, leveraging the power of Hono for efficient and scalable real-time collaboration solutions.