@marimo-team/islands 0.25.3-dev138 → 0.25.3-dev139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ErrorBoundary-DN6z0yV4.js → ErrorBoundary-BX9mTNLJ.js} +1 -1
- package/dist/assets/__vite-browser-external-DrmlAsRP.js +1 -0
- package/dist/assets/worker-O2XUgidQ.js +113 -0
- package/dist/{code-visibility-BnpyGDBY.js → code-visibility-gptWgGHp.js} +1 -1
- package/dist/{common-DFewtofQ.js → common-mU-2k6Zp.js} +1 -1
- package/dist/{data-grid-overlay-editor-B0Iqui8S.js → data-grid-overlay-editor-Bdyx_BTg.js} +1 -1
- package/dist/{feedback-button-BTDJO5Gu.js → feedback-button-BoXM4uir.js} +2 -2
- package/dist/{glide-data-editor-CXzU0Muz.js → glide-data-editor-DaXYMyzk.js} +3 -3
- package/dist/{globals-D3aosgON.js → globals-Bj4btPVp.js} +1 -1
- package/dist/main.js +29 -28
- package/dist/{number-overlay-editor-DrEB_dOh.js → number-overlay-editor-DHfzwLIx.js} +1 -1
- package/dist/{reveal-component-CWAFHJZM.js → reveal-component-CurCj3ks.js} +2 -2
- package/package.json +1 -1
- package/src/core/islands/__tests__/bootstrap.test.ts +17 -17
- package/src/core/islands/__tests__/bridge.test.ts +31 -26
- package/src/core/islands/bootstrap.ts +22 -51
- package/src/core/islands/bridge.ts +31 -20
- package/src/core/islands/worker/__tests__/controller.test.ts +0 -1
- package/src/core/islands/worker/controller.ts +0 -4
- package/src/core/islands/worker/worker.tsx +32 -32
- package/src/core/wasm/rpc.ts +0 -1
- package/src/core/wasm/worker/bootstrap.ts +1 -16
- package/src/core/wasm/worker/types.ts +1 -7
- package/dist/assets/__vite-browser-external-SaDYcg7x.js +0 -1
- package/dist/assets/worker-CfME3uyi.js +0 -115
- package/src/core/wasm/worker/message-buffer.ts +0 -33
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A buffer for messages that are received before the worker is ready to process them.
|
|
5
|
-
* Once the worker is ready, the buffer is flushed.
|
|
6
|
-
*/
|
|
7
|
-
export class MessageBuffer<T> {
|
|
8
|
-
private buffer: T[];
|
|
9
|
-
private started = false;
|
|
10
|
-
private onMessage: (data: T) => void;
|
|
11
|
-
public constructor(onMessage: (data: T) => void) {
|
|
12
|
-
this.onMessage = onMessage;
|
|
13
|
-
this.buffer = [];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public push = (data: T) => {
|
|
17
|
-
if (this.started) {
|
|
18
|
-
this.onMessage(data);
|
|
19
|
-
} else {
|
|
20
|
-
this.buffer.push(data);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Start processing messages
|
|
26
|
-
*/
|
|
27
|
-
public start = () => {
|
|
28
|
-
this.started = true;
|
|
29
|
-
// Flush the buffer
|
|
30
|
-
this.buffer.forEach((data) => this.onMessage(data));
|
|
31
|
-
this.buffer = [];
|
|
32
|
-
};
|
|
33
|
-
}
|