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 Yjs/YDoc support with commit-based updates and live WebSocket syncing, updates React/Svelte/CLI, and documents/indexes new document content.

  • Core/Lib:
    • Add Datatype.YDoc with parse/serialize (base64) and value handling; expose URLs (ydoc, yUpdate, documentContent).
    • Extend Commit with yUpdate field and apply/serialize logic (merge Y updates); update defaults and URLs.
    • Add yrs dependency.
  • Server:
    • Introduce Y-sync broadcaster actor and messages (SubscribeYSync, UnsubscribeYSync, YSyncUpdate).
    • Extend WS handler with Y_SYNC_SUBSCRIBE/UNSUBSCRIBE and Y_SYNC_UPDATE; plumb through AppState.
  • Search:
    • Index DocumentV2 content by decoding YDoc state and extracting plain text for description.
  • React lib:
    • Improve useResource/useResources performance and tracking; add UseResourceOptions.track.
    • Add useYDoc(resource, propertyURL) hook; refactor saves to __internalObject.
    • Revamp useServerSearch to call store.search directly with debounce; add useOnValueChange helper.
    • Bump React to ^19.2.0, types/TS versions; add yjs devDep; enhance lint scripts.
  • Svelte:
    • getResource store now updates on LoadingChange; add lint script tweaks.
  • CLI:
    • Add base64 dep; prompt/validate YDoc (base64) for new resources.
  • Docs:
    • Document YDoc datatype, commit yUpdate, agent secrets/advanced usage, and Yjs docs usage in JS lib.

Written by Cursor Bugbot for commit 6cd98b3. 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

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