From 0eaa1c0e403649b4acba4fdbf726dcf66c3b63bd Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Aug 2026 01:37:21 +0000 Subject: [PATCH] docs(app-shell): correct the eager-graph attribution above the /meta spelling fold The comment block above this file's `@objectstack/spec/shared` import stated that the import puts that subpath on the console's eager graph, at +213.4 KB minified / +60.1 KB gzipped, and attached a prohibition to that claim. Ablation on origin/main (0fce2ef81) shows the import is worth +285 bytes gzipped: `/shared` is held eager by a runtime `import { pluralToSingular }` inside `@objectstack/core`, which ships in `@objectstack/client`, a direct `apps/console` dependency. Every other importer of `/shared` in this repo's source is type-only and erased at build. The block now records the mechanism rather than a magnitude that rots, keeps the parts that were true (self-contained subpath bundles, no `sideEffects`, the vendor chunk group's static edge, the do-not-fork prohibition), and points at objectstack#11503 where the only lever lives. Comment-only; the import and the call site are untouched. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01EuPCi56cnGyykygi3z9w4m --- ...changes-panel-eager-attribution-comment.md | 4 +++ .../src/preview/DraftChangesPanel.tsx | 36 ++++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 .changeset/draft-changes-panel-eager-attribution-comment.md diff --git a/.changeset/draft-changes-panel-eager-attribution-comment.md b/.changeset/draft-changes-panel-eager-attribution-comment.md new file mode 100644 index 0000000000..e3d23fb00c --- /dev/null +++ b/.changeset/draft-changes-panel-eager-attribution-comment.md @@ -0,0 +1,4 @@ +--- +--- + +Comment-only correction in `packages/app-shell/src/preview/DraftChangesPanel.tsx`. The block above the `/meta` spelling fold stated that this file's `@objectstack/spec/shared` import puts that subpath on the console's eager graph, and attached a byte figure and a prohibition to that claim. Ablation on `origin/main` shows the import is worth ~+285 bytes gzipped: the subpath is held eager by a runtime import inside `@objectstack/core`, upstream of this repo. The comment now records the mechanism and points at the upstream card. No source behaviour is touched and no published behaviour changes. diff --git a/packages/app-shell/src/preview/DraftChangesPanel.tsx b/packages/app-shell/src/preview/DraftChangesPanel.tsx index 2a49875973..79a14c83e1 100644 --- a/packages/app-shell/src/preview/DraftChangesPanel.tsx +++ b/packages/app-shell/src/preview/DraftChangesPanel.tsx @@ -35,16 +35,34 @@ import { } from '@object-ui/components'; import { useObjectTranslation } from '@object-ui/i18n'; // The `/meta` URL-spelling fold (objectstack#7894, #8424), applied once in -// `listPendingDrafts` below. Measured cost of this import on the console's -// EAGER graph — the panel is reached statically from ConsoleLayout through -// DraftPreviewBar — is +213.4 KB minified / +60.1 KB gzipped, on a graph that -// already holds the spec entries app-shell imports statically (`/ui`, -// `/kernel`): each published spec subpath is a self-contained bundle and -// nothing tree-shakes it (`@objectstack/spec` declares no `sideEffects`). -// Lazy-loading it here would NOT move those bytes — the console's +// `listPendingDrafts` below. +// +// CORRECTED, and the correction matters more than the number. An earlier +// version of this comment stated that this import puts `@objectstack/spec/shared` +// on the console's EAGER graph, at +213.4 KB minified / +60.1 KB gzipped. The +// attribution is false: that cost was never this import's. Measured by ablation +// on `origin/main` at 0fce2ef81 (2026-08-24) — delete this import, rebuild +// `apps/console`, read the `eagerGzipBytes` in `dist/eager-closure.json` — the +// eager closure moves +285 bytes gzipped, i.e. minifier noise. Read that figure +// as what it is, one tree on one day; the full measurement, with the +// counter-probes that discriminate it, is recorded on objectui#5359. +// +// The MECHANISM is the part that survives the next release. `/shared` is held on +// the eager graph by an edge upstream of this repo: `@objectstack/core`, shipped +// inside `@objectstack/client` and a direct dependency of `apps/console`, has a +// runtime `import { pluralToSingular } from '@objectstack/spec/shared'`. Every +// OTHER importer of `/shared` in objectui's own source is type-only and erased +// at build, so ablating this one still leaves the subpath in the eagerly loaded +// `vendor-objectstack` chunk. Deferring or deleting this import therefore moves +// ~nothing while that edge stands, and the lever lives at the producer — it is +// tracked in objectstack#11503. +// +// Still true, and still why laziness is not the local answer: each published +// spec subpath is a self-contained bundle and nothing tree-shakes it +// (`@objectstack/spec` declares no `sideEffects`), and the console's // `vendor-objectstack` chunk group claims every `@objectstack/*` module except -// `@objectstack/lint`, and that group's chunk is a static import of the app -// entry (objectui#5266). Tracked in objectui#5359. +// `@objectstack/lint`, that group's chunk being a static import of the app entry +// (objectui#5266). So an `await import()` here would relocate nothing either. // // ⛔ Do not "optimize" this into a local copy of the spelling table: a // spec-named local declaration is what `scripts/check-spec-symbol-derivation.mjs`