feat(WASM): Integrate Yrs CRDT library for collaborative editing foundation #44
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.
Adds Yrs v0.21 (Rust CRDT implementation) to the WASM module, establishing infrastructure for future collaborative editing features.
Changes
Rust/WASM Module
yrs = "0.21"dependency withwasm-opt = falseto avoid binaryen download issuesverify_yrs()function that instantiates a Yrs document to validate the integration:TypeScript Integration
verify_yrsinmain.tsand called on plugin load (logs to console)test/unit/wasm-yrs-integration.test.tswith 4 integration testsImpact
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
rustwasm.github.io/usr/bin/curl curl REDACTED -sSf -L/tmp/rustc91vGwg/raw-dylibs lib/�� lib/rustlib/x86_/home/REDACTED/work/ObsidianSyncWASM/ObsidianSyncWASM/wasm/target/debug/build/thissh lib/rustlib/x86_-Wl,--as-needed bin/rustc lib/rustlib/x86_/home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld d_script_build.7-plugin sidian_sync_wasm.so bin/rustc lib/�� lib/rustlib/x86_--build-id 6_64-REDACTED-linux-gnu/lib lib/rustlib/x86_64-REDACTED-linux-gnu/bin/rust-lld b2a256.rlib ipt_build.bb9c09-c ipt_build.bb9c09node install.js lib/rustlib/x86_64-REDACTED-linux-gnu/bin/rust-lld(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Overview
Add the Yrs CRDT library to the WASM module and verify it compiles correctly. This establishes the foundation for collaborative editing features.
Changes Required
1. Update
wasm/Cargo.tomlAdd Yrs dependency:
2. Update
wasm/src/lib.rsAdd Yrs import:
Add new function to verify Yrs works:
Add Rust unit tests:
Add WASM-specific test:
3. Create
test/unit/wasm-yrs-integration.test.tsAdd TypeScript integration tests:
4. Update
main.tsAdd
verify_yrsto imports:Add Yrs verification after WASM initialization:
Add new command to test Yrs:
Acceptance Criteria
yrs = "0.21"added towasm/Cargo.tomldependenciesuse yrs::Doc;added towasm/src/lib.rsverify_yrs()function created and exported via#[wasm_bindgen]cargo test)main.tsupdated to import and useverify_yrs()Testing Instructions
Local Testing
Manual Testing in Obsidian
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.