Commit 0691d3f
Make ember-lts-4.12 compat scenario runnable
Two stacked runtime issues were blocking ember-lts-4.12 once the
`require` import issue from #321 cleared. Both only affect the compat
path (ENABLE_COMPAT_BUILD=true, ember4 deps overrides) and are hidden
for ember-source >= 6 because the upstream code was rewritten.
1. "Cannot read properties of undefined (reading 'has')" at
`makeComputedDecorator` → `COMPUTED_GETTERS.has(...)`.
ember-source <= 5.x's `@ember/-internals/metal` has
`let COMPUTED_GETTERS; if (DEBUG) { COMPUTED_GETTERS = new WeakSet(); }`
paired with `assert(..., !COMPUTED_GETTERS.has(...))`. `DEBUG` comes
from `@glimmer/env`, whose published default is `DEBUG = false`.
Without something resolving `DEBUG` at compile time, rollup tree-shakes
the init but the `assert` predicate still runs eagerly, so
`COMPUTED_GETTERS` is undefined at runtime.
Conditionally add `babel-plugin-debug-macros` (only when
ENABLE_COMPAT_BUILD is set) with `flags: [{ source: '@glimmer/env',
flags: { DEBUG: true } }]` so the plugin inlines `DEBUG = true` in
ember-source. The init and the use stay consistent. Non-compat
scenarios don't need the plugin — modern ember-source uses
`isDevelopingApp()` from `@embroider/macros`, which `buildMacros()`
already handles.
2. ember-qunit@8 + @ember/test-helpers@4 rely on classic-Ember globals
that don't exist in a vite build: `start()` auto-calls `loadTests()`
which iterates `requirejs.entries`, and `visit` reads
`global.EmberENV._APPLICATION_TEMPLATE_WRAPPER`. Both were removed in
ember-qunit@9 and @ember/test-helpers@5 respectively. Bump those two
pins in the ember4 deps stanza so the scenario exercises the same
surface modern scenarios do:
ember-qunit: ^8.0.0 -> ^9.0.0
@ember/test-helpers: ^4.0.0 -> ^5.0.0
Both peer `ember-source >= 4.0.0`, so Ember 4.12 is still within the
supported range. ember-qunit@9 peers `@ember/test-helpers >=3.0.3`,
so the test-helpers bump stays within bounds.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent e965739 commit 0691d3f
4 files changed
Lines changed: 18 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
47 | 59 | | |
48 | 60 | | |
49 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments