Skip to content

Commit 2074a59

Browse files
claude[bot]claude
andauthored
docs(app-shell): correct the eager-graph attribution above the /meta spelling fold (#5925)
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 (0fce2ef) 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. Claude-Session: https://claude.ai/code/session_01EuPCi56cnGyykygi3z9w4m Co-authored-by: Claude <noreply@anthropic.com>
1 parent 165c681 commit 2074a59

2 files changed

Lines changed: 31 additions & 9 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
---
3+
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.

‎packages/app-shell/src/preview/DraftChangesPanel.tsx‎

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,34 @@ import {
3535
} from '@object-ui/components';
3636
import { useObjectTranslation } from '@object-ui/i18n';
3737
// The `/meta` URL-spelling fold (objectstack#7894, #8424), applied once in
38-
// `listPendingDrafts` below. Measured cost of this import on the console's
39-
// EAGER graph — the panel is reached statically from ConsoleLayout through
40-
// DraftPreviewBar — is +213.4 KB minified / +60.1 KB gzipped, on a graph that
41-
// already holds the spec entries app-shell imports statically (`/ui`,
42-
// `/kernel`): each published spec subpath is a self-contained bundle and
43-
// nothing tree-shakes it (`@objectstack/spec` declares no `sideEffects`).
44-
// Lazy-loading it here would NOT move those bytes — the console's
38+
// `listPendingDrafts` below.
39+
//
40+
// CORRECTED, and the correction matters more than the number. An earlier
41+
// version of this comment stated that this import puts `@objectstack/spec/shared`
42+
// on the console's EAGER graph, at +213.4 KB minified / +60.1 KB gzipped. The
43+
// attribution is false: that cost was never this import's. Measured by ablation
44+
// on `origin/main` at 0fce2ef81 (2026-08-24) — delete this import, rebuild
45+
// `apps/console`, read the `eagerGzipBytes` in `dist/eager-closure.json` — the
46+
// eager closure moves +285 bytes gzipped, i.e. minifier noise. Read that figure
47+
// as what it is, one tree on one day; the full measurement, with the
48+
// counter-probes that discriminate it, is recorded on objectui#5359.
49+
//
50+
// The MECHANISM is the part that survives the next release. `/shared` is held on
51+
// the eager graph by an edge upstream of this repo: `@objectstack/core`, shipped
52+
// inside `@objectstack/client` and a direct dependency of `apps/console`, has a
53+
// runtime `import { pluralToSingular } from '@objectstack/spec/shared'`. Every
54+
// OTHER importer of `/shared` in objectui's own source is type-only and erased
55+
// at build, so ablating this one still leaves the subpath in the eagerly loaded
56+
// `vendor-objectstack` chunk. Deferring or deleting this import therefore moves
57+
// ~nothing while that edge stands, and the lever lives at the producer — it is
58+
// tracked in objectstack#11503.
59+
//
60+
// Still true, and still why laziness is not the local answer: each published
61+
// spec subpath is a self-contained bundle and nothing tree-shakes it
62+
// (`@objectstack/spec` declares no `sideEffects`), and the console's
4563
// `vendor-objectstack` chunk group claims every `@objectstack/*` module except
46-
// `@objectstack/lint`, and that group's chunk is a static import of the app
47-
// entry (objectui#5266). Tracked in objectui#5359.
64+
// `@objectstack/lint`, that group's chunk being a static import of the app entry
65+
// (objectui#5266). So an `await import()` here would relocate nothing either.
4866
//
4967
// ⛔ Do not "optimize" this into a local copy of the spelling table: a
5068
// spec-named local declaration is what `scripts/check-spec-symbol-derivation.mjs`

0 commit comments

Comments
 (0)