Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Expose inner LoroDoc reference from loro-wasm::LoroDoc for extension crates #942

Copy link
Copy link

Description

@agronbajraktari
Issue body actions

I'm building a #[wasm_bindgen] extension crate that needs to operate on the same LoroDoc as the JS frontend. Currently, loro-wasm::LoroDoc.doc is private, so I can't accept a &LoroDoc in my Rust crate and access the underlying LoroDocInner for operations like get_tree(), subscribe_root(), commit(), etc.

Request: Could you add a public accessor on the wasm LoroDoc struct? Something like:

impl LoroDoc {
pub fn doc(&self) -> &LoroDocInner {
&self.doc
}
}

This would allow extension crates to depend on loro-wasm via git and build into a single WASM module that shares the same LoroDoc instance with JS — no dual-doc bridging needed.

Without this, the only options are forking loro-wasm or maintaining two separate LoroDoc instances (one in JS, one in WASM) with a sync bridge, which adds memory overhead and complexity.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.