Skip to content

gxt: the native dist leaves out the Glimmer compiler entries; the compat bridge imports gxt by name - #33

Merged
lifeart merged 3 commits into
glimmer-next-freshfrom
gxt-tree-shaking-dist
Nov 19, 2026
Merged

lifeart merged 3 commits into
glimmer-next-freshfrom
gxt-tree-shaking-dist

Conversation

@lifeart

@lifeart lifeart commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Two changes to the gxt builds of emberjs#21340. They change only Ember and run on the pinned @lifeart/gxt 0.0.88; they need no gxt release.

The gxt-native dist leaves out the Glimmer wire-format compiler entries

  • ember-template-compiler, @ember/template-compiler/lib/*, @ember/template-compiler/-internal-primitives and the classic renderer's private barrel @ember/-internals/glimmer compile templates to Glimmer wire format, which the native layer does not render. The native package build already pruned them, together with the ~310 KB compiler chunk that only they reach. The rollup dist now never emits them: GXT_NATIVE_DIST_DROPPED_ENTRY_PATTERNS in scripts/gxt-alias-map.mjs. The native runtime compiler, @ember/template-compiler itself, stays.
  • The package contract (gxt-native-contract.json) names every non-app entry the package does not ship, whether the dist never emitted it or the prune removed it. The Vite preset refuses each of them with its reason, as before.
  • scripts/bundle-budgets.json: the gxt-native budget is re-baselined at the measured floor + 5%, the method the earlier budget updates used. The budget goes from 177,500 to 115,599 brotli.
    • The floor in its comment, 110,094 brotli, was measured together with the next change to this layer: the item reference runtime, installed by the templates that need it (with gxt 0.0.89).
    • On this branch alone the dist is 110,144, at 95.3% of the budget.
  • An app never loads these entries. Apps built from the dist have the same raw bytes as before.

The compat bridge imports gxt's argument-source helpers by name

  • gxt-next-exports.ts read argSource, argumentOf and isItemSlotParam through import * as gxt, with a fallback for a gxt that lacked them.
  • The pinned 0.0.88 exports all three, so the bridge now imports them by name and drops the fallbacks.
  • The namespace alias kept part of gxt's main entry alive in a compat app, about 1 KB brotli. The strict modern app built from source on the compat build went from 225,337 to 224,472 brotli (−865) when this change was measured on its own: 44318673314.
  • The module is not in a native app.

Verification

The checks of this PR, and GXT Full dispatched on its head (9fcceeb350), all against the npm @lifeart/gxt 0.0.88:

suite result run
GXT Full baseline gate OK, 10,250 / 10,482 pass across 1,065 modules, no new failures, none fixed 44397842672
GXT native baseline gate OK, 7,204 / 7,216 pass across 684 modules, no new failures, none fixed; strict and loose apps from the dist boot 17/17; package consumer 15/15 44397832635
GXT Smoke contract OK, 4 shards OK 44397832556
dual build the classic dist is byte-identical to the base (diff -rq, 290 files); the native dist is VM-free and within budget 44397832706
CI 64 jobs passed; "Perf script still works" failed because it compares against origin/main, which this fork does not have (fatal: ambiguous argument 'origin/main'); the job runs only on pull requests 44397832712

Bytes, brotli, against the base 5b8170e746 (the head of emberjs#21340) on the same gxt:

base this branch
gxt-native dist, prod (whole tree) 169,853 110,144
gxt-native dist, dev (whole tree) 359,648 281,759
gxt-native strict / loose app from the dist, raw 279,712 / 280,757 279,712 / 280,757
compat dist, prod (whole tree) 249,233 249,232
classic dist, prod 204,075 204,075

🤖 Generated with Claude Code

lifeart and others added 3 commits November 19, 2026 00:03
…er entries

ember-template-compiler, @ember/template-compiler/lib/*, its primitives and the
classic renderer's private barrel have no native meaning; the package build
pruned them with the ~310 KB compiler chunk only they reach, the dist now never
emits them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…does not ship

Whether the dist never emitted it or the package build pruned it, so the Vite
preset refuses ember-template-compiler and the classic renderer barrel either way.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…name

gxt 0.0.88 exports them, so the namespace object the by-name reads went through
is gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown

📊 Size report

Tarball size — 1.2 MB → 1.2 MB

dist/dev   No changes

File Before (Size / Brotli) After (Size / Brotli)
./packages/shared-chunks/index-{hash}.js 62.6 kB / 12.5 kB -8.38%↓57.3 kB / 13%↑14.1 kB
Total (Includes all files) 2.2 MB / 523.1 kB 2.2 MB / 523.1 kB

dist/prod   No changes

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 1.2 MB / 278.2 kB 1.2 MB / 278.2 kB

smoke-tests/v2-app-template/dist   No changes

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 361.2 kB / 97.5 kB 361.2 kB / 97.5 kB

smoke-tests/v2-app-hello-world-template/dist   No changes

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 129.7 kB / 35.5 kB 129.7 kB / 35.5 kB

🤖 This report was automatically generated by wyvox/pkg-size

@lifeart
lifeart merged commit 9fcceeb into glimmer-next-fresh Nov 19, 2026
90 of 91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant