Skip to content

[FEATURE gxt-dual-backend] GXT dual-backend rendering (opt-in preview) - #21340

Draft
lifeart wants to merge 8 commits into
emberjs:mainfrom
lifeart:glimmer-next-fresh
Draft

lifeart wants to merge 8 commits into
emberjs:mainfrom
lifeart:glimmer-next-fresh

Conversation

@lifeart

@lifeart lifeart commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

GXT rendering backends for Ember (opt-in preview)

This branch is main (9ed291512e) plus 8 commits, head ac0da0739c; how to review lists them. They are the original series with its 310 follow-up commits, 18 later ones and, with the second squash, the 81 commits that were on top folded in, rebased five times onto a newer main; the third rebase also folded in 9 fixes. The 81 were 3 fixes, 19 commits of the regex cleanup, 2 for main's deprecation of the classic Component (fifth rebase), 2 that lower native's memory and teardown cost, 5 for gxt 0.0.87, 36 for gxt 0.0.88, 4 baseline commits, and 10 that cut what an app ships, with gxt 0.0.89. The history is kept, unchanged, on these branches of lifeart/ember.js:

  • gxt-pre-squash2-2063496034: the 89 commits before the second squash; the head has its tree;
  • gxt-pre-squash-b1bf210aef: the per-fix history, 318 commits on the old base a9501d5d40;
  • gxt-followups: the 18 later follow-ups, on the squashed head 030a6f51c1; its tip 81060259b3 has the tree of 92689181a5;
  • gxt-pre-rebase2-92689181a5, gxt-pre-rebase3-bc3fda94ea, gxt-pre-rebase4-5d4854653d and gxt-pre-rebase5-a31347de36: the heads before the second to fifth rebases;
  • gxt-ember-easy-fixes (8) and gxt-ember-hard-fixes (the ninth, 79060b45c0, and a baseline commit): the 9 fixes folded in with the third rebase, on top of 92689181a5;
  • gxt-pre-rebase-68874e540b: the earlier 312-commit history, with a demo app that is not part of this PR.

A commit SHA in this description is a commit of gxt-pre-squash-b1bf210aef, unless it is one of main's, one of this branch's 8, one of the 89 on gxt-pre-squash2-2063496034, or the text names another branch. a31347de36 and e4f2cd0e6d, heads of earlier descriptions, are on gxt-pre-rebase5-a31347de36. The first experiment was #20711.

Summary

This PR adds @lifeart/gxt as an opt-in, build-time rendering backend for ember-source. It comes in two flavors:

flavor selected by what it is
compat GXT_MODE=true (Vite dev and test pages), EMBER_RENDER_BACKEND=gxt (rollup dists) Classic Ember on gxt: classic components, curly invocation, the classic object model. The @glimmer/* rendering and reactivity modules are replaced by packages/@ember/-internals/gxt-backend/.
native EMBER_RENDER_BACKEND=gxt-native (Vite and rollup) Modern Ember with no Glimmer VM: classic Ember source, with only the VM-touching modules swapped for gxt-backend/native/. Ember tags are gxt cells, so there is one reactive system.

The default build is classic and unchanged in behaviour. GXT code in classic packages sits behind the __GXT_MODE__ build constant, which the classic and native builds fold to false. bundle-size-check classic fails if live GXT bridge code reaches the classic dist. The classic suites match main's, plus this PR's tests in shared test files, which pass on classic too. The classic dists are not byte-identical to main's (why).

Opting in is a build-time choice; this PR publishes nothing.

  • native: scripts/build-gxt-native-package.mjs --pack <dir> builds ember-source-gxt-native. An app installs it as ember-source ("ember-source": "npm:ember-source-gxt-native@<version>") and adds the Vite preset emberGxtNative() from ember-source/vite. It supports Vite only: no ember-cli and no @embroider/vite.
  • compat: scripts/build-gxt-package.mjs builds ember-source-gxt (dist-gxt-package/). The emberSourceGxt smoke scenarios install it as ember-source.

Native scope. In scope: @glimmer/component and template-only components; strict .gjs / .gts templates and loose resolver templates; the router, outlets and LinkTo; helpers and modifiers, including custom managers; @tracked, @cached and tracked collections; services, renderComponent, runtime compilation through @ember/template-compiler, and the debug render tree.

Out of scope: classic @ember/component, <Input> / <Textarea> / {{mut}} two-way bindings, ArrayProxy / ObjectProxy content reactivity, {{unbound}}, engines / {{mount}}, SSR, and .hbs files. Using a classic component or <Input> / <Textarea> throws. The native test run skips 286 tests, each with a reason in scripts/gxt-test-runner/native-skip.json or in the test source.

Current status

The numbers are from the fork's CI, with @lifeart/gxt 0.0.89, on 2063496034, whose tree the head has (runs).

Since 5b8170e746, 10 commits with gxt 0.0.89 cut what an app ships:

  • native strict app boot JS: 75,718 → 74,559 bytes brotli;
  • native dist tree: 169,853 → 110,094;
  • a compat app built from source, which rendered no route, now boots and ships no template compiler (164,582).

No test result changed: compat stays at 10,250 / 10,482 and native at 7,204 / 7,216, with the same known reds. The classic prod tree is byte-identical. The 89 commits were then squashed into 8, with the same tree.

Tests

suite result
compat full (5 shards, merged) 10,250 / 10,482 tests, 1,065 modules, 0 timeouts, 0 harness errors. All 232 failing rows are known reds listed in test-results/gxt-baseline.json. baseline-gate: OK.
— [integration] modules 1,936 / 2,156
— everything else 8,314 / 8,326, including 320 tests in 72 GXT … modules and 48 in the two modules converted from vitest (test harness), all added by this PR and all green
compat smoke (PR CI, 14 modules, 4 shards) 274 / 275; the failure is a known red
native suite (4 shards, merged) 7,204 / 7,216, 684 modules, 12 known reds, 286 skipped. baseline-gate: OK.
classic Basic Test 9,429 tests: 9,408 pass, 21 skip, 0 fail (main: 9,296 / 9,275 / 21 / 0); the 133 extra tests are added to shared test files by this PR.
classic Production build 9,262: 9,220 pass, 42 skip, 0 fail (main: 9,131 / 9,089 / 42 / 0). Two of the 133 added tests are development-only.
classic Firefox 9,422: 9,397 pass, 25 skip, 0 fail (main: 9,289 / 9,264 / 25 / 0)
other classic jobs All deprecation, optional-feature and stable-decorator variants, BrowserStack, Linting, type checks (current version and 5.2–5.9, 6.0, 7.0), Node (26 / 26, with the 6 new classic-dist guard tests), Blueprint and package preparation tests pass.
smoke apps 38 / 38 jobs (19 scenarios, each also with deprecations removed), including the 4 emberSourceGxt jobs (compat package boot and consumable)
native package consumer The packed ember-source-gxt-native plus the npm @lifeart/gxt 0.0.89 tarball, installed in a fresh app outside the repo: 15/15 acceptance checks; prod and dev each boot 17/17; the prod bundle is byte-identical to the harness measurement (74,559 br).

main's counts are from emberjs/ember.js run 43093963147 on 9ed291512e, whose test jobs all passed (it is marked failed: two publish jobs stayed queued).

The runner runs a nested QUnit module on its own and inside its parent, so the totals count its tests twice: 648 compat and 135 native tests.

Compat known reds and skips

Counting a nested module's tests once, 206 distinct tests fail:

  • 61 render on the server into a SimpleDOM document or check Glimmer's serialization (the node jit and serialization modules).
  • 119 expect Glimmer to reject an invalid template at compile time: 104 in the compile errors and … syntax errors modules, 11 strict-mode names that are not in scope, and 4 strict-mode {{component}} misuses.
  • 1 is the global failure of ember-template-compiler: custom plugins passed to compile, a development-only module that registers no test under GXT.
  • 25, in 17 modules, are behaviour gaps. The known gaps list them by cause.

baseline-gate reports 216 known reds, because it keys failures by module and test name, and two SSR parent modules list each failing test of their three child modules under one name.

125 test rows are skipped. 21 of them are skipped on classic too. The other 104 are GXT-only skips, each with its reason in the test source:

  • 59 rehydration-suite tests (74 rows: a nested module also runs inside its parent) that assert rehydration stats or Glimmer's serialization markers (GXT_UNSUPPORTED in integration-tests/lib/modes/rehydration/gxt-delegate.ts). The delegate fabricates no markers.
  • Tests of Glimmer VM internals (integration-tests/lib/test-helpers/gxt-unsupported.ts): the list-update steps of {{#each}} swaps, serialization markers, and dynamic variables other than outletState.
  • The compiled-template meta of a compile option, and visit() with _renderMode: rehydration, which asserts under GXT.

Bytes

The same modern app (smoke-tests/modern-app) is built from each rollup dist (GXT native run 44477554401). The boot JS includes Ember, gxt and the app, compressed with brotli. The strict and loose variants pass 17/17 boot checks, the lists variant 8/8.

app classic Glimmer VM gxt-native difference
strict (.gjs) 81,399 74,559 (gxt runtime: 17,762) −6,840 (−8.4 %)
loose (resolver) 81,546 74,846 (gxt runtime: 17,887) −6,700 (−8.2 %)
lists (key="@index" and {{#each-in}}) 80,129 74,431 (gxt runtime: 18,365) −5,698 (−7.1 %)

--assert-native checks that gxt's item reference runtime is in the closure of the new lists app and in neither of the other two.

Compat, built from source (the repo's Vite pipeline):

  • The strict app boots 17/17 at 164,582 bytes (gxt runtime: 22,359). At 1a18f27dbf it was 224,575 (run 44477546646), so the change is −59,993 (−26.7 %).
  • --assert-no-runtime-compiler finds no template compiler module among its 271 source modules.
  • The loose app compiles its templates at runtime, so it loads gxt's compiler. It boots 17/17 at 224,856 bytes.

Whole dist trees (every .js file under dist/<mode> concatenated, then brotli; GXT dual-build run 44477554379), with their budgets in scripts/bundle-budgets.json:

classic compat native
prod 204,075 250,395 (+22.7 %) 110,094 (−46.1 %)
prod budget 213,836 260,202 115,599
dev 407,425 693,811 (+70.3 %) 281,558 (−30.9 %)
dev budget 426,719 717,769 295,743

The native trees no longer hold the Glimmer wire-format compiler entries, which the classic trees keep, so compare the apps above, not the whole trees.

The classic and compat budgets were last re-baselined at the measured size + 5 % (81060259b3, on lifeart:gxt-followups), the native ones by a89865441e. The check fails above 5 % over budget, and the trees are at 95.2 % to 96.9 % of their budgets.

Since 5b8170e746 (run 44263886656):

  • The classic prod tree is byte-identical: the dist artifacts of both runs have the same 290 files (diff -rq).
  • In prod brotli, compat grew by 1,162 bytes and native shrank by 59,759.

assert-native-dist passes for prod and dev:

  • The native app closure contains no Glimmer VM module and no template compiler, and has a single reactive system.
  • Of @glimmer/runtime, its forbidden list (GXT_NATIVE_FORBIDDEN) allows only lib/dom/sanitized-values, lib/dom/normalize, lib/dom/props and lib/debugger-callback.
  • No entry point reaches a Glimmer VM package any more; five did, outside the app closure.
  • Two entry points reach a template compiler, both gxt's: @ember/template-compiler and …/runtime.

Memory (krausest, CI)

Measured on a31347de36's code, before the fifth rebase and the memory changes below, with npm @lifeart/gxt 0.0.86. The runs are 42316206191 and 42318092991 (24 reps each) of d67fbfbc45 on lifeart:gxt-krausest-harness. That branch adds a krausest (js-framework-benchmark) app, scripts/krausest-bench.mjs and a workflow, none of them part of this PR. Medians in MB (10⁶ bytes), run 1 / run 2:

classic Glimmer VM gxt-native difference
heap after creating 10k rows 52.19 / 52.19 40.98 / 40.95 −21.5 %
heap after clearing them 4.73 / 4.72 4.54 / 4.55 −3.8 %
heap growth per 10k-row create/clear cycle 0.0022 / 0.0022 0.026 / 0.026 +0.024
  • Script time. Native's is lower on 7 of the 9 ops in both runs, from −30 % on create1k to −81 % on update10th. It is higher on create10k (+4.1 % / +0.9 %) and clear1k (+9.5 % / +6.4 %). Compare within a run only.
  • Method. Each rep opens a fresh page per variant, in alternating order, and every op's DOM equalled classic's. The heap is Runtime.getHeapUsage after gc. The growth is the slope of the heap after a clear, over 5 create/clear cycles.
  • The 0.026 MB per cycle is a bounded ramp, not a leak (runs 43382515579 and 43384975686).
    • Over 20 cycles, native's heap after a clear goes from 4.149 to 4.230 MB, flat from about the sixth cycle, as classic's does (4.374 to 4.475 MB).
    • No gxt or Ember object group grows. Over 25 cycles the slope is 0.003 MB (classic 0.001).
  • Native changes on top, measured as the same diffs on a31347de36, both builds in one job:
    • dbb569597b, one object per helper call site. Run 43390824992: heap with 10k rows 41.02 → 40.05 MB; 3,479 → 3,382 bytes per row.
    • 8485e27bad, one fallback modifier-destroy flush per run loop. Run 43396423935: clear1k 47.05 → 44.20 ms (classic 44.80); heap 40.95 → 40.01 MB.
  • Two gxt changes need a gxt release: clearing the duplicate-key table after use (slope 0.027 → 0.007 MB; run 43387276731), and a formula's single dependency kept without a Set (−145 to −155 bytes per row; runs 43386888574, 43390824992).

What the 8 commits contain

This section summarises by area the follow-ups and fixes folded into the 8 commits, the rebase adaptations and the commits that were on top.

Parts marked after the squash cite commits of gxt-followups, and third rebase of the two fix branches. Sections marked on top were folded in with the second squash. The fourth rebase parts are in commits 2–6, whose messages list them. Each fix commit message gives the root cause, and fixes that change behaviour come with tests that failed before them. 5b8170e746 takes both baselines from the runs of d6b90531fe (GXT Full 44258818349, GXT native 44258818262). Everything below is compat unless it says native.

Rendering correctness

  • Content mustaches render their value (text, updated in place; a SafeString's HTML, parsed in its element's namespace; a DOM node; a fragment's nodes; a component) at a template's top level, inside elements and for helper results (c02e65b8f5, e49a0f17ba, 0fefcbd515, ac92f3aa7a, 2567a776db). Build-time .gjs / .gts templates do the same inside elements (6915dbdedf), and at their top level through gxt 0.0.84's content-binding hook (e463bd06f0).
  • Attributes. A bound attribute updated to null or undefined is removed (972ddf69ee). class is an attribute, and classes merged through ...attributes follow Glimmer (c6355fb7b5). An attribute that names a property of its element is set through the property (2e4812f25c). A triple curly in an attribute renders its value (64bd42705d). A bound style keeps its text as written, not as the CSSOM re-serializes it, and null, undefined, false or '' remove it (2b824a9b26, with gxt 0.0.85, compat and native).
  • Template text. A compat template's text is Glimmer's: whitespace text between values and between elements is kept, a block on a line of its own adds no newline, ~ strips whitespace, and an entity in an attribute value is decoded once (0e46f9b991, with gxt 0.0.85).
  • URL sanitization uses Glimmer's own sanitized-values, not outdated copies of its lists, in every path that writes a URL attribute, forwarded ones included, in development and production, in compat and native (f93c20f33e, ac68721b69, 1ce514a0ab).
  • Dynamic components and curried values.
    • A dynamic component follows its definition, including one made from a reference or at the start of a template (a0023cc485, 42f32b7cf2, 7c6547ed96).
    • A curried component keeps its instance while its curried value stays, and updates when a curried argument changes (1a336f6b9c, 3a5e2d1fc5).
    • A content mustache renders each component value as an invocation of its own, which is destroyed when the value is replaced (a5270a0181, d998d6eb75). A yielded curried value that changes renders its new component (51cdbcc1e1, 6257592af4).
    • (component …) in an argument or attribute position is a curried component (84dad24674). Invocation positionals are appended to curried ones (c0e84a86c4). A curried (modifier …) argument stays one value while its definition is the same (76a039ee5d).
  • Component and helper values. A component or helper class in content position renders; a component value called with arguments in append position gets them; the block of a dynamic invocation of a template-only component renders; a name called with arguments that is neither a helper nor a component throws. A string is not resolved as a component in strict mode or in <this.x> (ea8a56928c, f1065adada, 0904bf8e41, 872f3ab467, d8ae7bbe7e). Third rebase: native {{get}} reads a property of a primitive, such as a string's length, as Glimmer's isDict allows (b9056d70f5).
  • Blocks and block params. Angle-bracket block params are bound per invocation of the block, and nested blocks read the outer block's params (5e6bced0b5). {{else}}, <:else> and <:inverse> are one block (a37eb299c5). A tag naming a block param invokes the yielded component (6438cd7a77). A block param in a quoted attribute is its value (83810390af). <@comp as |v|> passes its block and block params (47db2a5080). Whitespace between named blocks is not a default block that replaces <:default> (cf1a6aa14c).
  • .gjs / .gts components. A class with a class-body <template> renders through its component manager (ba66721c72), as does a class with a registered template invoked lexically (7240def4a3). The nearest template of a class chain wins (76385ea3b9, compat and native). A <template> component invoked by name receives ...attributes, renders its blocks, and does not get its attributes as arguments (0f0976c613, 58984137b5, f4c40b7be2). Decorators in gxt-compiled files import decorator-transforms' runtime, so no dt7948 global is needed (5100fa24dd, d874899199, compat and native).
  • renderComponent runs the custom manager of a plain-object definition (06ca2f1fd6), so the [integration] suites, whose harness renders every loose template that way, have a real context. A root updates in place instead of re-rendering whole on any tag change (6f5611dab1), is a root of its owner's renderer (d78683b33d), renders before the cursor's nextSibling (7476e88553), accepts a <template> value (7c9095995c), uses a hasSubOwner manager's owner (59a0e407ed), and creates SVG elements inside an <svg> (c4126ba773).
    • Fourth rebase: main's rendering tests render each template as a root of BaseRenderer#render. Such a root renders through the glimmer host's renderRoot with a classic root's context cells, so its function-valued and ArrayProxy-valued properties re-render when set. A root whose first render failed stays in its renderer until the renderer is destroyed (compat and native).
  • {{#in-element}} follows its destination and leaves it with its block, as does a component inside it (555a6f15cf, d6c2ee0b9b).
  • SVG. A block inside <svg> keeps the SVG namespace on update, and an SVG text child updates (073609e6a7).
  • Lists. A keyed {{#each}} row renders the new object bound to its key (3109d6465f), and each object bound to it after that, also when the list grows at the same time (d049134601, with gxt 0.0.85). {{#each-in}} honours key= (b608afded1). {{#each}} over a native iterable re-iterates when what it read changes (a392191922). An {{#if}} branch or {{#each}} row rendered on update resolves names in its template's owner (5d7fb77fd7).
  • Modifiers. Each modifier on an element has its own instance (63cc148519). A modifier sees its element's content when it is installed (c0b147aa14), reads its current arguments (7e8bef68b4), updates in the owner its element rendered in (c81f8daf88), and is destroyed when its definition changes (9badc5318c).

Component lifecycle

  • A component is destroyed with the block it renders in, in the run loop that removes the block, and a block's components are destroyed in the order of their nodes. Components still rendered when a test ends are destroyed (9b84fde952, fd04350576, 81676cff0c).
  • A component's template renders in the block it is invoked in, so the teardown of an enclosing {{#if}} or {{#each}} reaches its modifiers. Modifiers are destroyed in the order their elements close (05b5302447, 1083384678). Third rebase: so are native ones, which are queued and destroyed in that order at the end of the render pass or root teardown (fa74262259), instead of gxt's parent-first order.
  • One instance per invocation: Glimmer components (b5eda4885e) and classic components (c7ac744eb5, cf4f6349ba) are no longer pooled per class.
  • A tagless classic component is destroyed with its block, and stays alive while its nodes are in the document (406548a43e, ec4f1ae128).
  • An {{#each}} row that renders a component removes the component's nodes when it goes (eddfdcfa8a). A modifier is destroyed with its block however it was installed or updated (dc33bfa368). A content binding owns the helper it renders and destroys it when the value changes (841bbaba0a).
  • Fourth rebase: a classic component's lifecycle events are sent as Glimmer's curly manager sends them (sendCoreViewEvent: the listeners, then the method), so main's Evented#trigger deprecation does not fire for them; user code's trigger calls stay deprecated. A classic component destroyed with its block runs willDestroyElement while its element is in the document.

Reactivity

  • Writes during render. A cell written in a modifier's install or update renders in the same run loop, as Glimmer's commit phase does (5f939592a4). Writes in didUpdate and didRender render until stable, up to the rerender limit, not three passes (03e0958b74).
  • dirtyTagFor reaches the DOM (d551ddebb1). It no longer reads the property it dirties (3c1b5da11a), and creating a property's tag no longer reads the property (b430e9d9d8). A content binding re-runs before the bindings its evaluation created (6ec3d03b1a).
  • Lazy reads. Values that Glimmer reads lazily or never are not read eagerly: (hash) members, curried arguments, the fn callback, the arguments <Input> / <Textarea> do not use, the getters of a rendered component, a route template's controller getters, and a dynamic component's value (03d48b04c3, 04b148cc76, 9c5cc9b98d, a8029df1c2, 50e2ddf5ee, 9702662b7e, c338dbf8fe). Some eager reads remain; see the gaps. Third rebase: native {{hash}} is one object of stable identity with a lazy getter per member, so a yielded (hash x=this.model.x) updates, an unused member is not read, and a custom tag lets @computed('args.hash.key') follow it (20d2d745a1).
  • Arguments. Glimmer component arguments read (mut) and (readonly) values, and (mut @arg) writes through the argument (5256bf4be0). A dependent key through a component argument follows what the argument reads (c9376e3978). Template-only component arguments update whatever invoked them (5f3a7db10f, 0f77b1e682). A renderComponent root argument is read as Glimmer's getProp reads it (958f1e8980).
    • Third rebase: a (fn …) result passed to a helper is not called at the argument site (ca628df3d3; see gxt 0.0.88).
    • On top: a component whose custom manager does not replace its arguments in updateComponent reads their new values, and a computed property over args.positional or args.named recomputes (3bc96e9594).
    • Fourth rebase: an internal component's arguments detect (mut) and (readonly) values without reading other properties of the value, so <LinkTo> renders a model that throws on unknown properties.
  • Caches. createCache, and so @cached, re-computes when a gxt cell its function read changes, including this.args of a Glimmer component (528cf966aa). A binding is evaluated once when it is created (d69fdb8eda). On top: a cache keeps its tag when a re-run consumes the same tags in the same order, and a frame that read only that cache ends with that tag, as main's validator does since Reuse the combined tag of a cache that reads the same tags again #21664 (b7c0a33d7e, compat and native). Revisions and invalidation are unchanged.
  • Collections and fields. A write to a tracked collection's storage or to a cell() renders by the end of the run loop (6f5611dab1). set() on a plain field re-renders a .gjs template that reads it (ec57f0d104). Third rebase: a helper recomputes when an EmberArray argument changes in place: it is compared through objectAt and length, as a native array is by its elements (78235805f4).
  • Smaller fixes: an inline if with no else value is undefined (c4668e4ecb); {{log}} logs again when its arguments change (132cabbc59); a track frame that consumed one tag ends with that tag (fbccd086b6).

Errors

  • Errors are no longer swallowed. About 450 empty or comment-only catch blocks, and over 100 other catches that dropped or only logged the error, were removed or converted, in gxt-backend/ and the GXT branches of classic packages. Each remaining catch rethrows (or handles one expected error), collects the error and throws the first one once the surrounding work has run, or, around a read Glimmer would not make or where no caller exists (see the gaps), reports it in development with warn (id ember-gxt.dropped-read), while the template's own read still throws. No catch in gxt-backend/ or in the classic files this PR touches drops its error unreported, apart from one that is identical on main.
  • Hidden bugs that the swallowing masked, fixed at their cause: dirtyTagFor read the property it dirtied (3c1b5da11a); an argument value that is a function with parameters was called as an argument thunk (b5dbcb4534); the DOM sync at the end of a run loop dropped every error (59cd9c4dc3); a binding that threw re-ran in every later sync (27e195c3a4), and gxt 0.0.85 now ends such a pass itself, so the bindings it did not reach render on their next change (a6459d9380); LinkTo's class and href reactor leaked across applications (b02ed88554).
  • Errors reach the caller as with Glimmer. What a render, update, lifecycle hook, modifier or helper throws reaches the caller of render, rerender(), runTask, a bare run() or autorun, or the set() that caused it (39d74cd176, 0d68d0e89c, 59cd9c4dc3, 8a97df6031, 36614af474, c6a667cb2c, 119ab64625). A render throws only its own errors, not a stale error queued by an earlier one (18037c8e71). A template that the GXT compiler cannot compile throws instead of rendering nothing (4b363558f1). Third rebase: a custom modifier whose install throws keeps the output rendered before it: the error is collected and rethrown after insert, as Glimmer does (79060b45c0). A thrown value that is not an Error is rethrown at once, unchanged. Fourth rebase: so does a component root: an error of its commit phase keeps the render and is rethrown once the render is complete.
  • Error-message parity is not a goal. Glimmer's development-only template checks were wired into the compat compile pipeline (0d54cc861d) and removed again (82bff4dd8a): they cost about 62 KB brotli in development. Tests that differ from Glimmer only in error text, and tests that expect an invalid template to be rejected at compile time, are known reds.
  • Unsupported features assert. visit() with _renderMode: 'serialize' or 'rehydrate' fails an assertion that GXT supports neither (d390108302).

Debug render tree (Ember Inspector) and {{debugger}}

  • A compat renderComponent render is a root of its owner's renderer, and captureRenderTree lists it with live bounds (d78683b33d).
  • Compat components and modifiers are nodes of the tree, with name, arguments, instance, bounds and nesting (05c9fc7adc). With gxt 0.0.84, <this.X> and <@X> nodes also get their path as the name (46841d4cef).
  • Native: gxt 0.0.83 adds {{#if}} block bounds and modifier nodes (Ember native: Glimmer block bounds for {{#if}} + Inspector modifier nodes lifeart/glimmer-next#266). Third rebase: native names a renderComponent root {ROOT}, and a component bound through a strict-mode scope by its binding name, as compat does (a41caf005a).
  • {{debugger}} calls Glimmer's debugger callback each time it renders, with the template's self (null for a template-only component) and a get for this, @name, block params and paths (cc5b59558c, with gxt 0.0.85's debugger hook, compat and native). Third rebase: the template-only mark is found through the render proxy (2bc65d6641). One of its tests still fails (see the gaps).

Routing

  • A route manager's own wrapper (getRouteWrapper) renders its routes, and a classic route template gets the @outlet argument (7040e46e9e).
  • A route template's action keeps its controller as this (f921fb272b).
  • A Glimmer component used as a route template is created by its component manager (345e2a6969).
  • An error in the route-template re-render that a controller change runs reaches that change (8a97df6031).

Development assertions

  • Backtracking. A render asserts when it writes a tracked value it already read in that render, per consumed value as Glimmer does, for Glimmer components as well as classic ones (81d10d84e9). The message text differs from Glimmer's.
    • On top: in development, a set() or @tracked write of a member that a template of the same render read through a path ({{this.wrapper.content}}, {{@wrapper.content}}, or value=this.wrapper.content rendered by a template-only component) asserts with Glimmer's message, which names the components rendering at the read and the path (36c200b5ce). A plain object's member is not covered (see the gaps).
    • Fourth rebase: backtracking messages label a component root {ROOT} and a classic root -top-level, as main's do.
  • Manager kind. A value invoked as a modifier, a helper or a component needs a manager of that kind (ec796c6bff).
  • Argument labels. In development, the argument references of a helper or modifier carry their template path, so the {{on}} and {{fn}} assertions name the argument (While rendering: this.foo; 92fda285c4, with gxt 0.0.85, compat and native).
  • Third rebase: a loose-mode {{attrs.x}} fails Ember's assert-against-attrs assertion, with its message and source location (1beed434a9), not a plain Error.

Memory (native)

  • A helper or modifier call site without named arguments keeps one shared, frozen empty hash, not the fresh {} of each evaluation (ecd9165aa4).
  • An element modifier is a class instance whose install and update are prototype methods, not two closures of its own (19f633b32e).
  • With gxt 0.0.85, the two lowered the heap with 10k krausest rows from 55.64 to 52.17 MB (run 39075448004, 12 reps; a later step failed). gxt-native | retained call-site shapes tests them.
  • On top: a helper call site is one object, also its argument source (dbb569597b); with the flush of 8485e27bad (memory), a modifier removed in a nested run() is still destroyed when that loop ends (tested).

Test harness

  • @glimmer-workspace/integration-tests assertions ignore GXT's curried-component boundary comments and its trailing block anchor (1ea465f836, 96c0216737).
  • Tests that check Glimmer VM internals are skipped under GXT, each with its reason (49746e696e, 9d67d6fb55, 2a65871b22, 59cb554612).
  • The jit delegate curries components as the GXT component helper does; the GXT rehydration delegate renders the server side non-interactively, with its components and modifiers registered (597fbf26e5, a1f5f22b7d).
  • The two vitest files that had no runner are QUnit modules that GXT Full runs: Compat: utils.ts (the same 44 cases) and @glimmer/component-gxt: reactive identity (4 tests) (5ec62d6896).
  • After the squash, every native-skip.json entry matches a skipped test (ca5c72e5c9, 432e968543).
  • Fourth rebase: the rendering and router test cases render through main's Glimmer root, under GXT through gxtHarness.runRender, which keeps runAppend's semantics. The native test case exposes this.root. GXT tests run main's deprecated A() and ObjectProxy.create inside ignoreDeprecation, or expect the deprecation.

CI

  • The compat full suite and the native suite run in parallel shards (5 and 4). scripts/gxt-test-runner/merge-runs.mjs merges the shards into the same gxt-summary.json and gxt-last-run.json as one unsharded run, which baseline-gate.mjs gates. A workflow took 20–27 minutes before and 6–7 after (16a3c98dbf); recent runs take 6–12 (11 on 2063496034).
  • The nightly GXT Full verdict comes from baseline-gate.mjs, so known reds no longer fail it and file an issue every night (ddcb06fb46).

Build and packaging

  • Classic ember-source no longer depends on @lifeart/gxt. The repo pins gxt once, as a root devDependency, and the generated ember-source-gxt and ember-source-gxt-native packages declare that exact pin as a dependency (b5f3a21daa).
  • Lint and type-check. pnpm lint and both root tsc programs (pnpm type-check, in both decorator modes) now cover gxt-backend and @glimmer/component-gxt, with no ESLint problem and no tsc error (5174ffe5e1). Exceptions: ember-local/no-barrel-imports is off in the two trees, as the GXT builds alias exact barrel specifiers; 34 per-line ESLint disables and 33 @ts-expect-error lines, each with its reason, and no @ts-nocheck; 7 paths entries and rootDir: "." in tsconfig.json. The published types still leave out both trees.
  • After the squash, the native forbidden list names the five compat Glimmer host modules (b6a0aaa131), so assert-native-dist, bundle-modern-app.mjs --assert-native and the native package's entry prune reject them by name.

Gated code in classic files

  • The GXT code of glimmer/lib/base-renderer.ts, renderer.ts, templates/root.ts and component-managers/unwrap-template.ts moved, verbatim apart from imports and exports, into gxt-backend's root-template.ts, render-component.ts, classic-roots.ts and template-adapter.ts (c741f0d35a, c604f8d668, f229c5009a, b1bf210aef). The four files reach it through one bridge slot, GxtGlimmerHost, which glimmer-host.ts fills, from a whole if (__GXT_MODE__) block or a top-level ternary that checks the host is installed. The classic dist/prod was byte-identical after each move. bundle-size-check classic also fails on a live getGxtGlimmerHost( or setGxtGlimmerHost( call.
  • After the squash, the same for the GXT template() of @ember/template-compiler (9b68659ccd), Route#refresh, Route#setup and didTransition (17e4043436), notifyPropertyChange (5c88a9bfe1) and getRootViews / getChildViews (5a0630464d). Ten more commits there remove the leftovers that changed the classic dist bytes: GXT-only imports, fields, exports and locals, two ungated template() wrappers, and the classic branch of 7 if/else forks.
  • Fourth rebase: main's rendering tests call BaseRenderer#render directly. Under __GXT_MODE__ it now hands the render to the glimmer host, as renderComponent does (9 more lines in base-renderer.ts). CoreView stays main's.

Regex scans replaced (on top)

These 19 commits replace the compat backend's regexes and hand-rolled scanners with AST transforms (gxt-backend/ast-transforms.ts) and value checks:

  • the regexes and scanners over template source;
  • six runtime and tooling sniffs.

They use the parser gxt's runtime compiler hands to its AST transforms, so there is no gxt change and no new parser. Each group starts with its tests, which CI ran on the old code; each fix's tests failed there unless noted. Each commit message says what the old code got wrong.

Template source (tests 4e081d060f, 3464daa1b6):

  • template(src, { scope: () => ({ this: x }) }) reads x wherever the template reads this (ab1cbf98d2).
  • template(src, { eval }) looks up only the template's free variables, PascalCase helpers included (9558c99f3c).
  • A block param named like a keyword that compat lowers by name is renamed in its block only, with every read of it (7f778fb235).
  • A block keyword that the scope shadows invokes the scope's value with its arguments and {{else}} block, each argument evaluated once (8f1edfa2e6).
  • <foo.bar> and {{foo.bar}} are checked against the block params in their scope, where Glimmer checks them (edf90556fe).
  • Each {{#in-element}} takes its fallback destination id from its own block (e11126d867).
  • precompileTemplate(…, { scope }) gives a template every scope name it uses (d61d591e72).
  • Every template binds the names of the each-in and dynamic-variable lowerings. Its 2 tests passed before too (ee10e25fc1).

Runtime and tooling (tests 9d94fc5278):

  • bundle-size-check classic reads the live gxt-bridge calls from the babel AST of each dist file. The reader is scripts/dist-ast.mjs, shared with assert-native-dist (19b7780544).
  • {{#each this.model.list}} over a list that is no Array keeps this.model when the list changes (52897eef53).
  • An argument whose name starts with Symbol reaches the component (a9369d25e9).
  • <LinkTo> and <Textarea> are known by identity, not by toString() (a3d525a815).
  • A template() scope name with a quote or a backslash is written with JSON.stringify (2dc58c5482).
  • The curly-c- tag-name branches, which nothing produces, are deleted (0f896a6ed9, no test).

The rebases onto main

  • The first three, onto 54d1bf526d, 4019de38a7 and 21a5f6c228, had conflicts only in package.json, pnpm-lock.yaml and one test file; their classic audits found nothing to gate but a skip of empty [integration] sub-modules.
  • The fourth, onto 493985e956 (44 commits, 77 files, 18 of which this PR then changed): main's [CLEANUP] Render tests through a Glimmer root component #21775 (rendering tests through a Glimmer root) and Deprecation enabled / URL updates for 7.5.0 #21745 (the 7.5 deprecations) broke about 386 compat tests at first; the adaptations above, listed in commits 2–6, fix them.
  • The fifth, onto 9ed291512e (9 commits, 43 files, 6 of which this PR then changed): Implement RFC #1216: Deprecate the classic Component #21630 (Deprecate "ember component" rfcs#1216) deprecates the classic Component and guards main's classic component tests. Commit 6 takes main's guarded versions of four components/classic/ test files with this PR's GXT branches re-applied; no other commit changed. 701ca09d7f makes 4 tests this PR adds expect the deprecation, keeping their names. 2e5f4528fe follows main's rename of a debug render tree test in native-skip.json and the native baseline.

Each time, pnpm-lock.yaml is main's lockfile plus this PR's 294 lines, none removed, and the baselines were regenerated from CI.

gxt releases consumed

0.0.82 (lifeart/glimmer-next#265) to 0.0.85 (lifeart/glimmer-next#266 to lifeart/glimmer-next#269; pins 6114d128e4, 26181318aa, e324bce683) brought the fixes and host opt-ins that the areas above cite. 0.0.86 (lifeart/glimmer-next#270, 6b8675867f) cuts the memory a large render keeps; it needed no Ember change. 0.0.87 (lifeart/glimmer-next pull requests 272, 273 and 275 to 277; 3cdf8816b8) calls only the argument getters its compiler brands $_argThunk, any other function being the value: Ember brands the getters it builds (a6a2708cdf, 87415a4f58), and a custom-managed component calls only a branded function (b22f30a4f1). Its rows keyed by position could not take another array, collection or primitive, so Ember keyed key="@index" by identity (339631fc42) until 0.0.88. 0.0.88 (lifeart/glimmer-next#279, d6b90531fe) was made for this PR (below); it also releases the items of the rows an async keyed list removes. So was 0.0.89 (lifeart/glimmer-next#280, ac7c2beffb), which lets an Ember app ship less of gxt (below). Their compiler and runtime must be the same version; this repo uses the pin for both.

gxt 0.0.88 (on top)

2d93a41082 to 5449eb0d56; compat unless it says native.

  • Lists keyed by position (key="@index", and key="@key", now compiled alike; compat and native) keep their rows when reordered or replaced, each showing the item now at it (2d93a41082). What a row yields or invokes as <Item /> follows the item, also between a primitive and an object, and the components its block renders keep their instance and state (01ce29d920, fc34f389e8). In a kept row, a Glimmer component reads the new @item (a598fe1bf6), and a classic one gets it in the same render, each update hook once with the final arguments: when gxt reports kept rows, the sync reruns its argument pass, up to 8 times (6a75e8bb42, 9b76db31b3). Native installed gxt's item reference runtime in every app (49606e857d); since 9709996357, the templates that need it install it.
  • Native {{#each-in}} rows are keyed as Glimmer's, and a nested each-in's rows read the outer row's key and value (tests 05c144b887, 31eb0f21c8).
  • A function passed as an argument is the value: a helper's named argument, such as a (fn) result or an action (5f4ec016e2), a (hash) member (0f14a650b5), or an arrow a helper returns, passed positionally to a helper or a classic component (eaf61c36c6, 805a55af47). Only getters gxt's compiler brands are called; helper results lose their __isHelperResult mark.
  • Two-way arguments. A classic component writes a two-way bound argument where Glimmer's reference writes it, from the source gxt's compiler gives it (argSource; d9ed8c404a, arg-sources.ts): this.a.b to b of the current this.a, a block param's path to that path, a {{#let}} alias to its source, @x to where the caller's argument writes, in a Glimmer, template-only or classic component invoked by name or from a strict template's scope, even through a copy of its args (3ab3e47a2e, baa8b97f82, 93e03009b2, 5d4a2cba45). A literal, a helper's result or a block param itself writes nothing upstream, not the parent view's same-named property (fb59532860); an argument without a source, such as a curried component's, keeps the earlier guess (23a1dedf02).
  • A classic component's argument replaces a value the component set whenever its reference is updated, as in Glimmer (d6bc9f067a).
  • A classic component class in a strict template's scope, invoked or curried, with setComponentTemplate or only a layout, is a classic component with an instance, hooks and actions, not template-only: its manager is found up its prototype chain (7bbd3034f2, 5449eb0d56). Native throws its documented-drop error.

Tree-shaking and gxt 0.0.89 (on top)

a89865441e to 2063496034. They were reviewed in the fork as lifeart#33, lifeart#34 and lifeart#35, whose descriptions give each change in full. Together they change no test result and leave the classic dist as it was.

  • Native dist (a89865441e, 014efe6fce).
    • The rollup dist no longer emits the entries that compile templates to Glimmer wire format: ember-template-compiler, @ember/template-compiler/lib/*, -internal-primitives and @ember/-internals/glimmer. The package build already pruned them.
    • The package contract names them, so the Vite preset refuses them.
  • Item references (ac7c2beffb, the 0.0.89 pin; 9709996357, 8f64db08a2, 448ff0a4a6).
    • With gxt 0.0.89, a template that keys a list by position or renders {{#each-in}} imports the item reference runtime itself, so native no longer installs it in every app.
    • A lists app tests it.
  • Compat built from source (1a18f27dbf, 643f57db32, 2063496034).
    • The strict modern app rendered no route below its application template, and both of its <LinkTo>s linked to the last route. 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 lifeart/ember.js#34 gives the three causes.
    • Ember's own templates now compile at build time, with gxt 0.0.89's precompileTemplate option.
    • The render layer reads gxt's runtime compiler through a seam. Only the entries an app compiles templates through at runtime install it: @ember/template-compilation, @ember/template-compiler, …/runtime and ember-template-compiler. Without one of them, runtime compilation throws, naming them.
    • 9fcceeb350: the compat bridge imports gxt's argument-source helpers by name (865 bytes brotli in the compat strict app).

Known gaps and what is not supported

  • Server-side rendering. Neither flavor serializes for rehydration or rehydrates, and GXT cannot render into a SimpleDOM document (61 known reds). Compat's development assertion rejects a serialize or rehydrate _renderMode (errors); native does not check.
  • Compile-time validation. Glimmer's development-only template checks do not run under GXT, so a template that Glimmer rejects at compile time (keyword misuse, if / unless arity, named-block rules, strict-mode names not in scope) can compile and render wrong or empty output. A <foo.bar> whose head is not in scope fails at compile time in loose mode, as in Glimmer. In strict mode, where Glimmer renders an element named foo.bar, gxt compiles a dynamic invocation, so since edf90556fe it fails at render time (foo is not defined); compat threw at compile time before, when a space followed the tag. No test covers it.
  • Open compat gaps that need a gxt change. None is in a released gxt; feat(in-element): stream root-template nodes so in-element finds an earlier sibling lifeart/glimmer-next#274, an open draft, addresses the second.
    • A curried component rendered directly in an {{#if}} or {{#each}} body is rendered once; a changed value creates an instance that is never rendered.
    • A root template is built detached, so a lookup such as getElementById during render misses elements rendered before it.
    • A runtime-compiled template reads a plain object's member, such as {{this.person.name}}, as a plain property read that compat does not see, so writing it in the same render does not assert (the dynamic-components backtracking-message test). This needs gxt's cell-read hook (feat(host-hooks): DEV onCellRead seam for compat backtracking detection lifeart/glimmer-next#275, in 0.0.87, not used yet) and a runtime-compile flag that emits property taps in every runtime-compiled template.
  • Source sniffing left by the regex cleanup. Its fixes need gxt to emit more (getter path brands, (parent, key) pairs for {{mut}}, compile-time metadata) and wait for a gxt release:
    • Getters are read through their source (fn.toString()): the this. path a binding, content or attribute getter subscribes to when its first evaluation read no cell, the paths of (hash) and (array) members, the path in the dynamic-component error, and the {{mut}} write path, which can write the wrong property (flag for this.flag ? this.a : this.b).
    • Three regexes rewrite gxt's generated JavaScript: $_maybeHelper("name", …) lookups of scope names, the assertion against a resolved helper as a named argument, and a self-referencing {{#let}} in generated closures.
    • The fallback destinations of {{#in-element}} blocks are a stack consumed by position: a block that does not defer leaves its entry to the next one.
    • A component name with one-letter segments, such as {{component "x-y"}}, resolves as xy (gxt lowers it to $_tag('XY')), and a tag with -- is taken for a nested component (<my--el> as my/el).
    • Also left: the Element.prototype.addEventListener / removeEventListener patch that every compat app installs with {{on}}, and the 16 ms fallback DOM sync (setInterval).
  • Open compat gaps on the Ember side:
    • Custom modifiers install while their element is being built, before it is inserted; Glimmer installs them after the render transaction.
    • The destroyable of a curried (helper …) is never destroyed.
    • Compat makes a plain object's property reactive once a template reads it (gxt installs an accessor), so some updates render that Glimmer would skip, such as untracked items of a keyed {{#each}} whose key did not change.
    • About 15 eager reads of values Glimmer reads lazily or never remain: (hash) member paths, a route context's sibling getters, {{#each}} backing fields, and argument effects. An error there is reported in development (ember-gxt.dropped-read).
    • 36c200b5ce also records two reads Glimmer does not consume, so it can assert where Glimmer would not: an argument compat evaluates eagerly but no template uses (value=this.obj.x), and a JavaScript read through a tracking proxy in a tracking frame (a getter that reads this.args.obj.x). No test hits either.
    • Two code paths have no caller to throw to, so their errors are only reported in development: the fallback DOM sync every 16 ms, and a classic hook run by the sweep of unclaimed instances during an initial-render sync that no property change drove.
    • When a render throws, compat does not log Glimmer's development Error occurred message (1 test). When a component's construction throws, the elements rendered before it stay, but text and nested blocks do not.
    • One {{debugger}} test fails, "basic debugger statement" in its template-only variant: the {{#if}} keeps its false branch on the third render, so the callback runs twice, not three times (from the CI failure; cause not verified).
  • Compat known reds from main's tests of the fourth rebase (4):
    • "the render stack of a backtracking message starts with -top-level": a child's constructor writes a @tracked field that its Glimmer parent's template rendered ({{this.value}}) under a classic root, and compat does not assert: 36c200b5ce records only member reads through the tracking proxy of an object a template path returned.
    • "{{outlet}} in a component asserts": compat's own outlet machinery renders {{outlet}} in a component under any route instead of asserting below a non-classic route.
    • Two loose raw-block tests: the gxt compiler has no Handlebars raw blocks ({{{{raw}}}}…{{{{/raw}}}}).
  • Native known reds (12):
    • the argument-less-helper assertion;
    • the backtracking assertion in a modifier constructor, whose message differs;
    • Evented.detect;
    • the args proxy: a downstream change also re-renders the upstream component;
    • 8 contextual-component tests that main rewrote to a custom-managed component with positional arguments: native does not update a curried one's positional arguments (4), renders nothing for one given positional arguments as an argument (2), and resolves one invoked with arguments in a mustache as a helper (2).
  • Layout. Classic package source files gain 1,377 lines in 32 files, all in commit 4 and nearly all __GXT_MODE__-gated; 12 are in link-to.ts and textarea.ts (a3d525a815).
    • The four renderer files gain 267: base-renderer.ts +162, renderer.ts +65, templates/root.ts +29 and unwrap-template.ts +11. template-compiler's template.ts +16, route.ts +29 and router.ts +47.
    • The largest gated blocks left are in metal: tracked.ts (+231), property_events.ts (+140) and computed.ts (+125). They sit on hot paths (every set, @tracked access and computed-property cache miss), some run before gxt-backend is installed, and they share module-local state with classic code, so a bridge hook would add a dispatch and still need a fallback.
    • Also left in place: inline forks in metal's property_set.ts, tags.ts and properties.ts; the router's stashParamNames and outlet-update skip, which use router locals; the run loop's flush budget, afterRender wrapper and end-of-loop sync (+71); and small hooks in environment.ts, helpers/element.ts, object/core.ts, promise-proxy-mixin.ts, application/instance.ts and the classic route manager.
    • One leftover stays: the side-effect-only import of @glimmer/manager in templates/root.ts. Removing it would not change the classic prod dist but breaks the native rollup build with a circular dependency.

Dependencies

  • @lifeart/gxt 0.0.89, exact pin, published. The branch has consumed 0.0.82 to 0.0.89 (lifeart/glimmer-next pull requests 265 to 270, 272, 273, 275 to 277, 279 and 280, all merged). The compiler and the runtime must be the same version; this repo uses the pin for both. gxt is pinned once, as a root package.json devDependency, plus the smoke-tests/v2-app-gxt-template fixture. CI installs it from npm. The GXT upstream contract job checks that the 94 named imports gxt-backend/ takes from gxt exist in it, across 5 entry points.
  • New dev dependencies: playwright ^1.59.1 and rollup-plugin-visualizer ^7.0.1. The rollup range moves from ^4.57.1 to ^4.60.2, with no lock change: main's override still resolves 4.61.0. The lockfile changes by +294 / −0 lines.

CI

On emberjs/ember.js, only PR Title Lint runs without approval (as for the head), so the results above come from the fork, lifeart/ember.js:

The workflows:

  • CI (classic): the jobs are unchanged; the two emberSourceGxt smoke scenarios build the compat package first.
  • GXT Smoke (pull requests): the upstream contract check, and 14 compat modules in 4 shards, each gated by baseline-gate.mjs --subset.
  • GXT dual-build matrix (pull requests): rollup builds of classic, gxt and gxt-native, bundle-size-check (5 % over budget, and live GXT bridge calls in classic) and assert-native-dist.
  • GXT native (pull requests): the modern app from the classic and native dists, strict, loose and lists (boot checks, VM-free assertion, bytes); the strict app built from source on the compat build, which must ship no template compiler, and the loose one, which compiles at runtime; the native package and its consumer; the native suite in 4 shards, merged and gated.
  • GXT Full (nightly): the compat full suite in 5 shards, merged and gated, on schedule or dispatch only; it files an issue when the gate fails.

Baseline gating. runner.mjs exits 1 whenever any test fails, known reds included, so it cannot be the verdict alone. baseline-gate.mjs passes when there are no timeouts and no harness errors, every module in the baseline ran, every failing test is listed as failing in the baseline, and the runner wrote its summary. Known reds that start passing are reported, with a prompt to regenerate the baseline, and never fail the gate.

How to review

The diff against main (9ed291512e) is 336 files, +104,445 / −1,023. Of the added lines, 13,950 are the two baseline JSON files and 294 are the lockfile.

The 8 commits, in review order:

  1. c483488bf3 build and tooling for the GXT render backends (20 files): Vite, rollup and babel flavors, the alias map and the native forbidden list (scripts/gxt-alias-map.mjs), build constants, the gxt pin, the lockfile, bundle budgets, and the lint and type-check settings for the GXT trees.
  2. 6dbb0aa07b the GXT compat backend (78 files): gxt-backend/ without native/, including the glimmer host modules, the code moved out of template-compiler, routing, metal and views utils, @glimmer/component-gxt, the backend's own tests, the 5 compat fixes of the third rebase, the compat adaptations of the fourth, and the compat commits that were on top.
  3. e6419bc44e the native layer and its package (101 files): gxt-backend/native/, the package script and Vite preset, assert-native-dist, the modern-app harness, the 4 native fixes of the third rebase, the native adaptations of the fourth, and the native commits that were on top, with the lists app.
  4. eebc98319f GXT hooks in the classic packages (32 files): every change to classic package source. Each hunk is __GXT_MODE__-gated code or a GXT-only declaration, apart from the {{debugger}} callback move and the one leftover import listed under known gaps.
  5. da34f59081 test infrastructure for the GXT backends (32 files): the runner, shard merge and baseline gate, index.html / native.html, internal-test-helpers, and the integration-tests GXT delegate.
  6. 05cfbefc93 GXT-specific tests and test changes (45 files), with the test adaptations of the fourth and fifth rebases and the tests of the commits that were on top.
  7. e0d65cb757 GXT workflows, smoke apps and scenarios (25 files).
  8. ac0da0739c test baselines and the packaging design doc (3 files).

Folded in with the second squash, in this order (on gxt-pre-squash2-2063496034):

  • b7c0a33d7e, 3bc96e9594 and 36c200b5ce, three fixes, and 9aa85d7f5a, the baselines;
  • 4e081d060f to 216664fba9, the 19 commits of the regex cleanup, in three groups, each with its tests first;
  • 701ca09d7f and 2e5f4528fe, from the fifth rebase;
  • dbb569597b and 8485e27bad, the memory changes, and 34b7d8b827, the baselines;
  • 3cdf8816b8 to b22f30a4f1, gxt 0.0.87: its pin and 4 adaptations, and 6bbc52f7d7, the baselines;
  • 2d93a41082 to d6b90531fe, gxt 0.0.88: 36 commits ending with its pin, and 5b8170e746, the baselines;
  • a89865441e to 2063496034, tree-shaking and gxt 0.0.89: 10 commits, with its pin ac7c2beffb.

Only the trees named under CI were built and tested for these numbers; the PR is meant to be reviewed and merged whole, and earlier commits may not build on their own.

Suggested order:

  1. Classic risk. Commit 4 holds every change to classic package source.
    • The larger gated blocks are in metal/lib/tracked.ts, property_events.ts and computed.ts, runloop/index.ts, components/abstract-input.ts, object/core.ts and routing/router.ts. application/instance.ts is main's visit() code apart from the GXT assertion.
  2. What each flavor resolves to. Commit 1: rollup.config.mjs, vite.config.mjs and scripts/gxt-alias-map.mjs.
  3. The native layer. Commit 3, about 6.7K lines of non-test source. This is the smaller design and the long-term direction.
  4. The compat backend. Commit 2, about 47.6K lines of non-test source, including the 3.3K lines moved out of the renderer files and the 0.6K moved out of template-compiler, routing, metal and views utils after the squash. compile.ts and manager.ts (about 14.4K and 14.9K lines) are most of it; read them by their section headers. The template transforms are in ast-transforms.ts.
  5. Tests and CI. Commits 5–8. The per-fix commits, each with its root cause, are on the history branches at the top, cited by area in what the 8 commits contain.

Run locally

# dists (classic is the default) and their checks
npx rollup --config rollup.config.mjs
EMBER_RENDER_BACKEND=gxt npx rollup --config rollup.config.mjs
EMBER_RENDER_BACKEND=gxt-native npx rollup --config rollup.config.mjs
node scripts/bundle-size-check.mjs <classic|gxt|gxt-native>
node scripts/assert-native-dist.mjs --dist dist  # after the gxt-native build

# compat test page (index.html) and the gate
GXT_MODE=true pnpm vite --port 5180
node scripts/gxt-test-runner/runner.mjs --full --baseline test-results/gxt-baseline.json; \
  node scripts/gxt-test-runner/baseline-gate.mjs --baseline test-results/gxt-baseline.json --runner-exit $?

# native test page (native.html) and the gate
EMBER_RENDER_BACKEND=gxt-native pnpm vite --port 5181
node scripts/gxt-test-runner/runner.mjs --full --url http://localhost:5181/native.html --min-modules 5 \
  --baseline test-results/native-baseline.json; \
  node scripts/gxt-test-runner/baseline-gate.mjs --baseline test-results/native-baseline.json --runner-exit $?

# modern app from the dists: bytes, boot checks, VM-free assertion
node scripts/bundle-modern-app.mjs --from-dist --build-dists --boot --assert-native
node scripts/bundle-modern-app.mjs --from-dist --flavor loose --boot --assert-native
node scripts/bundle-modern-app.mjs --from-dist --flavor lists --boot --assert-native

# modern app built from source on the compat build
node scripts/bundle-modern-app.mjs --variants gxt --boot --assert-no-runtime-compiler
node scripts/bundle-modern-app.mjs --variants gxt --flavor loose --boot

# the native package and a consumer app outside the repo
node scripts/build-gxt-native-package.mjs --pack <dir>
npm pack @lifeart/gxt@0.0.89 --pack-destination <dir>
node smoke-tests/gxt-native-package/run.mjs --app <dir outside the repo> \
  --package <dir>/ember-source-gxt-native-*.tgz --gxt <dir>/lifeart-gxt-0.0.89.tgz --dev --no-typescript

The runner also accepts --smoke (the 14 CI modules, gated with --subset), --shard i/N, --filter <text> and --auto-serve; see scripts/gxt-test-runner/README.md.

Backwards compatibility and risk

  • No public API change; classic is the default, with gated hooks, the same suite results and passing type checks (summary, tests).
  • Classic dists are not byte-identical to main's. Measured on e4f2cd0e6d against main 493985e956 (run 42054852136, which builds the classic dists of main, main plus commit 1 and that head, and compares their lines with chunk names normalized); not re-run on 9ed291512e. The head's classic prod tree differs from e4f2cd0e6d's only in the two files that hold main's new deprecation (dual-build runs 42054851974, 42174105115, 43401373472, 44070180507, 44258818222 and 44477554379). On e4f2cd0e6d:
    • This PR's rollup config strips non-license comments from every production dist (shouldPrintComment), so the prod tree is compared with main built with commit 1 only, which adds that rule and leaves the dev tree's lines unchanged: 1,206,007 bytes raw and 204,064 brotli, against this PR's 1,205,816 and 203,993.
    • Its code is main's plus two changes: the {{debugger}} callback module (cc5b59558c), from which the opcode reads the callback (getDebuggerCallback()), which is intended, and one alias line, const template = templateFactory;, because an ES module cannot re-export a binding conditionally. The other differences are import and export lines: GXT-only static imports in metal change the module graph, so Rollup puts metal's chain-tags module in the observers chunk (92 shared chunks instead of 93).
    • The classic dev tree is 5,349 bytes (raw) larger than main's: the same code differences, an empty statement left by a folded __GXT_MODE__ gate in ComponentRootState, GXT comments in kept code, and @ember/component docs that main's dev tree does not have.
  • No new runtime dependency for ember-source (build and packaging).
  • Both GXT flavors are previews and are not covered by SemVer. For classic apps the risk is limited to the build-time folding of the gated hooks, the comment stripping, the alias line and chunk layout above, and the moved {{debugger}} callback state. For apps that opt in, the risk is that of a preview, with the gaps listed above.

🤖 Generated with Claude Code

@lifeart lifeart changed the title [experiment]: Demo app for glimmer-next renderer [FEATURE glimmer-next-demo] Demo app for glimmer-next renderer Apr 25, 2026
lifeart added a commit to lifeart/ember.js that referenced this pull request May 5, 2026
The $_dc_ember dynamic-component path tracks the rendered Ember instance
via __gxtDcCaptureCallback so that swap-outs (`{{component this.name}}`
when this.name changes) can fire willDestroy on the previous instance.

That callback was only invoked from renderClassicComponent. If the
resolved class went down the glimmerish branch
(renderGlimmerComponent — tagless/Glimmer.Component shapes), the
callback never fired and _dcEmberInstance stayed null, so
destroyCurrentDcInstance() short-circuited at swap time and the
previous instance never got its willDestroy hook.

Cumulative-state symptom (PR emberjs#21340): "component helper destroys
underlying component when it is swapped out" asserts
`{ 'foo-bar': 1, 'foo-bar-baz': 0 }` after the first swap but observes
`{ 'foo-bar': 0, ... }`. The classic-componentTemplate path resolves
foo-bar through renderGlimmerComponent in some cumulative-state code
paths (likely after pool reuse / stale state).

Fix: mirror the callback fire+clear from renderClassicComponent into
renderGlimmerComponent. setInstanceCapture (stack-based) is already
called above; this adds the global-callback path used by $_dc_ember.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lifeart added a commit to lifeart/ember.js that referenced this pull request May 7, 2026
The 8 _gxtEffect(...) call sites in gxt-backend/manager.ts each install a
GXT formula (sourceTag + tag + opcode) but ignored the cleanup function
returned by effect(). When a component instance / DOM element was torn
down between tests, those formulas stayed live in the global formula
tracker. Across hundreds of cumulative tests, leaked formulas
accumulated.

The leak surface explains the cumulative-state cascade observed in PR
emberjs#21340: a single @tracked-property dirty in the failing test propagated
to every leaked formula, each of which re-evaluated its closure
(re-reading `get person`, which constructs a fresh Person and dirties
five more tags), saturating the main thread with __gxtExternalSchedule
calls (493k+ in 10 minutes) and starving the 16ms interval-fallback sync.

Wrap each call site with `_gxtEffectWithOwner(owner, cb)`, which:
  * Calls _gxtEffect(cb) and captures its cleanup.
  * Increments / decrements globalThis.__gxtActiveEffectCount (a
    diagnostic counter — useful for catching future leaks via
    QUnit.testDone instrumentation; cost is one ++/-- per effect).
  * Registers the cleanup on the owning destroyable via
    ./destroyable.registerDestructor, so when Ember tears down the
    component / element the formula's sourceTag, tag, and opcode all
    destruct, releasing the formula tracker entry.

Owner mapping per call site:
  * manager.ts:1593 (createComponentInstance arg-cell effect) -> instance
  * manager.ts:2369 (updateInstanceWithNewArgs arg-cell effect) -> instance
  * manager.ts:5627 (createRenderContext path 4) -> instance || renderContext
  * manager.ts:5748 (createRenderContext path 3) -> instance || renderContext
  * manager.ts:9467 (renderCustomElement modifier ON_CREATED) -> el
  * manager.ts:9742 (renderLinkToElement modifier ON_CREATED) -> instance || el
  * manager.ts:10451 (Input/Textarea modifier ON_CREATED) -> instance || el
  * manager.ts:10879 (renderClassicComponent wrapper ON_CREATED) -> instance || wrapper

Verification:
  * Component Tracked Properties module-isolation: 17/17 (no regression).
  * Smoke suite (14 modules / 333 tests): 333/333 PASS.
  * Diagnostic short repro (chromium loading just the Component Tracked
    Properties module): __gxtActiveEffectCount is now stable at 2 across
    13 consecutive testDone events including the previously cascading
    "tracked properties rerender when updated outside of a runloop" test
    (was: count grew unboundedly per testDone before fix).

The compile.ts:8165 site is intentionally not patched here: that
reference to _gxtEffect is currently a free identifier wrapped in
try/catch (silent ReferenceError), so it never installs a leaking
effect in practice.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lifeart added a commit to lifeart/ember.js that referenced this pull request May 23, 2026
…dlers + lower-footprint args

Prevents the laptop-freeze observed during parallel agent test runs: each runner
spawned 1 chromium + ~8 child processes, and concurrent runs accumulated 17+
chrome-headless-shell at 55%+ CPU each. Symptom captured in PR emberjs#21340 session.

Additions:
- Lockfile at /tmp/gxt-test-runner.lock — refuses concurrent runs (with stale-pid detection)
- SIGINT/SIGTERM/SIGHUP handlers + uncaughtException handler — guaranteed browser.close()
- Idempotent cleanup() helper via cleanupRan flag
- Lower-footprint chromium args: --disable-gpu, --disable-extensions, --disable-audio-output,
  --disable-software-rasterizer, --no-sandbox, --disable-features=...IsolateOrigins,
  site-per-process

Default behavior unchanged for single-runner invocations. Concurrent runs now refuse
to start instead of compounding resource exhaustion.
@lifeart
lifeart force-pushed the glimmer-next-fresh branch 3 times, most recently from 109ea71 to 99f0b68 Compare June 11, 2026 03:53
lifeart added a commit to lifeart/ember.js that referenced this pull request Jun 11, 2026
…machinery

Closes the @glimmer/component import-identity fork on the GXT side (PR
emberjs#21340 Known-limitations bullet) with the documented Option-2 fallback,
while leaving protocol extraction as the committed Option-1 target.

- packages/@glimmer/component-gxt/: workspace-private sibling. `.` re-exports
  @glimmer/component 2.x's public surface (default Component); `./reactive`
  re-exports createTag/CURRENT_TAG/tracked/cached/createCache/getValue from
  the @ember/-internals/gxt-backend shims so its reactive symbols are
  identity-equal with the GXT build (not a second copy). Thin re-export, not
  reimplementation. Excluded from the root tsconfig like the gxt-backend
  shims (specifiers resolve only under the GXT rollup alias map); own
  tsconfig + ambient .d.ts keep it independently type-checkable.
- identity test (__tests__/identity.test.ts) + demo vitest config: asserts
  === between symbols reached through @glimmer/component-gxt and through the
  shims, and demonstrates the fork by showing they differ from the classic
  @glimmer/validator copy.
- scripts/ember-cli-gxt.mjs: `enable` now runs the import-identity guard
  (scans package.json deps + optional app-source grep, excluding the -gxt
  sibling) and refuses with the RFC-mandated message + non-zero exit on a
  direct @glimmer/component; `status` reports guard state. Self-contained node.
- RFC §6: records the fallback as implemented/tested in-repo, notes real
  shipping still needs the ember-source-gxt packaging from §5.5.

Gates (light gate: new files + script + tsconfig exclude; no gxt-backend
runtime source touched): root `tsc --noEmit` 22/22 unchanged; package-local
tsc clean; identity test 4/4; ember-cli-gxt status/enable-refusal/clean-enable
node-smoked.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lifeart added a commit to lifeart/ember.js that referenced this pull request Jun 11, 2026
… outcome)

Addresses the last open Known-limitations bullet of PR emberjs#21340: the
FastBoot/SSR pipeline blockers.

Phase 4.1 (root-context isolation in gxt-backend/compile.ts): mapped every
piece of root-scoped singleton state and classified (a)/(b)/(c). Outcome is
analysis-only, not a refactor. The genuinely root-scoped state in compile.ts
(_gxtRootContext, _gxtTopOutletRef, _gxtEngineInstances) is a thin,
already-bridged layer, but the real "one root" boundary -- GXT's module-global
node counter, rehydration stack, and setupGlobalScope -- lives in upstream
@lifeart/gxt and cannot be isolated from compile.ts. Threading N roots through
compile.ts while the upstream counter stays global would be cosmetic and
regression-prone on the backend's most load-bearing file. Documented the
smallest correct shape (upstream seedable counter + a synchronous
withRootContext swap API) for when an SSR driver exists.

Phase 4.2 (nested-engine outlet cursor-ID translation): located the lossy
point -- GxtPartialRehydrationDelegate re-renders the sub-tree from scratch
(innerHTML='') because GXT's node counter exposes only resetNodeCounter()
(reset to 0), with no setNodeCounter(n) seed, so a mid-tree boundary cannot
resume the parent's counter namespace on the client. Documented the fix shape
(upstream seedable counter + boundary base-offset in withRehydration; delegate
reads the boundary data-node-id).

No code change; documentation-only, so the full GXT gate is not triggered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lifeart lifeart changed the title [FEATURE glimmer-next-demo] Demo app for glimmer-next renderer [FEATURE gxt-dual-backend] GXT dual-backend rendering (opt-in preview) Jun 11, 2026
@lifeart
lifeart force-pushed the glimmer-next-fresh branch 2 times, most recently from 96acc59 to e401aaa Compare June 12, 2026 12:10
@NullVoxPopuli

Copy link
Copy Markdown
Contributor

📊 Size report

Tarball size — 1.2 MB → 1.3 MB

dist/dev   3%↑

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 2.1 MB / 491.9 kB 3%↑2.1 MB / 4%↑513.4 kB
Show files (29 files)
File Before (Size / Brotli) After (Size / Brotli)
./packages/@ember/-internals/glimmer/index.js 2.2 kB / 680 B 189%↑6.3 kB / 197%↑2 kB
./packages/@ember/-internals/views/lib/system/utils.js 4.9 kB / 1.3 kB 27%↑6.2 kB / 29%↑1.7 kB
./packages/@ember/array/proxy.js 10.5 kB / 2.6 kB 3%↑10.9 kB / 4%↑2.7 kB
./packages/@ember/component/index.js 44.4 kB / 10.2 kB 2%↑45.4 kB / 4%↑10.6 kB
./packages/@ember/object/core.js 31.9 kB / 7.8 kB 19%↑37.9 kB / 23%↑9.5 kB
./packages/@ember/object/promise-proxy-mixin.js 3.6 kB / 1.2 kB 35%↑4.9 kB / 33%↑1.5 kB
./packages/@ember/routing/route.js 59.6 kB / 13.2 kB 0.7%↑60 kB / 0.9%↑13.3 kB
./packages/@ember/routing/router.js 52 kB / 11.7 kB 2%↑52.9 kB / 2%↑12 kB
./packages/@ember/template-compiler/lib/template.js 8.9 kB / 2.4 kB -73%↓2.4 kB / -67.2%↓802 B
./packages/@glimmer/manager/index.js 1 kB / 296 B 54%↑1.6 kB / 77%↑524 B
./packages/@glimmer/reference/index.js 5.8 kB / 1.7 kB -90.1%↓579 B / -85.3%↓251 B
./packages/@glimmer/validator/index.js 1.6 kB / 614 B 50%↑2.3 kB / 38%↑847 B
./packages/shared-chunks/api-{hash}.js 10 kB / 2.1 kB 147%↑24.8 kB / 156%↑5.4 kB
./packages/shared-chunks/chain-tags-DeS1LfvJ.js 7.6 kB / 2.2 kB —
./packages/shared-chunks/computed-{hash}.js 34 kB / 7.9 kB 19%↑40.5 kB / 24%↑9.8 kB
./packages/shared-chunks/curly-{hash}.js 21.5 kB / 5.1 kB 14%↑24.5 kB / 14%↑5.8 kB
./packages/shared-chunks/element-{hash}.js 3.3 kB / 1.1 kB 27%↑4.2 kB / 30%↑1.4 kB
./packages/shared-chunks/gxt-bridge-B1C5ZBct.js — 4.4 kB / 1.5 kB
./packages/shared-chunks/index-{hash}.js 78.5 kB / 19 kB 21%↑94.7 kB / 27%↑24.1 kB
./packages/shared-chunks/internal-{hash}.js 4.2 kB / 1.3 kB 21%↑5.1 kB / 25%↑1.7 kB
./packages/shared-chunks/iterable-CrV7najk.js — 5.3 kB / 1.6 kB
./packages/shared-chunks/observers-{hash}.js 6.8 kB / 1.6 kB 128%↑15.5 kB / 158%↑4 kB
./packages/shared-chunks/property_set-{hash}.js 4.3 kB / 1.4 kB 38%↑6 kB / 44%↑2 kB
./packages/shared-chunks/setup-{hash}.js 2.8 kB / 907 B 716%↑22.6 kB / 624%↑6.6 kB
./packages/shared-chunks/template-{hash}.js 491 B / 203 B 118%↑1.1 kB / 98%↑401 B
./packages/shared-chunks/textarea-{hash}.js 14.5 kB / 3.5 kB 8%↑15.7 kB / 10%↑3.9 kB
./packages/shared-chunks/tracked-{hash}.js 6 kB / 1.8 kB 52%↑9.2 kB / 54%↑2.8 kB
./packages/shared-chunks/tracked-data-C-M4hkW8.js 841 B / 374 B —
./packages/shared-chunks/unrecognized-{hash}.js 17.6 kB / 4.4 kB -0.64%↓17.5 kB / -0.38%↓4.4 kB

dist/prod   3%↑

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 1.9 MB / 450 kB 3%↑2 MB / 4%↑469.7 kB
Show files (28 files)
File Before (Size / Brotli) After (Size / Brotli)
./packages/@ember/-internals/glimmer/index.js 2.1 kB / 669 B 193%↑6.2 kB / 200%↑2 kB
./packages/@ember/-internals/views/lib/system/utils.js 4.6 kB / 1.2 kB 28%↑5.9 kB / 30%↑1.6 kB
./packages/@ember/array/proxy.js 9 kB / 2.2 kB 4%↑9.3 kB / 4%↑2.3 kB
./packages/@ember/component/index.js 40.2 kB / 9.4 kB 2%↑41.1 kB / 3%↑9.7 kB
./packages/@ember/object/core.js 26.1 kB / 6.4 kB 8%↑28.2 kB / 13%↑7.2 kB
./packages/@ember/object/promise-proxy-mixin.js 3.6 kB / 1.2 kB 35%↑4.9 kB / 33%↑1.5 kB
./packages/@ember/routing/route.js 54.1 kB / 12 kB 0.6%↑54.5 kB / 1%↑12.1 kB
./packages/@ember/routing/router.js 44.1 kB / 10.2 kB 2%↑45 kB / 3%↑10.5 kB
./packages/@ember/template-compiler/lib/template.js 8.9 kB / 2.4 kB -73%↓2.4 kB / -67.2%↓802 B
./packages/@glimmer/manager/index.js 1 kB / 297 B 54%↑1.6 kB / 76%↑522 B
./packages/@glimmer/reference/index.js 5.7 kB / 1.7 kB -89.9%↓579 B / -84.9%↓250 B
./packages/@glimmer/validator/index.js 1.7 kB / 668 B 46%↑2.4 kB / 29%↑865 B
./packages/shared-chunks/api-{hash}.js 24.3 kB / 5.3 kB -75.5%↓5.9 kB / -72.6%↓1.5 kB
./packages/shared-chunks/chain-tags-xANM849e.js 6.9 kB / 2 kB —
./packages/shared-chunks/computed-{hash}.js 28 kB / 6.6 kB 25%↑35 kB / 31%↑8.6 kB
./packages/shared-chunks/curly-{hash}.js 17.2 kB / 4.3 kB 17%↑20.2 kB / 16%↑5 kB
./packages/shared-chunks/element-{hash}.js 2.7 kB / 915 B 34%↑3.6 kB / 36%↑1.2 kB
./packages/shared-chunks/gxt-bridge-B1C5ZBct.js — 4.4 kB / 1.5 kB
./packages/shared-chunks/index-{hash}.js 66.4 kB / 16.3 kB 24%↑82.4 kB / 31%↑21.2 kB
./packages/shared-chunks/internal-{hash}.js 3.8 kB / 1.2 kB 5%↑4 kB / 4%↑1.3 kB
./packages/shared-chunks/iterable-CKueMdcC.js — 5.2 kB / 1.5 kB
./packages/shared-chunks/observers-{hash}.js 6.8 kB / 1.6 kB 118%↑14.8 kB / 145%↑3.8 kB
./packages/shared-chunks/property_set-{hash}.js 3 kB / 980 B 37%↑4 kB / 40%↑1.4 kB
./packages/shared-chunks/setup-{hash}.js 2.6 kB / 861 B 762%↑22.3 kB / 654%↑6.5 kB
./packages/shared-chunks/textarea-{hash}.js 12.5 kB / 3.2 kB 10%↑13.7 kB / 11%↑3.5 kB
./packages/shared-chunks/tracked-data-BBQSEQ2o.js 841 B / 377 B —
./packages/shared-chunks/tracked-{hash}.js 3.8 kB / 1.2 kB 70%↑6.4 kB / 69%↑2.1 kB
./packages/shared-chunks/unrecognized-{hash}.js 17.1 kB / 4.4 kB -0.65%↓17 kB / -0.37%↓4.3 kB

smoke-tests/v2-app-template/dist   2%↑

File Before (Size / Brotli) After (Size / Brotli)
./assets/main-{hash}.js 312.4 kB / 83.6 kB 4%↑324.3 kB / 4%↑86.7 kB
./assets/modules-{hash}.js 33.9 kB / 10.2 kB -14.4%↓29 kB / -10.8%↓9.1 kB
Total (Includes all files) 347.8 kB / 94.5 kB 2%↑354.8 kB / 2%↑96.5 kB

smoke-tests/v2-app-hello-world-template/dist   3%↑

File Before (Size / Brotli) After (Size / Brotli)
./assets/main-{hash}.js 158.7 kB / 43.6 kB 3%↑163 kB / 3%↑45.1 kB
Total (Includes all files) 159.1 kB / 43.8 kB 3%↑163.3 kB / 3%↑45.2 kB

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

lifeart added a commit to lifeart/glimmer-next that referenced this pull request Jun 12, 2026
The vite compiler plugin's .ts/.js content sniff (/hbs\s*`/) false-positived
on doc-comment prose containing the byte sequence hbs-backtick — e.g.
"components were authored in paired `.hbs` and `.js` files", where the
closing backtick of the inline-code span follows "hbs" directly. The plugin
then routed the entire module through the template transform and mangled its
exports (emberjs/ember.js#21340: "FunctionBasedHelper is not exported" broke
the GXT vite build on the PR merge ref after an upstream api-docs sweep).

The sniff now requires a genuine tag position via negative lookbehind
(excluding `.hbs`, 'hbs', "hbs", `hbs and identifier tails like stubhbs`),
extracted as hasHbsTaggedTemplate() with unit coverage.

Gates: tsc clean, vitest full suite green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Jun 13, 2026
…integration APIs (#222)

* feat(host): registerHostHooks() formal host-integration API

Replaces the optional globalThis.__gxt* extension slots with module-local
hook slots behind an explicit registration API (HOST_HOOKS table). Covered
hooks: toBool, scheduleRevalidate (__gxtExternalSchedule), registerListMarker,
rebindEachItem, registerObjectValueOwner, getCurrentTemplateThis,
isFunctionalHelper/markFunctionalHelper (the EmberFunctionalHelpers Set), and
dynamicEval (the globalThis.$_eval fallback). Every runtime call site reads
the hook slot first and falls back to the historical global, so hosts running
the legacy wiring keep working unchanged (no lockstep upgrade).

Gates: tsc clean, vitest 3817/3817, qunit 1219/0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(host): registerHostManagers() formal manager-registration API

Companion to registerHostHooks: replaces the legacy contract of hunting down
the module-original $_MANAGERS object reference (bridge accessors + deferred
microtask retries on the host side) and mutating it from outside. The
function lives in the same module instance the runtime call sites close
over, so registration always reaches the canonical table regardless of how
the host resolved the package — no object-identity hazards. Slots are
replaced wholesale (hosts carry extra private state on their manager
objects).

Gates: tsc clean, vitest 3819/3819, qunit 1219/0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(compiler): don't treat hbs-extension prose as a tagged template

The vite compiler plugin's .ts/.js content sniff (/hbs\s*`/) false-positived
on doc-comment prose containing the byte sequence hbs-backtick — e.g.
"components were authored in paired `.hbs` and `.js` files", where the
closing backtick of the inline-code span follows "hbs" directly. The plugin
then routed the entire module through the template transform and mangled its
exports (emberjs/ember.js#21340: "FunctionBasedHelper is not exported" broke
the GXT vite build on the PR merge ref after an upstream api-docs sweep).

The sniff now requires a genuine tag position via negative lookbehind
(excluding `.hbs`, 'hbs', "hbs", `hbs and identifier tails like stubhbs`),
extracted as hasHbsTaggedTemplate() with unit coverage.

Gates: tsc clean, vitest full suite green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Jun 13, 2026
…228)

Two independent regressions shipped in 0.0.66 broke the Ember dual-backend
integration (emberjs/ember.js#21340). Both root-caused by bisect against the
Ember GXT suite (each: 266 fail, Helpers: 666 fail under 0.0.66; 0/0 here).

1. Frame mode (#226) wrongly engaged for Ember hosts. frameHostHooksInstalled()
   detected the host via three globalThis.__gxt* slots, but the Ember
   integration migrated exactly those channels off globalThis into
   registerHostHooks (HOST_HOOKS module-local table). Worse, HOST_HOOKS is
   duplicated across entry chunks, so even a direct HOST_HOOKS probe from the
   frame-gate chunk sees an empty copy. Fix: registerHostHooks sets a single
   cross-instance globalThis sentinel (__gxtHostHooksInstalled) — restoring the
   cross-module-instance visibility the legacy __gxt* slots had — and
   frameHostHooksInstalled checks it (plus the legacy slots for pre-API hosts).
   Frame mode stays ON for standalone consumers; Ember bails to v1.

2. The drain-overhead diet (#227) broke the Ember formula-bridge reactivity
   (stale values, wrong arg order) despite its "semantics unchanged" claim.
   Reverted pending a re-attempt with the Ember integration suite as a gate —
   it was a modest constant-factor refactor, no functional dependency.

Validated against the full Ember GXT suite (both probes and gates): the six
affected suites (each/Helpers/dynamic-component/strict-mode/engine/rehydration)
return to 0 failures. gxt's own suite: 3905 functional tests pass.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Jun 15, 2026
Two independent regressions shipped in 0.0.66 broke the Ember dual-backend
integration (emberjs/ember.js#21340). Both root-caused by bisect against the
Ember GXT suite (each: 266 fail, Helpers: 666 fail under 0.0.66; 0/0 here).

1. Frame mode (#226) wrongly engaged for Ember hosts. frameHostHooksInstalled()
   detected the host via three globalThis.__gxt* slots, but the Ember
   integration migrated exactly those channels off globalThis into
   registerHostHooks (HOST_HOOKS module-local table). Worse, HOST_HOOKS is
   duplicated across entry chunks, so even a direct HOST_HOOKS probe from the
   frame-gate chunk sees an empty copy. Fix: registerHostHooks sets a single
   cross-instance globalThis sentinel (__gxtHostHooksInstalled) — restoring the
   cross-module-instance visibility the legacy __gxt* slots had — and
   frameHostHooksInstalled checks it (plus the legacy slots for pre-API hosts).
   Frame mode stays ON for standalone consumers; Ember bails to v1.

2. The drain-overhead diet (#227) broke the Ember formula-bridge reactivity
   (stale values, wrong arg order) despite its "semantics unchanged" claim.
   Reverted pending a re-attempt with the Ember integration suite as a gate —
   it was a modest constant-factor refactor, no functional dependency.

Validated against the full Ember GXT suite (both probes and gates): the six
affected suites (each/Helpers/dynamic-component/strict-mode/engine/rehydration)
return to 0 failures. gxt's own suite: 3905 functional tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lifeart
lifeart force-pushed the glimmer-next-fresh branch from 78a9661 to bfee346 Compare July 4, 2026 10:11
@lifeart
lifeart force-pushed the glimmer-next-fresh branch from 68874e5 to 8679ee1 Compare October 13, 2026 09:08
@lifeart
lifeart force-pushed the glimmer-next-fresh branch from bc3fda9 to 2d71e91 Compare October 25, 2026 14:49
@lifeart
lifeart force-pushed the glimmer-next-fresh branch from 5d48546 to e4f2cd0 Compare November 6, 2026 01:43
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
In the Ember dialect a component's named args are emitted as
`$_args({ key: () => value }, …)`, where reactive values are zero-arg
getters the arg-access layer (ArgProxyHandler / the DEV $_args getter)
invokes on read. The layer historically invoked ANY function-valued arg,
so it could not tell a compiler-emitted reactive getter apart from a
function that is itself the arg value — a host-forwarded action or a
{{fn}}/helper bound result. Those got invoked on every read
(emberjs/ember.js#21340, "Components test: contextual components ::
renders with dot path and updates attributes": 4/8/15/22 instead of
1/1/2/3).

The compiler now wraps the reactive getters it emits in buildArgsObject
with `$_argThunk`, and the arg layer invokes ONLY branded thunks; every
other function value passes through unchanged. The marker is a plain
string-keyed property (like `$_nt`), minification-proof; `isArgThunk` is
exported so a host can retire its `fn.length`/`fn.prototype` shape
heuristic.

Gated to the Ember dialect (WITH_EMBER_INTEGRATION + IS_GLIMMER_COMPAT_MODE):
that is the only layer that forwards bare function values into gxt args,
so standalone gxt keeps byte-identical codegen and its
invoke-every-getter arg semantics.

- src/core/dom.ts: $_argThunk / isArgThunk; brand-only invocation in
  ArgProxyHandler + the DEV $_args getter (gated).
- compiler: emit $_argThunk around reactive arg getters (reactiveGetter /
  zero-arg arrow / $__cached memoized getter) in buildArgsObject.
- register ARG_THUNK in both symbol registries, GXT_RUNTIME_SYMBOLS.
- tests: emission + gate + runtime predicate + AOT auto-import guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
A dynamic modifier whose name is a `this.*` path was emitted as a plain
member read (`$s.dyn`). On an EmberObject with a non-@Tracked `dyn` that
read taps no tag, so the modifier formula is treated as const and a later
`set(ctx, 'dyn', X)` never re-installs the modifier — it is never
destroyed/created. Under EMBER_PROPERTY_TAGS the modifier-name path now
goes through the same `$__tag(obj, "key")` chain as a value path
(buildPathExpression → buildEmberMemberChain), so resolution is reactive.
Standalone keeps the plain read.

Unblocks the native emberjs/ember.js#21340 test "Basic Custom Modifier
Manager: 3.22 :: destroys a dynamic modifier that was set after the
initial render".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
The compiler reduced a thrown parse error to a one-line `message`
(`parseError.message.split('\n')[0]` + token/expected hints) and
discarded the original, so a host could only re-wrap the reduced string,
losing the `@glimmer/syntax` SyntaxError's code-frame and position. Both
the compiler and the Ember host pin the same `@glimmer/syntax`, so the
original error's message/code-frame/position already match what the host
would produce.

Preserve it on `CompilerError.originalError` (threaded through
`enrichError` from all three catch branches) so the host can rethrow it
unchanged when there is a single error. Synthesized diagnostics (unknown
binding, W-codes) leave it undefined.

Unblocks the emberjs/ember.js#21340 compile-time error group
(`compile errors` + `general syntax errors`, ~21 tests) once the Ember
host rethrows `originalError`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
`(mut this.foo)` / `(mut @bar)` pass the path as a string the host
parses to build a setter, but a lexical JS head (`state.arg1`, a block
param) cannot be resolved by name at runtime, so it was dropped and the
host's `mut` asserted "You can only pass a path to mut". A lexical-head
mut (head is a known binding, dotted tail) now lowers to the existing
`(mut (get obj key))` machinery — `__mutGet(() => head, "rest")` — a
parent getter + key the host writes through with `set(parent, key, v)`.
The parent getter is buildValue's own read of the head, so it yields the
real parent object whatever the binding's compiled shape, and a dotted
tail is passed as __mutGet's dotted key. this./@ heads and non-compat
builds are unchanged. Mirrored in the SubExpression (visitors/index.ts)
and mustache (visitors/mustache.ts) handlers.

Unblocks the emberjs/ember.js#21340 tests "Helpers test: {{fn}} :: can
be used on the result of `mut`" and its "… with a falsy value" variant.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
The `(mut <lexical path>)` lowering from the previous commit built its
`__mutGet` helper with
`helper('__mutGet', [parentGetter, literal(restKey)], range, pathRange)`,
omitting the `named` Map argument. `range` (a SourceRange) therefore landed
in the `named: Map<string, SerializedValue>` slot, so at serialize time
`value.named.values()` threw (reported as compile error E001) and the three
lexical-head lowering tests in mut-lexical-head.test.ts failed with a stray
errors entry. It is also a `tsc` type error (TS2345: SourceRange not
assignable to Map), which failed the `tsc &&` step of `pnpm dev:playwright`,
so the Playwright webServer could not start (exit code 2) — the same root
cause.

Pass `new Map()` as the named args, matching the sibling `(mut (get obj key))`
__mutGet calls, in both the SubExpression (index.ts) and mustache (mustache.ts)
handlers.

Part of the fix for the emberjs/ember.js#21340 tests "Helpers test:
{{fn}} :: can be used on the result of `mut`" and its "… with a falsy
value" variant.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
DRAFT. The root template is built detached and inserted only after the
whole template evaluates, so an in-element whose destination is a sibling
rendered earlier in the same render (document.getElementById) sees null
and the host's _emberInElement asserts. gxt already defers in-element to
the mount hook for the native runtime, but the Ember compat path resolves
the destination during build, so the fix must make the root render stream
nodes into their parent as they are built.

This commit adds the target-behaviour regression spec as todos; the
streaming implementation is described in the PR and relies on CI /
the emberjs/ember.js#21340 test "[integration] jit :: Application test:
debug render tree :: in-element in tree" for validation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
…ction

Adds `HOST_HOOKS.onCellRead(object, key)`, fired from the property-tag
tap `$__tag` for every reactive read of an object/function head — the
compiler-emitted equivalent of Glimmer's "consumed tags". A host
snapshots the (object, key) pairs read during a render pass and raises
the backtracking assertion when a later non-tracked set() dirties one of
them — detection compat silently lost for Glimmer (template-only)
components, whose reads were never recorded (manager.ts checkBacktracking
only fired for template-rendered objects, which handleCustomManagedComponent
never populated).

Scope: this is the gxt-side SEAM only. It is hook-presence gated (a single
branch, zero-cost when absent) and installed only by a DEBUG host, so it
is a no-op for standalone gxt and every existing test. The snapshot +
assertion logic lives Ember-side and is validated there; the three
emberjs/ember.js#21340 backtracking tests that never see the assertion
("Components test: curly components :: when a shared dependency is
changed during children's rendering", "Components test: dynamic
components :: component helper emits useful backtracking re-render
assertion message" and "Components test: template-only components
(glimmer components) :: asserts when a shared dependency is changed
during rendering, and keeps original context") go green once the Ember
consumer lands and pins a gxt release carrying this hook. Fired before
the getProp delegation so the read is captured whichever tag path runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
gxt rewrote `@index` to `@identity` at compile time (W003), so the list
keyed rows by VALUE and a reorder moved/re-created rows — `@index` yielded
the wrong index and nodes "changed" on reorder. Now:

- compiler (serializers/control.ts normalizeEachKey): emit `@index`
  verbatim, drop the `@index -> @identity` rewrite + W003.
- runtime (control-flow/list.ts):
  - setupKeyForItem: `@index` keys each row by its POSITION, so a reorder
    leaves every key in place — the diff keeps (never moves) the row node
    and rebindReusedRow updates its bound item.
  - the index block param is a const formula equal to the row's fixed
    position (not the bound item's current position).
  - exclude `@index` from the property-name stale-key eviction (a
    positional key has no `item['@index']`, which would wrongly evict
    every reused row on reorder).

Standalone gxt has no body-proxy, so a reused row's displayed item only
updates through the host `rebindEachItem` seam (fired here); node identity
+ positional index are the standalone-observable core. tests: compiler
passthrough + runtime (nodes stay vs @identity moves, positional index,
rebind seam fires).

For the emberjs/ember.js#21340 tests "[integration] jit :: Updating ::
The each helper yields the index of the current item current item when
using the @index key" and the native "Syntax test: {{#each}} keys and DOM
identity :: @key keys items by position".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 6, 2026
Native `{{#each-in obj key=KEY}}` forwarded `key=` but it was resolved
against the lowered `[key,value]` PAIR, so `@key`/path keys resolved to
`undefined` (rows collapsed) and `@index` degraded to `@identity`. Now:

- compiler (visitors/block.ts + serializers/value.ts): a non-identity
  `key=` is forwarded to `$__eachIn(obj, "key")`, and the lowered `each`
  keys by `@identity` on the returned pairs ($__eachIn owns the keying).
  `@identity`/default stays the historic 1-arg `$__eachIn(obj)`.
- runtime (helpers/each-in.ts): `$__eachIn(obj, key)` resolves the key
  against each ENTRY (Glimmer toEachInIterator / Ember keyEachInEntries):
  `@identity` keys by the entry (value change → new pair → new row);
  `@key`/`@index`/path key by the entry key / position / resolved path
  value, retaining the pair and updating its value in place while the row
  key is unchanged. Per-mode caches keyed by the row key directly (object
  or primitive, by reference — no String() collapse) so distinct key modes
  over one object don't clobber.

Standalone gxt observes the KEYING (which rows kept/recreated); the
retained row's displayed value re-reads through the host body-proxy
(Ember), validated there. tests: unit ($__eachIn per-mode stability +
in-place update), compiler (key forwarding), render (native: path key
retains the row node on same-id replace vs @identity recreates).

For the five native emberjs/ember.js#21340 tests of "Syntax test:
{{#each-in}} with the key option" (the default value key, key="@key",
key="@index", a path key, and key="@index" over a Map keyed by objects).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 17, 2026
…, mut lexical head (#273)

* fix(modifier): tap property tag for dynamic this.* modifier names

A dynamic modifier whose name is a `this.*` path was emitted as a plain
member read (`$s.dyn`). On an EmberObject with a non-@Tracked `dyn` that
read taps no tag, so the modifier formula is treated as const and a later
`set(ctx, 'dyn', X)` never re-installs the modifier — it is never
destroyed/created. Under EMBER_PROPERTY_TAGS the modifier-name path now
goes through the same `$__tag(obj, "key")` chain as a value path
(buildPathExpression → buildEmberMemberChain), so resolution is reactive.
Standalone keeps the plain read.

Unblocks the native emberjs/ember.js#21340 test "Basic Custom Modifier
Manager: 3.22 :: destroys a dynamic modifier that was set after the
initial render".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(compile): keep the original SyntaxError on CompilerError

The compiler reduced a thrown parse error to a one-line `message`
(`parseError.message.split('\n')[0]` + token/expected hints) and
discarded the original, so a host could only re-wrap the reduced string,
losing the `@glimmer/syntax` SyntaxError's code-frame and position. Both
the compiler and the Ember host pin the same `@glimmer/syntax`, so the
original error's message/code-frame/position already match what the host
would produce.

Preserve it on `CompilerError.originalError` (threaded through
`enrichError` from all three catch branches) so the host can rethrow it
unchanged when there is a single error. Synthesized diagnostics (unknown
binding, W-codes) leave it undefined.

Unblocks the emberjs/ember.js#21340 compile-time error group
(`compile errors` + `general syntax errors`, ~21 tests) once the Ember
host rethrows `originalError`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(mut): support a lexical head in (mut path) via __mutGet

`(mut this.foo)` / `(mut @bar)` pass the path as a string the host
parses to build a setter, but a lexical JS head (`state.arg1`, a block
param) cannot be resolved by name at runtime, so it was dropped and the
host's `mut` asserted "You can only pass a path to mut". A lexical-head
mut (head is a known binding, dotted tail) now lowers to the existing
`(mut (get obj key))` machinery — `__mutGet(() => head, "rest")` — a
parent getter + key the host writes through with `set(parent, key, v)`.
The parent getter is buildValue's own read of the head, so it yields the
real parent object whatever the binding's compiled shape, and a dotted
tail is passed as __mutGet's dotted key. this./@ heads and non-compat
builds are unchanged. Mirrored in the SubExpression (visitors/index.ts)
and mustache (visitors/mustache.ts) handlers.

Unblocks the emberjs/ember.js#21340 tests "Helpers test: {{fn}} :: can
be used on the result of `mut`" and its "… with a falsy value" variant.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(mut): pass the named-args Map to __mutGet for a lexical head

The `(mut <lexical path>)` lowering from the previous commit built its
`__mutGet` helper with
`helper('__mutGet', [parentGetter, literal(restKey)], range, pathRange)`,
omitting the `named` Map argument. `range` (a SourceRange) therefore landed
in the `named: Map<string, SerializedValue>` slot, so at serialize time
`value.named.values()` threw (reported as compile error E001) and the three
lexical-head lowering tests in mut-lexical-head.test.ts failed with a stray
errors entry. It is also a `tsc` type error (TS2345: SourceRange not
assignable to Map), which failed the `tsc &&` step of `pnpm dev:playwright`,
so the Playwright webServer could not start (exit code 2) — the same root
cause.

Pass `new Map()` as the named args, matching the sibling `(mut (get obj key))`
__mutGet calls, in both the SubExpression (index.ts) and mustache (mustache.ts)
handlers.

Part of the fix for the emberjs/ember.js#21340 tests "Helpers test:
{{fn}} :: can be used on the result of `mut`" and its "… with a falsy
value" variant.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 17, 2026
…272)

In the Ember dialect a component's named args are emitted as
`$_args({ key: () => value }, …)`, where reactive values are zero-arg
getters the arg-access layer (ArgProxyHandler / the DEV $_args getter)
invokes on read. The layer historically invoked ANY function-valued arg,
so it could not tell a compiler-emitted reactive getter apart from a
function that is itself the arg value — a host-forwarded action or a
{{fn}}/helper bound result. Those got invoked on every read
(emberjs/ember.js#21340, "Components test: contextual components ::
renders with dot path and updates attributes": 4/8/15/22 instead of
1/1/2/3).

The compiler now wraps the reactive getters it emits in buildArgsObject
with `$_argThunk`, and the arg layer invokes ONLY branded thunks; every
other function value passes through unchanged. The marker is a plain
string-keyed property (like `$_nt`), minification-proof; `isArgThunk` is
exported so a host can retire its `fn.length`/`fn.prototype` shape
heuristic.

Gated to the Ember dialect (WITH_EMBER_INTEGRATION + IS_GLIMMER_COMPAT_MODE):
that is the only layer that forwards bare function values into gxt args,
so standalone gxt keeps byte-identical codegen and its
invoke-every-getter arg semantics.

- src/core/dom.ts: $_argThunk / isArgThunk; brand-only invocation in
  ArgProxyHandler + the DEV $_args getter (gated).
- compiler: emit $_argThunk around reactive arg getters (reactiveGetter /
  zero-arg arrow / $__cached memoized getter) in buildArgsObject.
- register ARG_THUNK in both symbol registries, GXT_RUNTIME_SYMBOLS.
- tests: emission + gate + runtime predicate + AOT auto-import guard.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 17, 2026
gxt rewrote `@index` to `@identity` at compile time (W003), so the list
keyed rows by VALUE and a reorder moved/re-created rows — `@index` yielded
the wrong index and nodes "changed" on reorder. Now:

- compiler (serializers/control.ts normalizeEachKey): emit `@index`
  verbatim, drop the `@index -> @identity` rewrite + W003.
- runtime (control-flow/list.ts):
  - setupKeyForItem: `@index` keys each row by its POSITION, so a reorder
    leaves every key in place — the diff keeps (never moves) the row node
    and rebindReusedRow updates its bound item.
  - the index block param is a const formula equal to the row's fixed
    position (not the bound item's current position).
  - exclude `@index` from the property-name stale-key eviction (a
    positional key has no `item['@index']`, which would wrongly evict
    every reused row on reorder).

Standalone gxt has no body-proxy, so a reused row's displayed item only
updates through the host `rebindEachItem` seam (fired here); node identity
+ positional index are the standalone-observable core. tests: compiler
passthrough + runtime (nodes stay vs @identity moves, positional index,
rebind seam fires).

For the emberjs/ember.js#21340 tests "[integration] jit :: Updating ::
The each helper yields the index of the current item current item when
using the @index key" and the native "Syntax test: {{#each}} keys and DOM
identity :: @key keys items by position".

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 17, 2026
Native `{{#each-in obj key=KEY}}` forwarded `key=` but it was resolved
against the lowered `[key,value]` PAIR, so `@key`/path keys resolved to
`undefined` (rows collapsed) and `@index` degraded to `@identity`. Now:

- compiler (visitors/block.ts + serializers/value.ts): a non-identity
  `key=` is forwarded to `$__eachIn(obj, "key")`, and the lowered `each`
  keys by `@identity` on the returned pairs ($__eachIn owns the keying).
  `@identity`/default stays the historic 1-arg `$__eachIn(obj)`.
- runtime (helpers/each-in.ts): `$__eachIn(obj, key)` resolves the key
  against each ENTRY (Glimmer toEachInIterator / Ember keyEachInEntries):
  `@identity` keys by the entry (value change → new pair → new row);
  `@key`/`@index`/path key by the entry key / position / resolved path
  value, retaining the pair and updating its value in place while the row
  key is unchanged. Per-mode caches keyed by the row key directly (object
  or primitive, by reference — no String() collapse) so distinct key modes
  over one object don't clobber.

Standalone gxt observes the KEYING (which rows kept/recreated); the
retained row's displayed value re-reads through the host body-proxy
(Ember), validated there. tests: unit ($__eachIn per-mode stability +
in-place update), compiler (key forwarding), render (native: path key
retains the row node on same-id replace vs @identity recreates).

For the five native emberjs/ember.js#21340 tests of "Syntax test:
{{#each-in}} with the key option" (the default value key, key="@key",
key="@index", a path key, and key="@index" over a Map keyed by objects).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
lifeart added a commit to lifeart/glimmer-next that referenced this pull request Nov 17, 2026
…ction (#275)

Adds `HOST_HOOKS.onCellRead(object, key)`, fired from the property-tag
tap `$__tag` for every reactive read of an object/function head — the
compiler-emitted equivalent of Glimmer's "consumed tags". A host
snapshots the (object, key) pairs read during a render pass and raises
the backtracking assertion when a later non-tracked set() dirties one of
them — detection compat silently lost for Glimmer (template-only)
components, whose reads were never recorded (manager.ts checkBacktracking
only fired for template-rendered objects, which handleCustomManagedComponent
never populated).

Scope: this is the gxt-side SEAM only. It is hook-presence gated (a single
branch, zero-cost when absent) and installed only by a DEBUG host, so it
is a no-op for standalone gxt and every existing test. The snapshot +
assertion logic lives Ember-side and is validated there; the three
emberjs/ember.js#21340 backtracking tests that never see the assertion
("Components test: curly components :: when a shared dependency is
changed during children's rendering", "Components test: dynamic
components :: component helper emits useful backtracking re-render
assertion message" and "Components test: template-only components
(glimmer components) :: asserts when a shared dependency is changed
during rendering, and keeps original context") go green once the Ember
consumer lands and pins a gxt release carrying this hook. Fired before
the getProp delegation so the read is captured whichever tag path runs.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
lifeart and others added 8 commits November 20, 2026 14:43
Adds the two GXT flavors next to the classic build, without changing the
classic one:

- `EMBER_RENDER_BACKEND=gxt` (rollup) / `GXT_MODE=true` (vite): the compat
  backend. A shared alias table (scripts/gxt-alias-map.mjs) swaps the
  @glimmer/* reactivity and manager packages for the gxt-backend shims and
  drops the Glimmer VM packages from the dist. `@glimmer/tracking` is not
  aliased: it is metal's `tracked` / `cached` in every build.
- `EMBER_RENDER_BACKEND=gxt-native`: the native layer. Classic Ember source
  with `__GXT_MODE__ = false`; only the modules that touch the Glimmer VM are
  aliased to gxt-backend/native (same table, native section), and templates
  compile with the gxt compiler.

`__GXT_MODE__` / `__GXT_CLASSIC_COMPONENTS__` are build-time constants
(scripts/replace-build-constant.mjs, declared in types/gxt-ambient.d.ts) that
both bundlers inline, so classic dists fold every GXT branch away.

Other pieces: `@lifeart/gxt` pinned to exactly 0.0.86 as a root
devDependency (ember-source does not install it; only the GXT packages
declare it), playwright for the GXT browser tests, the bundle-size check and
budgets (with a guard against GXT code left live in the classic dist), and
the compat package assembler (scripts/build-gxt-package.mjs). Production
dists keep only the `@__PURE__`-style and license comments (rollup
`shouldPrintComment`).

gxt-backend and @glimmer/component-gxt are linted and type-checked with the
rest of the repo: `pnpm lint`, with overrides scoped to the two trees
(barrel imports are allowed there, because the alias map matches exact
specifiers; an empty catch block is an error), and both root tsc programs
(tsconfig `paths` for the specifiers the trees use that no workspace link
provides; the stable-decorators program leaves out one test of legacy-only
decorator forms). The published types still leave the two trees out.

The compat test configs compile templates with Glimmer's whitespace rules
(gxt's EMBER_WHITESPACE flag), so a template's text is Glimmer's; the gxt
compiler imports decorator-transforms' runtime itself, so a decorated .gjs
module needs no `dt7948` global; a test module the gxt compiler cannot
compile becomes a failing synthetic module instead of a page that fails to
load.

On top of main's build: the classic test build keeps main's
`treeshake: false`; `@glimmer/component` resolves to its source in the GXT
configs; the compat package's renamed-modules map leaves out main's internal
mixin copies (`*-internal.js`), as packageMeta does.

The per-fix history, including the lint and type-check coverage
(5174ffe), is on lifeart:gxt-pre-squash-b1bf210aef.

Folded in after the squash: the native forbidden list also covers the
compat Glimmer host modules, and the bundle budgets are re-baselined (at the
measured floor + 5%) after the GXT leftovers left the classic dist.
The history of these follow-ups is on lifeart:gxt-followups.

Folded in with the second squash: `@lifeart/gxt` pinned to 0.0.89 (by way
of 0.0.87 and 0.0.88); the classic-dist guard reads the live gxt-bridge
calls from the babel AST of each dist file (scripts/dist-ast.mjs, shared
with assert-native-dist); the gxt-native dist leaves out the Glimmer
wire-format compiler entries, and its budget is re-baselined; the vite
configs resolve `@lifeart/gxt/item-references`; the compat build compiles
an app's `{{outlet}}` with gxt's EMBER_OUTLET flag and Ember's own
templates with the gxt compiler under the compat runtime-compile flags
(COMPAT_TEMPLATE_FLAGS), and only the runtime-compilation entries load the
gxt runtime compiler.
The history of these commits is on lifeart:gxt-pre-squash2-2063496034.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
packages/@ember/-internals/gxt-backend renders Ember with glimmer-next
(@lifeart/gxt) instead of the Glimmer VM:

- compile.ts / ast-transforms.ts: the Ember template dialect on the gxt
  compiler (runtime `precompileTemplate`, `plugins.ast`, the Ember keyword
  helpers) and the gxt runtime patches the dialect needs. A template the gxt
  compiler cannot compile throws with gxt's message (Glimmer's exact error
  text is not a goal);
- manager.ts / ember-gxt-wrappers.ts / helper-manager.ts: component, helper
  and modifier managers (classic curly components behind
  `__GXT_CLASSIC_COMPONENTS__`), the `$_tag` / `$_maybeHelper` / `$_dc`
  wrappers compiled templates call;
- validator.ts / reference.ts / destroyable.ts (+ the `-vm-compat` test
  surfaces): @glimmer/validator, /reference and /destroyable on gxt cells,
  including main's standalone `trackedValue` on the shim's tags;
- gxt-bridge.ts: the side-effect-free registry the classic packages reach
  the backend through, so classic builds never load it. Its glimmer-host
  slot is filled by glimmer-host.ts with the GXT code of the glimmer
  package: the root template (root-template.ts), `renderComponent` and the
  debug render tree (render-component.ts), the classic roots' render,
  destruction, bounds and forced re-render (classic-roots.ts) and the
  template adapter (template-adapter.ts);
- outlet.ts: route outlets. Main renders routes through route managers and a
  `RootOutlet` component; the compat backend keeps its own outlet machinery
  (the `<ember-outlet>` element, the root template's outlet path) driven by
  the `{ render, outlets }` chain that `Route#setup` records through the
  bridge's route-outlet hooks, and invokes any other route manager's wrapper
  as main's outlet does.

Also @glimmer/component-gxt and the backend's own QUnit tests (__tests__),
which run on the GXT test page.

Main fixes since the first version of this series, each with a test:

- No re-render loops: reading a helper's value no longer writes reactive
  state (helper args follow Glimmer's args proxy), and (hash)/(array)
  arguments keep one identity while their members do not change.
- Reactivity: every write to a @Tracked property re-renders (a gxt cell
  accessor no longer shadows the tracked one); a trackedArray changed in
  place, a property dirtied with dirtyTagFor and a cell written in a
  modifier's install all render by the end of the run loop; creating a
  binding evaluates its expression once; Glimmer component arguments, (mut),
  (readonly), dependent keys through arguments and createCache follow what
  they read; a render asserts when it writes a tracked value it already read.
- Instances: one helper instance per call site and render scope; one
  component instance per invocation (custom-managed and classic); each
  modifier on an element has its own instance; components, modifiers and
  helpers are destroyed with the block that rendered them, in node order, in
  the run loop that removes it.
- Rendering: attributes are not arguments and reach a component only through
  `...attributes`, with Glimmer's precedence; a null/undefined/false
  attribute or class is removed; URL attributes use Glimmer's own
  sanitization; a <template> component invoked by name, a class with a
  class-body template and a class with a registered template render through
  their component manager, with blocks, block params and `...attributes`; a
  content mustache renders what its value is (text, node, component, helper,
  curried value) and keeps its component while the curried value stays;
  dynamic components follow their definition; {{#each}} rows, {{#each-in}}
  keys, {{#in-element}}, SVG namespaces, named and else blocks, {{log}} and
  {{debugger}} behave as in Glimmer.
- renderComponent: a root updates in place instead of being rendered again
  on every tag change, is a root of its owner's renderer, renders into a
  cursor, an <svg> or with a custom-managed plain-object definition, and is
  part of the debug render tree.
- Errors: no error is swallowed any more. A render throws only its own
  errors, an update's errors (its hooks, a new branch's component, the DOM
  sync at the end of a run loop) reach the code that ran the run loop, and
  empty catch blocks are gone.
- Lint and type-check clean (ESLint 376 -> 0, tsc 497 -> 0 problems); the two
  vitest files became QUnit modules on the GXT test page.

The per-fix history, including the lint/type-check work and the moves of
gated code from the glimmer package into the host modules
(5ec62d6..b1bf210), is on lifeart:gxt-pre-squash-b1bf210aef.

Folded in after the squash: the GXT `template()` of @ember/template-compiler
(template-function.ts), the GXT re-render trigger and dependent recompute of
metal's property events (property-events.ts), the GXT parts of Route#refresh,
Route#setup and didTransition (outlet hooks), the view-tree rebuild of
getRootViews / getChildViews and a classic root's GXT render state
(classic-roots.ts) moved here from the classic files.
The history of these follow-ups is on lifeart:gxt-followups.

Also folded in after the third rebase onto main: a loose-mode
`{{attrs.x}}` raises Ember's assert-against-attrs assertion with its
source location; `{{debugger}}` in a template-only component sees the
template-only self through the render proxy; a `(fn ...)` result passed
to a helper is not invoked early; a helper recomputes when an EmberArray
argument changes in place; a custom modifier whose install throws keeps
the DOM already rendered (the error is rethrown after insert, as Glimmer
does). Their history is on lifeart:gxt-ember-easy-fixes and
lifeart:gxt-ember-hard-fixes.

Adapted in the rebase onto main 493985e, where a rendering test
renders its template through a Glimmer root (`BaseRenderer#render`) and
`Evented` is deprecated:

- a root of `BaseRenderer#render` renders through the glimmer host's
  `renderRoot`, at its cursor and without renderComponent's clear,
  replace and dedupe bookkeeping, and is returned to the caller;
- a classic component's lifecycle events are sent as Glimmer's curly
  manager sends them (`sendCoreViewEvent`: the listeners, then the
  method), without the `Evented#trigger` deprecation: the innermost of
  the backend's per-instance `trigger` wrappers sends a dispatch the
  backend marks, and an instance without a wrapper gets it directly; a
  `trigger` call from user code, also one inside a hook, stays the
  deprecated method;
- a component root gets the context cells of a classic root, so its
  function-valued and ArrayProxy-valued properties re-render when set;
- a component root renders inside a render pass, so a write of a value
  it already read raises the backtracking assertion;
- an error of a component root's commit phase (a modifier's install)
  keeps the render and is rethrown once the render is complete;
- backtracking messages label a component root `{ROOT}` and a classic
  root `-top-level`;
- a classic component destroyed with its block runs willDestroyElement
  while its element is still in the document;
- the arguments of an internal component detect `(mut)` and `(readonly)`
  values without reading other properties of an argument's value;
- a root whose first render failed stays in its renderer until the
  renderer is destroyed;
- the backend's tests run main's deprecated `A()` and
  `ObjectProxy.create` inside `ignoreDeprecation`.

Folded in with the second squash (their tests are in the test commit):

- a cache keeps its tag when it consumes the same tags again; a
  custom-managed component reads its changed arguments; in development, a
  write of a member that a Glimmer component's template read asserts;
- the regexes and hand-rolled scanners over template source are AST
  transforms (ast-transforms.ts) and value checks: a runtime template's
  explicit `this`, the implicit form's free variables, block params named
  like keywords, block keywords the scope shadows, dotted paths checked
  against the block params in scope, in-element fallback destinations,
  strict-mode scope names, the each-in and dynamic-variable lowerings, the
  cells that own an `{{#each}}` list, argument names that start with
  `Symbol`, `<LinkTo>` and `<Textarea>` known by identity, and scope names
  written as string literals; the dead `curly-c-` branches are removed;
- with gxt 0.0.87 and 0.0.88: only the argument getters gxt's compiler
  brands are called, and any other function is the value; lists keyed by
  position keep their rows and show the items now at them, also through
  yielded blocks and classic components, with the argument pass run again;
  a two-way bound argument is written where Glimmer writes it, from the
  source gxt's compiler gives it (arg-sources.ts); a classic component class
  in a strict template's scope is a classic component;
- with gxt 0.0.89: gxt's argument-source helpers are imported by name; a
  compat app built from source renders its routes and its links; Ember's
  own templates are compiled at build time (templates.gts); the render layer
  reads gxt's runtime compiler through a seam (runtime-compiler-seam.ts)
  that only the entries an app compiles templates through at runtime
  install.

The history of these commits is on lifeart:gxt-pre-squash2-2063496034.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gxt-backend/native replaces only the Ember modules that touch the Glimmer VM
(renderer, outlet, managers, validator / reference / destroyable, template
factories, runtime helpers) with gxt-native implementations; everything else
is classic Ember source built with `__GXT_MODE__ = false`.

Main renders routes through route managers. Native aliases
`route-managers/root-outlet` to native/root-outlet.ts: the root outlet state
holds a native `OutletView` whose levels are live views of main's
`OutletState`s (owner, controller, tracked context as `@model`, the route
template looked up once per route bucket), and `renderComponent` renders a
`RootOutlet` through the owner's `appendOutletView`. The classic route
wrapper and the classic route manager's `RouteTemplate` (both Glimmer VM
internal components) are plain records, the route-manager registry asserts
through `@ember/debug` instead of `@glimmer/global-context`, `base-renderer`
maps to the native renderer, and owners with live roots are listed in main's
`renderers` list for `captureRenderTree`. Like main, the root outlet adds no
render-tree node.

Packaging: scripts/build-gxt-native-package.mjs and
scripts/gxt-native-package (ember-source-gxt-native, which pins the root's
exact @lifeart/gxt), assert-native-dist (the VM-free dist check), and the
modern-app bundle/boot harness (scripts/bundle-modern-app*.mjs,
smoke-tests/modern-app) plus the packaged consumer smoke test
(smoke-tests/gxt-native-package). Following main: the package and the
harness's dist snapshots carry ember-source's `sideEffects`;
@glimmer/component builds a dev and a prod dist of its own, and the package,
the preset and the dist assertion pick the one of the mode; the consumer app
compiles for main's browser targets (lib/browsers.cjs), so its bundle stays
byte-identical to the harness measurement; the renamed-modules map leaves out
main's internal mixin copies (`*-internal.js`), as packageMeta does.

Main fixes since the first version of this series:

- Decorated .gjs/.gts components boot in a consumer app: the package's vite
  preset makes gxt's decorator output import decorator-transforms' runtime
  instead of reading a `dt7948` global nothing installs.
- URL attributes are sanitized with Glimmer's own rules; a bound attribute
  that is a property of its element is set through the property, and a
  null/undefined one is removed.
- A component without a template yields its block (Glimmer's default
  `{{yield}}` template), and the nearest template of a class chain wins,
  registered or class-body.
- Retained memory per row: a call site without named arguments keeps one
  shared empty hash instead of the fresh `{}` gxt passes on every
  evaluation, and an element modifier is a class instance instead of two
  closures over its state.
- `{{debugger}}` calls Glimmer's debugger callback; the package build warns
  about a local gxt only when there is one.

The per-fix history is on lifeart:gxt-pre-squash-b1bf210aef.

Folded in after the squash: assert-native-dist knows the compat Glimmer host
modules.
The history of these follow-ups is on lifeart:gxt-followups.

Also folded in after the third rebase onto main: `{{get}}` reads
properties of primitives (Glimmer's `isDict`); `{{hash}}` members are lazy
getters that stay reactive, with a custom tag for computed keys through
them; modifiers are destroyed child-first, in element-closing order; the
debug render tree names a renderComponent root `{ROOT}` and a component
bound through a strict-mode scope by its binding. Their history is on
lifeart:gxt-ember-easy-fixes.

Adapted in the rebase onto main 493985e: a root whose first render
failed is torn down and stays registered until its owner is destroyed;
the native rendering test case exposes the render root as `this.root`,
which main's tests destroy; a native test expects the deprecation of
main's `A()`.

Folded in with the second squash: a cache keeps its tag when it consumes
the same tags again; a helper call site is one object, and a context's
sites an array; one scheduled modifier-destroy flush per run loop; a route
template reads `@model` as the route's model; lists keyed by position use
gxt's item references, whose runtime the templates that need it install
(gxt 0.0.89), as a lists app shows (smoke-tests/modern-app/app-lists); the
package contract names every non-app entry the package does not ship;
assert-native-dist reads the dist through scripts/dist-ast.mjs; the
modern-app harness also builds the compat app from source and fails a
precompiled one whose closure holds a template compiler module
(`--assert-no-runtime-compiler`).
The history of these commits is on lifeart:gxt-pre-squash2-2063496034.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The places where classic Ember hands over to the compat backend. Every hook
is behind the build-time `__GXT_MODE__` constant and reaches gxt-backend only
through gxt-bridge, so the classic dists fold them away; the surrounding code
is main's.

- glimmer: base-renderer, renderer, templates/root.ts and unwrap-template.ts
  call the bridge's glimmer host (gxt-backend's root template,
  `renderComponent`, classic-root render / destroy / bounds, template
  adapter) from whole `if (__GXT_MODE__)` blocks or a top-level ternary, and
  assert that it is installed; a VM-free renderer state under GXT; GXT-aware
  `template()`, internal components, Input, element helper,
  scheduleRevalidate. root.ts keeps one side-effect-only import
  (@glimmer/manager) that the native build's module order needs.
- metal: the single gxt cell behind `@tracked`, the GXT re-render trigger in
  `notifyPropertyChange`, the CP re-entrancy guards, `set` hooks.
- routing: `Route#setup` / `teardownViews` record and drop the route's GXT
  render state, `_setOutlets` renders through the GXT outlet machinery (and
  skips main's incremental mid-transition passes, which have nothing new to
  render there), QP / meta fixes; the classic route manager keeps a raw gxt
  route template uninvoked, and the classic outlet component is registered
  as the wrapper the GXT outlets render themselves.
- runtime / object / runloop / application / views / template-compiler:
  smaller GXT hooks (observer flush budget, proxy unknownProperty during
  renders, settled PromiseProxy fast path, view-tree rebuild, GXT
  `template()`); `visit()` asserts that GXT supports neither the serialize
  nor the rehydrate render mode.

One classic change: the `{{debugger}}` callback moves from the VM opcode
module to @glimmer/runtime/lib/debugger-callback.ts (the opcode module
re-exports `setDebuggerCallback` / `resetDebuggerCallback`), so a renderer
without the VM calls the same callback.

Main fixes since the first version of this series: the hooks no longer
swallow errors (an error of the DOM sync at the end of a run loop is thrown
from the run loop's last step instead of being dropped; `template()`'s
implicit scope keeps only the expected eval failures); a render throws only
its own render errors; `renderComponent` of a plain-object definition runs
its custom manager, and a root with a `hasSubOwner` manager renders with the
manager's owner; a Glimmer component used as a route template is created by
its manager. Most of the GXT code these hooks used to carry inline now lives
in gxt-backend (the moves were c741f0d..b1bf210 on
lifeart:gxt-pre-squash-b1bf210aef).

The per-fix history is on lifeart:gxt-pre-squash-b1bf210aef.

Folded in after the squash: the moves out of template-compiler, routing,
metal and views utils, and the removal of the classic leftovers (the
side-effect-only imports of renderer.ts, the input's GXT methods, the GXT
locals of ClassicRootState / set / tracked / ArrayProxy, barrel imports in
place of main's deep paths). The classic prod dist is main's plus the
`{{debugger}}` callback module and one alias line.
The history of these follow-ups is on lifeart:gxt-followups.

Adapted in the rebase onto main 493985e: main's rendering tests call
`BaseRenderer#render` directly, and under GXT it hands the render to the
glimmer host (`renderRoot`), as `renderComponent` does. `CoreView` stays
main's: gxt-backend sends the lifecycle events itself.

Folded in with the second squash: link-to.ts and textarea.ts register
`<LinkTo>` and `<Textarea>` with the compat backend in an
`if (__GXT_MODE__)` block (12 lines), so the backend knows them by
identity, not by `toString()`.
The history of this commit is on lifeart:gxt-pre-squash2-2063496034.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- scripts/gxt-test-runner: the Playwright + QUnit runner (one module per
  page load, baselines, smoke list, native allow-list and skips, contract
  tests, baseline gate; the gate's `--subset` mode compares only the modules
  a shard ran). `--shard` splits the sorted module list round-robin, and
  merge-runs.mjs merges the shard outputs into the summary an unsharded run
  writes, so CI gates the merged run and a baseline can be regenerated from
  it. The native allow-list follows main's test files;
- index.html: the GXT test-page setup (behind `__GXT_MODE__`) on main's page;
  native.html: the gxt-native test page, which also runs main's
  `setupTestHelpers()` and loads QUnit by package name like index.html;
- internal-test-helpers: GXT compile through the compat compiler, the GXT
  teardown harness (a module-level value, so classic test builds keep none
  of it; it throws what destroying a modifier or a helper throws), GXT
  artifact stripping in equalTokens / equalInnerHTML / qunit-dom `hasHtml`,
  GXT run helpers (`runTask` / `runAppend` sync the DOM after their run loop
  and rethrow its errors); the router test case exposes its root element to
  GXT;
- integration-tests: the GXT rehydration delegate (two plain GXT renders,
  the server one not interactive; serialization-dependent tests skipped with
  a reason) on main's `RenderDelegate` / `RenderHandle` interface; the tests
  that check Glimmer VM internals (list-update steps, serialization markers,
  dynamic variables other than outletState) skipped under GXT with a reason;
  GXT marker comments (`<!---->`, curried-component boundaries) ignored by the
  assertions; the jit delegate makes a curried component the way the GXT
  `component` helper does; no empty component sub-modules under GXT.

The per-fix history is on lifeart:gxt-pre-squash-b1bf210aef.

Folded in after the squash: native-skip.json drops the entries that no
longer match a test after the rebase onto main (tests main moved, rewrote
or renamed).
The history of these follow-ups is on lifeart:gxt-followups.

After the third rebase onto main, which moved fragment-components-test.js
into components/classic/ and renamed its module, the native allow-list
names the new path and the module's 12 native-skip.json keys carry the
new module name.

Adapted in the rebase onto main 493985e: the rendering and router
test cases render through main's Glimmer root, under GXT through
`gxtHarness.runRender`, which keeps the semantics of `runAppend` (one
render pass id, the DOM sync after the run loop and its errors), and
`runAppend` starts a render pass for a classic `-top-level` root. Main's
two new rehydration-stats tests of a curly-invoked Glimmer component are
unsupported in the GXT delegate, as their classic siblings are.
native-skip.json drops the 18 skips of tests that main rewrote from
classic components to a custom-managed component under the same names,
and two skip reasons name the `{ROOT}` label. The README's smoke counts
are those of the rebased suite.

Folded in with the second squash: the README's smoke counts, and
native-skip.json follows main's rename of a debug render tree test.
The history of these commits is on lifeart:gxt-pre-squash2-2063496034.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
GXT branches in shared tests (cache-counter parity, debug render tree,
resolver cache, helper registration through the runtime `hbs`), GXT skips
(hot reload, `{{mount}}`, classic `append`, the rehydration render mode, the
compile-options meta test), and renames that keep the names `array` and
`element` out of module scope in the single-chunk GXT test bundle.

New regression tests, which run on both backends, for the behaviours the
compat backend had wrong: has-block-params in nested blocks; the
(hash)/(array) identity tests (helpers/gxt-hash-array-identity-test.js,
because main rewrote array-test / hash-test as .gjs); attributes are not
arguments and URL attributes forwarded through `...attributes` are
sanitized, also on update (angle-bracket invocation, attribute bindings,
Input, LinkTo); a null/undefined/false attribute or class is removed and a
triple curly in an attribute renders its value (content-test); `<template>`
components invoked by name and classes with a class-body template
(template-tag-by-name-test.gjs, class-body-template-test.gjs,
template-tag-*-test.gjs); a `{{component}}` mustache passed as an argument
is curried; each `{{on}}` and each custom modifier on one element is its own
instance; renderComponent of a custom-managed plain-object definition, and a
root that updates in place, evaluates each binding once and throws only its
own errors. The named-outlets assertion test runs again (its method lacked
`@test`), with the column the compiler reports.

The rebase onto main keeps main's rewritten arranged-content tests, with the
`array` rename on top.

The per-fix history is on lifeart:gxt-pre-squash-b1bf210aef.

Adapted in the rebase onto main 493985e: contextual-components-test.js
is main's file plus this series' new test, and mount-test.js keeps the
GXT skip of the whole file around main's version; the runtime resolver
cache and template factory tests take main's expectations with GXT
branches (no root definition, one `-top-level` hit under the debug
render tree), and main's copies of the old tests in components/classic/
keep the GXT branches the old tests had; angle-bracket-invocation-test.js
imports `ClassicComponent` again for the two tests that use it.

Adapted in the rebase onto main 9ed2915 (RFC emberjs#1216, the classic
Component deprecation): append, attribute-bindings, runtime resolver
cache and template factory tests in components/classic/ take main's
deprecation-guarded files with this series' GXT branches re-applied
unchanged; the new button[formaction]/object[data] sanitization test
calls expectClassicComponentDeprecation() like main's other classic
component tests.

Folded in with the second squash: the tests of the fixes folded into the
compat backend and the native layer: a template's scope, keyword shadowing
and block params named like keywords, dotted paths, in-element
destinations, scope names, each-in forms, `{{#each}}` list paths, argument
names and built-in identity; the classic-dist guard's Node tests
(tests/node/dist-ast-test.cjs); nested and kept `{{#each-in}}` rows; rows
of a list keyed by position (what they yield and invoke, the components
they keep, type changes, each update hook once with the final arguments);
two-way bound arguments of each shape; functions passed to helpers; classic
component classes, curried or with only a layout, in a strict template's
scope. This series' classic component tests expect the ember-component
deprecation.
The history of these commits is on lifeart:gxt-pre-squash2-2063496034.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The GXT smoke (contract + sharded smoke modules, each shard gated against
the compat baseline), dual-build, gxt-native (modern-app boot, package,
native suite against its baseline) and full compat workflows. The full and
native suites run in parallel shards (5 and 4), and a combine job merges
them and gates the merged run with baseline-gate.mjs: the verdict is "no
test red that the baseline lists green, no baseline module missing, no
timeout or harness error", so known reds do not fail a run. The setup
action's optional Playwright install; the ember-source-gxt scenarios and the
v2 app template for them, whose boot smoke covers build-time .gjs components
(forwarded attributes, blocks, a class-body template, set() on a plain
field, decorators without a global) and compiles with Glimmer's whitespace
rules.

The per-fix history is on lifeart:gxt-pre-squash-b1bf210aef.

Folded in with the second squash: the v2 app template pins the root's
`@lifeart/gxt` (0.0.89); the gxt-native workflow also boots the lists app,
the compat strict app built from source, gated with
`--assert-no-runtime-compiler`, and the compat loose app, which compiles
its templates at runtime.
The history of these commits is on lifeart:gxt-pre-squash2-2063496034.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
test-results/gxt-baseline.json (compat, 10135/10376, 1037 modules) and
native-baseline.json (native, 7190/7203, 684 modules), regenerated from the
merged sharded runs of the GXT full and gxt-native workflows on this series
rebased onto main; and docs-internal-gxt-packaging-design.md.

Against the baselines before the rebase, every change comes from main or
from the test files this series converted, and no test turned red:

- main deleted the Enumerable and MutableEnumerable test modules, added
  `@each support`, `array computed macros deprecation` and (compat only)
  `DataAdapter releaseMethods`, all green, and changed the test or
  assertion counts of 17 existing modules in each suite (deprecation
  expectations, part of `EmberArray.@each support` moving to
  `@each support`, one more `Ember.A` test);
- main renamed one known red, `custom ember array properties rerender when
  updated` in Helper Tracked Properties (its key now carries `@test` twice,
  so its name starts with `@test`); it is still red under compat;
- the compat baseline gains the eight QUnit modules converted from vitest
  (`Compat: utils.ts` and its six children, `@glimmer/component-gxt:
  reactive identity`), all green.

The second rebase onto main changes only main's five new tests of a
cache's tag (emberjs#21664) in `@glimmer/validator: tracking > tracking cache`,
which both suites run (QUnit also counts them in the parent module). Four
are green. `it keeps its tag if it consumes the same tags in the next run`
is a known red in both baselines: the GXT validators do not reuse a cache's
tag when the cache consumes the same tags again, so an outer frame sees a
new tag after each re-run.

The third rebase onto main moves six classic-component test files into
components/classic/ and renames their modules (` (classic component)`);
their tests and results are unchanged. Main's rewrite of the
positional-params tests of `Component Manager - Curly Invocation` to a
native class whose manager's `updateComponent` is a no-op turns three of
them into compat known reds: the compat custom-manager arguments do not
update a native component's positional params unless `updateComponent`
writes them (native passes them). The fixes folded in with this rebase turn
9 compat and 14 native known reds green, among them `custom ember array
properties rerender when updated`.

The note in the compat file lists the run; the known reds are the failing
tests listed per module. A test that fails only because its expected error
message is Glimmer's exact text is a known red: the GXT backends throw their
own messages.

The per-fix history is on lifeart:gxt-pre-squash-b1bf210aef.

Folded in after the squash: the native baseline after the skip prune.
The history of these follow-ups is on lifeart:gxt-followups.

Folded in with the second squash: the baselines regenerated after the
regex cleanup, the memory changes, main's test rename and gxt 0.0.87 and
0.0.88, from the runs of compat 10,250/10,482 tests across 1,065 modules
and native 7,204/7,216 across 684 modules. gxt 0.0.89 leaves them
unchanged.
The history of these commits is on lifeart:gxt-pre-squash2-2063496034.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants