Skip to content

gxt: use @lifeart/gxt 0.0.89; the item reference runtime comes with the templates that need it; the compat app built from source boots - #34

Merged
lifeart merged 5 commits into
glimmer-next-freshfrom
gxt-use-0089
Nov 19, 2026
Merged

lifeart merged 5 commits into
glimmer-next-freshfrom
gxt-use-0089

Conversation

@lifeart

@lifeart lifeart commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Uses @lifeart/gxt 0.0.89 (lifeart/glimmer-next#280) in emberjs#21340, and with it:

The item reference runtime comes with the templates that need it

  • 0.0.89's compiler imports @lifeart/gxt/item-references under the Ember dialect too, for a template that keys a list by position (key="@index", @key) or renders a native {{#each-in}}. The native layer's install.ts no longer calls registerItemReferenceRuntime() for every app.
  • A runtime-compiled template still gets the runtime: the native runtime compile binds $_itemRefKey from the main entry, and calling it installs the runtime; the compat setupGlobalScope still installs it. No Ember-side template keys a list by position or uses {{#each-in}}.
  • The vite configs resolve @lifeart/gxt/item-references to its own entry. The @lifeart/gxt alias, a string, also matched that subpath.
  • A lists app (smoke-tests/modern-app/app-lists), boot-checked in the GXT native workflow, renders key="@index" and {{#each-in}} lists, replaces their sources, and checks the rows: positional rows keep their DOM nodes and show the item now at their position; each-in rows of kept entries keep theirs. --assert-native checks both ways that only this app ships @lifeart/gxt/item-references.

The compat app built from source boots

The strict modern app, built from source on the compat build, rendered its application template and no route below it, with no error, and both of its <LinkTo>s linked to the last route. Three causes:

  • The compat vite pipeline compiled an app's .gjs / .gts with a gxt dialect that reads {{outlet}} as a yield to the default block, which renders nothing. It now compiles them with gxt's EMBER_OUTLET flag: {{outlet}} renders the compat backend's outletComponent host hook, which renders <ember-outlet>.
  • An <ember-outlet> called a child route's build-time template, a gxt template function, as a template factory. Such a function now renders as a runtime-compiled template renders gxt's own template function (compile.ts, templateForFunction).
  • Internal components (<LinkTo>, <Input>, <Textarea>) keep one instance per invocation within a render generation. An app renders in generation 0, which || -1 read as no generation, so every <LinkTo> of a template rendered the first one's instance with the last one's arguments. It is ?? -1.

The GXT native workflow's modern-app job now builds this app and gates it like the native apps.

Verification

The checks of this PR, and GXT Full dispatched on its head, all against the npm @lifeart/gxt 0.0.89:

suite result run
GXT Full baseline gate OK, 10,250 / 10,482 pass across 1,065 modules, no new failures, none fixed 44477565750
GXT native baseline gate OK, 7,204 / 7,216 pass across 684 modules, no new failures, none fixed; native strict, loose and lists apps from the dist boot (17/17, 17/17, 8/8); the compat strict app built from source boots 17/17; package consumer 15/15 44477546646
GXT Smoke contract OK, 4 shards OK 44477546830
dual build the classic dist is byte-identical to the base (diff -rq, 290 files); the native dist is VM-free and within budget 44477546833
CI 64 jobs passed; "Perf script still works" failed because it compares against origin/main, which this fork does not have 44477546897

Bytes, brotli:

before (0.0.88, the previous change of this stack) this branch
gxt-native strict app from the dist 75,677 (gxt 18,837) 74,559 (gxt 17,762)
gxt-native loose app from the dist 75,910 74,846
gxt-native lists app from the dist — 74,431, ships @lifeart/gxt/item-references
gxt-native dist, prod (whole tree) 110,144 110,094
compat strict app built from source did not boot; not gated 224,575, boots 17/17

The strict app is 1,118 B smaller: the item reference runtime it no longer installs, and the async list 0.0.89's render-tree capture no longer keeps.

🤖 Generated with Claude Code

lifeart and others added 5 commits November 19, 2026 10:08
0.0.89 is 0.0.88 plus lifeart/glimmer-next#280, made for this
integration:

- under the Ember dialect, a template that keys a list by position or
  renders a native `{{#each-in}}` imports the item reference runtime
  itself;
- the render-tree capture reads a list's rows without importing the list
  classes;
- `@lifeart/gxt/runtime-scope` exports the runtime symbol table and
  `setupGlobalScope` from a module that imports no compiler;
- the vite plugin's `precompileTemplate` option compiles Ember
  `precompileTemplate` call sites at build time under the plugin's own
  flags;
- a TypeScript module whose only templates are `precompileTemplate` calls
  compiles, and DOM that the Ember compat manager returns for a
  template-only component is that component's output.

The compiler and the runtime must be the same version; this repo uses the
pinned gxt for both. The package's manifest and dependencies are those of
0.0.88 but for the version and a new `./runtime-scope` export, so the
lockfile entries change only in version and integrity.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ates that key a list by position

Not by every app: the strict modern app keys no list by position and renders no
each-in, so it carried the runtime for nothing. (The compiler half, emitting
the install for the Ember dialect, is a gxt change.)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A template compiled at build time that keys a list by position or renders
{{#each-in}} imports the item reference runtime from @lifeart/gxt/item-references.
The bare @lifeart/gxt alias, a string, also matched that specifier and resolved
it inside the main entry's file, so every test module with such a template
failed to load. It now has its own alias ahead of the bare one, in the compat
and the native config.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… only with the template that needs it

smoke-tests/modern-app/app-lists: one route with a list keyed by position
(key="@index") and an {{#each-in}}, the two list shapes whose compiled templates
install gxt's item reference runtime. Its boot check renders the rows, replaces
each list's source and checks that the rows update in place (a positional row
keeps its DOM node and shows the item now at its position). --assert-native
checks the closure both ways: the lists app ships `@lifeart/gxt/item-references`,
the strict and loose apps do not.

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

The strict modern app, built from source on the compat build, rendered its
application template and no route below it, with no error, and both of its
`<LinkTo>`s linked to the last route. Three causes:

- The compat build compiles an app's `.gjs` / `.gts` with the gxt compiler,
  whose dialect read `{{outlet}}` as a yield to the default block, which
  renders nothing. The compat vite pipeline now compiles them with gxt's
  EMBER_OUTLET flag: `{{outlet}}` is `$_outlet(ctx)`, which renders the
  component the compat backend registers as gxt's `outletComponent` host hook.
  It renders `<ember-outlet>`, the element a runtime-compiled `{{outlet}}`
  becomes.
- A route template compiled at build time is a gxt template function. The
  root template rendered the application's, but an `<ember-outlet>` called a
  child route's as a template factory, without a context. Such a function now
  renders as a runtime-compiled template renders gxt's own template function,
  at every level (compile.ts `templateForFunction`). A template factory chain
  registered as a function still renders as before.
- Internal components (`<LinkTo>`, `<Input>`, `<Textarea>`) keep one instance
  per invocation, found by owner, component and call order within a render
  generation. An app renders in generation 0 (only the test harness advances
  it), which `|| -1` read as no generation: the call counters were reset at
  every invocation, and every `<LinkTo>` of a template rendered the first one's
  instance with the last one's arguments.

The modern-app job boots the compat app built from source and gates it like
the native apps.

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 57.3 kB / 14.1 kB 9%↑62.6 kB / -11.4%↓12.5 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)
./packages/shared-chunks/cache-{hash}.js 619 B / 234 B 1,200%↑8 kB / 735%↑2 kB
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 changed the base branch from gxt-tree-shaking-dist to glimmer-next-fresh November 19, 2026 12:10
@lifeart
lifeart merged commit 1a18f27 into glimmer-next-fresh Nov 19, 2026
89 of 90 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