Skip to content

Commit f0b33ee

Browse files
docs(spec): describe the shared-chunk bundle layout in three source comments (#25975)
Fixes #25811 Clause-②: no Metadata-protocol: none ## What changed Three source comments in `@objectstack/spec` still described the per-entry, self-contained bundle layout that the one-module-graph build replaced. They now describe the shared-chunk layout stated in `packages/spec/README.md` (Export surfaces) and the `oneModuleGraph` docblock in `packages/spec/tsup.config.ts`: a module two entries reach ships once, in a shared chunk, and an entry links every chunk its own module graph touches. - `packages/spec/src/index.ts`: the standing-principle paragraph no longer says "self-contained bundle"; it keeps the cost rule and dates the +60.1 KB `/shared` measurement to the former per-entry bundles. - `packages/spec/src/conversions/registry.ts`: only the `@__PURE__` note (the sentence that cited `splitting: false`). The PURE-annotation reasoning is unchanged and still holds per chunk. - `packages/spec/src/api/package-api-assembled.zod.ts`: the module TSDoc. - `content/docs/references/api/package-api-assembled.mdx`: regenerated with the spec package's `gen:docs` script, never hand-edited; the diff is the same sentence, two lines. Landing point matches the claimed file surface exactly; the real producer of all four lines was in those files (measured on origin/main, `grep` for the three stale phrases found them only there). ## Not changed No code, key, export or behaviour. Hunks elsewhere in `registry.ts` belong to other in-flight cards and were not touched. ## Changeset rule A changeset is included (`patch`, `@objectstack/spec`). The os-dev fast lane lists comments as not publishing, but the measured criterion is what `files[]` ships: after a build, the new sentences are present in `packages/spec/dist/index.d.ts` and `dist/api-assembled/index.d.ts` (TSDoc rides in the declaration files), so the published content moved and `skip-changeset` does not apply. ## Verification - `pnpm --filter @objectstack/spec build` exit 0, then `gen:docs` exit 0: 229 files generated, exactly one tracked file changed. - Local gate list from `dispatch-gates.mjs --commands` (108 families): 105 run, all exit 0. Three are NOT MEASURED, reason: `check:dual-build-cjs-loads` and `check:lean-entry-closure` exit 3 (PREREQUISITE NOT MET, they read built dist of packages this card does not touch), `check-plugin-teardown-shape --self-test` needs an unshallowed clone. CI runs the full farm. ## Acceptance notes The branch is `claude/project-thread-mybepv`, a platform-assigned branch (this session can push only that one), not the usual issue-named branch. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 05f7758 commit f0b33ee

5 files changed

Lines changed: 26 additions & 11 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): three comments describe the shared-chunk bundle layout, not the per-entry one
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The module doc block in `@objectstack/spec`'s root entry, the `@__PURE__` note on the conversions table, and the Package API assembled-entry doc block (the generated reference page of the same name) still said each entry is a self-contained, single-file bundle. The build is one module graph: a module two entries reach ships once, in a shared chunk, and an entry links every chunk its graph touches. The sentences now say that. The doc text rides in the shipped declaration files, which is why this is a patch entry; no export, key, value or behaviour changes.
11+
12+
What to do: nothing.

‎content/docs/references/api/package-api-assembled.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ driver-config validators and the server-only pg URL grammar. Declared inside
2828
`@objectstack/spec/api` (#17517), that tree became part of every bundle of the
2929
entry — and a browser module that imported two string constants from
3030
`./sortability.zod` paid for all of it, roughly doubling its gzipped bundle,
31-
because the entry ships as one self-contained bundle and little of that tree
32-
can be dropped by a consumer's tree-shaking. The maintainer ruling on #18576
31+
because the entry links every chunk its module graph touches and little of
32+
that tree can be dropped by a consumer's tree-shaking. The maintainer ruling on #18576
3333
(letter B) removed the cost rather than watching it: the browser-facing
3434
`./api` no longer carries these declarations, and this entry does.
3535

‎packages/spec/src/api/package-api-assembled.zod.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import {
3737
* `@objectstack/spec/api` (#17517), that tree became part of every bundle of the
3838
* entry — and a browser module that imported two string constants from
3939
* `./sortability.zod` paid for all of it, roughly doubling its gzipped bundle,
40-
* because the entry ships as one self-contained bundle and little of that tree
41-
* can be dropped by a consumer's tree-shaking. The maintainer ruling on #18576
40+
* because the entry links every chunk its module graph touches and little of
41+
* that tree can be dropped by a consumer's tree-shaking. The maintainer ruling on #18576
4242
* (letter B) removed the cost rather than watching it: the browser-facing
4343
* `./api` no longer carries these declarations, and this entry does.
4444
*

‎packages/spec/src/conversions/registry.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18238,10 +18238,11 @@ const MAJOR_18_CONVERSIONS: readonly OrderedConversion[] = [
1823818238
*
1823918239
* ⚠️ EVERY CALL THIS TABLE AND {@link ALL_CONVERSIONS} MAKE AT MODULE LOAD
1824018240
* CARRIES AN `@__PURE__` ANNOTATION — a major's `inApplicationOrder(…)` and
18241-
* the flattening below, and the next major's when it opens. Each published
18242-
* entry is one flat file (`tsup.config.ts`, `splitting: false`), so a
18243-
* consumer's bundler keeps every top-level call it cannot prove pure, together
18244-
* with everything that call references. Unmarked, these two initializers kept
18241+
* the flattening below, and the next major's when it opens. The entries share
18242+
* one module graph (`tsup.config.ts`, `oneModuleGraph`), and every entry whose
18243+
* graph reaches this module links the chunk it ships in, so a consumer's
18244+
* bundler keeps every top-level call it cannot prove pure, together with
18245+
* everything that call references. Unmarked, these two initializers kept
1824518246
* the whole table in every bundle of every entry whose graph reaches this
1824618247
* module — every conversion, and the view, field, page-component, dashboard,
1824718248
* chart and report schemas the conversions read. `./shared` is one of those

‎packages/spec/src/index.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@
7070
* > machinery. The schema graph is the server/publish side's dependency, never
7171
* > the price of spelling a URL segment or reading a posture predicate.
7272
*
73-
* Every subpath entry is a self-contained bundle, so a vocabulary symbol that
74-
* shares an entry with schema modules costs its consumers the whole schema
75-
* closure (measured on #10096: one string fold through `/shared` cost
73+
* The entries share one module graph (a module two entries reach ships once,
74+
* in a shared chunk), but an entry links every chunk its own module graph
75+
* touches, so a vocabulary symbol that shares an entry with schema modules
76+
* still costs its consumers the whole schema closure (measured on #10096,
77+
* under the former per-entry bundles: one string fold through `/shared` cost
7678
* +60.1 KB gzipped). When adding an export a browser consumer will reach,
7779
* either put it on a schema-free entry (`/meta-spelling` is the reference:
7880
* heavy derivation happens at BUILD time via a generator + check gate, the

0 commit comments

Comments
 (0)