Skip to content

Conversation

@Polleps
Copy link
Member

@Polleps Polleps commented Nov 18, 2025

Related Issues

relates to #998
closes #720, closes #1111, closes #741

Checklist

  • Add changelog entry linking to issue, describe API changes
  • Add or update tests if needed
  • Update docs if needed

@Polleps Polleps requested a review from joepio November 18, 2025 15:21
@Polleps
Copy link
Member Author

Polleps commented Nov 18, 2025

@cursor review

@cursor
Copy link

cursor bot commented Nov 18, 2025

PR Summary

Adds YDoc/Yjs across the stack (datatype, commits/yUpdate, WS sync, search indexing, CLI input) and updates React hooks while bumping React to 19.2.

  • Core/Lib:
    • Add ydoc datatype (Value::YDoc), parsing/serialization (base64), and URLs (urls.YDOC, urls.Y_UPDATE, urls.DOCUMENT_CONTENT).
    • Extend Commit with yUpdate field; apply by merging Yjs updates; builder supports add_y_update.
    • Update defaults to include yUpdate property and recommend push/yUpdate in Commit.
  • Server:
    • Introduce YSyncBroadcaster actor and WS messages (Y_SYNC_SUBSCRIBE, Y_SYNC_UNSUBSCRIBE, Y_SYNC_UPDATE) for live Yjs collaboration.
    • Wire broadcaster into AppState and WS handler; gate updates by write permissions.
    • Search: index plain text from Yjs documentContent by decoding Y updates.
    • Add yrs dependency.
  • CLI:
    • Support YDoc input (base64 validation); add base64 dependency.
  • React:
    • Bump to React ^19.2.0, update types, TS ^5.9.3; add yjs dev dep; enhance lint scripts.
    • Hooks: new useYDoc; useResource gains track prop and improved loading/local change handling; useResources, useCollection, useServerSearch performance/behavior updates; minor helpers added.
  • Svelte:
    • Subscribe to LoadingChange in getResource; lint/script tweaks.
  • Docs:
    • Document Yjs/YDoc, yUpdate in commits/JSON-AD/datatypes; expand JS lib docs for agents and Yjs usage.

Written by Cursor Bugbot for commit 993bed2. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

serverUrl,
});

await enableYjs();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Top-Level Await Disrupts System Initialization

Top-level await enableYjs() call makes the module async, causing potential issues with React and build tool initialization. This should be called within a React effect or effect hook instead, or handled during store initialization within the App component.

Fix in Cursor Fix in Web

@Polleps Polleps merged commit ae3abb8 into develop Nov 20, 2025
1 of 3 checks passed
@Polleps Polleps deleted the yjs-type-#998 branch November 20, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document upgrade path Fancy markdown / document editor - Consider using yjs / y-crdt for document-related commits

2 participants