@absolutejs/sync 1.7.0 → 1.7.1
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/engine/index.js +2 -2
- package/dist/engine/index.js.map +3 -3
- package/dist/engine/sandbox.d.ts +19 -23
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/package.json +3 -3
package/dist/engine/sandbox.d.ts
CHANGED
|
@@ -21,18 +21,16 @@
|
|
|
21
21
|
* For long-lived mutations choose `memoryLimit` ≥ 128 (the default 32
|
|
22
22
|
* trips after a few dozen calls without pressure for GC).
|
|
23
23
|
*
|
|
24
|
-
* **Backend default: `'
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* via `sandbox: { backend: 'ffi' }` — they get the ~300 KB cold heap and
|
|
35
|
-
* interrupt-driven timeouts. Document this clearly when you do.
|
|
24
|
+
* **Backend default: `'auto'`** — isolated-jsc 0.4 added an async host-fn
|
|
25
|
+
* pump on the FFI backend (alternates Bun event-loop yields with JSC
|
|
26
|
+
* microtask drains, bounded by `Script.run`'s `timeout`), so the
|
|
27
|
+
* `actions.insert/update/delete/change` async References settle on FFI
|
|
28
|
+
* just like they do on Worker. `'auto'` picks FFI when libJSC is reachable
|
|
29
|
+
* (~300 KB cold heap, interrupt-driven CPU timeouts) and falls back to
|
|
30
|
+
* Worker (~46 MB cold heap, postMessage round-trips) otherwise. Pin to
|
|
31
|
+
* `'worker'` if you specifically need Web APIs (`URL`, `TextEncoder`,
|
|
32
|
+
* `WebSocket`) inside your handler — those live in the Bun-Worker
|
|
33
|
+
* environment, not the bare JSC C API.
|
|
36
34
|
*
|
|
37
35
|
* The runner is built lazily per-mutation: nothing is spawned until the
|
|
38
36
|
* mutation actually runs for the first time. No engine teardown hook is
|
|
@@ -46,19 +44,17 @@ export type SandboxConfig = {
|
|
|
46
44
|
/** Wall-clock cap per call (ms). Default 5000. */
|
|
47
45
|
timeout?: number;
|
|
48
46
|
/**
|
|
49
|
-
* isolated-jsc backend. Defaults to `'
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* supports both sync and async host fns.
|
|
47
|
+
* isolated-jsc backend. Defaults to `'auto'` (FFI when libJSC is
|
|
48
|
+
* reachable, Worker otherwise) since isolated-jsc 0.4 added async
|
|
49
|
+
* host-fn support on FFI — `actions.insert/update/delete/change`
|
|
50
|
+
* now settle on both backends.
|
|
54
51
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* (~300 KB vs ~46 MB) + interrupt-driven timeout benefits.
|
|
52
|
+
* Pin to `'worker'` if your handler needs Web APIs (`URL`,
|
|
53
|
+
* `TextEncoder`, `WebSocket`) — those live in the Bun-Worker
|
|
54
|
+
* environment, not the bare JSC C API.
|
|
59
55
|
*
|
|
60
|
-
* `'
|
|
61
|
-
*
|
|
56
|
+
* Pin to `'ffi'` for hot-path read-only handlers (~300 KB cold heap
|
|
57
|
+
* vs ~46 MB on Worker, interrupt-driven CPU timeouts).
|
|
62
58
|
*/
|
|
63
59
|
backend?: 'auto' | 'ffi' | 'worker';
|
|
64
60
|
};
|
package/dist/index.js
CHANGED
|
@@ -745,7 +745,7 @@ var wrap = (source) => `
|
|
|
745
745
|
var compile = async (source, config) => {
|
|
746
746
|
const { createIsolate } = await loadIsolatedJsc();
|
|
747
747
|
const isolate = await createIsolate({
|
|
748
|
-
backend: config.backend ?? "
|
|
748
|
+
backend: config.backend ?? "auto",
|
|
749
749
|
memoryLimit: config.memoryLimit ?? 32
|
|
750
750
|
});
|
|
751
751
|
const script = await isolate.compileScript(wrap(source));
|
|
@@ -2301,5 +2301,5 @@ export {
|
|
|
2301
2301
|
createPresenceHub
|
|
2302
2302
|
};
|
|
2303
2303
|
|
|
2304
|
-
//# debugId=
|
|
2304
|
+
//# debugId=A95C21B5786D64AE64756E2164756E21
|
|
2305
2305
|
//# sourceMappingURL=index.js.map
|