You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Reason:** This occurs because Vite loads ES modules asynchronously, and the WASM module initialization within `loro-crdt` also happens asynchronously. When you import at the top level but execute code inside `DOMContentLoaded`, the WASM module may not be fully initialized when the event fires, causing the application to fail silently.
3263
+
3264
+
**Solutions:**
3265
+
3266
+
1. **Remove the event listener** (recommended for most cases):
3267
+
```ts
3268
+
import { LoroDoc } from 'loro-crdt';
3269
+
3270
+
const doc = new LoroDoc();
3271
+
// Your code here...
3272
+
```
3273
+
3274
+
2. **Use dynamic import inside the event listener**:
The dynamic import ensures the module and its WASM dependencies are fully loaded before use.
3284
+
3285
+
</details>
3286
+
3245
3287
If you're using `Next.js`, you should add the following to your next.config.js:
3246
3288
3247
3289
```js no-run
@@ -5022,6 +5064,14 @@ For text, you can choose to represent it directly as a Value on a Map (where the
5022
5064
For Lists, concurrently removing the same element and inserting a single element creates a new element, differentiating from the semantics of Set on a Map (we may consider providing a list set method in the future). For representing coordinates, it's better to use a Map rather than a List. If you represent coordinates as [x, y], and the A client updates the y coordinate by deleting the y element and reinserting a new y_a, and the B client also deletes y and inserts y_b, then after merging, the array will become [x, y_a, y_b], which does not conform to the user's schema. Using a Map can prevent this problem.
5023
5065
5024
5066
5067
+
# FILE: pages/docs/llm.md
5068
+
5069
+
# LLM Resouces
5070
+
5071
+
- [llms.txt](/llm.txt)
5072
+
- [llms-full.txt](/llm-full.txt)
5073
+
5074
+
5025
5075
# FILE: pages/docs/performance/docsize.md
5026
5076
5027
5077
---
@@ -7810,6 +7860,26 @@ export function setDebug(): void;
7810
7860
* - changeNum
7811
7861
*/
7812
7862
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
7863
+
/**
7864
+
* Redacts sensitive content in JSON updates within the specified version range.
7865
+
*
7866
+
* This function allows you to share document history while removing potentially sensitive content.
7867
+
* It preserves the document structure and collaboration capabilities while replacing content with
7868
+
* placeholders according to these redaction rules:
7869
+
*
7870
+
* - Preserves delete and move operations
7871
+
* - Replaces text insertion content with the Unicode replacement character
7872
+
* - Substitutes list and map insert values with null
7873
+
* - Maintains structure of child containers
7874
+
* - Replaces text mark values with null
7875
+
* - Preserves map keys and text annotation keys
7876
+
*
7877
+
* @param {Object|string} jsonUpdates - The JSON updates to redact (object or JSON string)
7878
+
* @param {Object} versionRange - Version range defining what content to redact,
* By combining `doc.subscribePreCommit` with `doc.exportJsonInIdSpan`, you can implement advanced features like representing Loro's editing history as a Merkle DAG:
0 commit comments