mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
Each limitations partial held its whole text on one line (map-and-set.mdx was a single 1,080-character line), so any two edits to the same partial conflicted. The partials now put one sentence per line, with a bullet's continuation lines indented two spaces. Markdown joins the lines, so the rendered pages are unchanged. scripts/limitations-partials.mjs reads a labeled bullet's indented continuation lines as part of the bullet when it splits and joins the page, and AGENTS.md states the convention.
10 lines
862 B
Plaintext
10 lines
862 B
Plaintext
Graphs published with [`@scriptc/threads`](/docs/threads) are immortal: scriptc never frees them, even after every thread has stopped using them.
|
|
Publish long-lived data, not per-request messages.
|
|
|
|
A receiving thread reads the sender's objects, so they keep their classes, methods, and identity across threads and across messages.
|
|
Node.js delivers clones without prototypes, a new clone for every message.
|
|
|
|
Writes into published objects throw Node's frozen-object `TypeError`s.
|
|
In Node.js, `o.x = f()` evaluates `f()` before the write fails, and scriptc does the same, except for writes to union-typed class fields and for `Map`, `Set`, and array mutator methods, where the write check runs before the arguments are evaluated.
|
|
Private fields (`#x`) of published objects cannot be written either, although Node.js allows writing private fields of frozen objects.
|