Releases: napolab/y-durableobjects
Releases · napolab/y-durableobjects
v1.0.5
Patch Changes
-
3675eb1: Fix Cloudflare Env type collision and improve TypeScript support
This patch resolves type collision issues and improves TypeScript support:
- Fixed CI failures: Removed unavailable @cloudflare/workers-types references from tsconfig.json that were causing TypeScript compilation errors
- Adopted wrangler types: Added worker-configuration.d.ts generated by
wrangler types(introduced in Wrangler v3) for accurate type definitions - Resolved type collisions: Eliminated conflicts where empty Cloudflare.Env from node_modules overwrote project-specific environment types
- Enhanced documentation: Added comprehensive troubleshooting guide for type collision issues
Users benefit automatically from improved type support without needing to modify their code. The
wrangler typescommand is now the recommended approach for generating Cloudflare Workers TypeScript types.
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
Major Changes
-
0446fbd: Add JS RPC Support for getYDoc and updateYDoc
-
Major Features:
- JS RPC APIs
getYDocandupdateYDoc:- Implemented new JS RPC APIs to fetch (
getYDoc) and update (updateYDoc) YDocs within Durable Objects. - Allows manipulating YDocs from sources other than WebSocket, enhancing flexibility and control.
- Implemented new JS RPC APIs to fetch (
- JS RPC APIs
-
Hono Integration:
- Added examples for integrating
y-durableobjectswith Hono, using both shorthand and detailed methods. - Demonstrated how to handle WebSocket connections via fetch due to the current limitations of JS RPC (see Cloudflare issue).
- Added examples for integrating
-
Extending with JS RPC:
- Explained how to extend
y-durableobjectsfor advanced operations, including accessing and manipulating protected fields:app: The Hono app instance used to handle requests.doc: An instance ofWSSharedDocmanaging the YDoc state.storage: AYTransactionStorageImplinstance for storing and retrieving YDoc updates.sessions: A map to manage active WebSocket sessions.awarenessClients: A set to track client awareness states.
- Provided a minimal example of creating a custom Durable Object by extending
YDurableObjects.
- Explained how to extend
-
Client-side Typed Fetch with Hono RPC:
- Included a guide for creating a typed client using
hcfromhono/clientto facilitate Hono RPC on the client side.
- Included a guide for creating a typed client using
-
Documentation Updates:
- Updated the README with detailed examples and explanations for the new features and integrations.
- Ensured clarity and ease of understanding for developers looking to utilize the new functionalities.
-