Pick legacy-inspector-support entry by ember-source version#320
Merged
NullVoxPopuli merged 1 commit intoember-cli:nvp/its-vite-timefrom Apr 19, 2026
Conversation
The min-supported try-scenario was failing with:
[vite]: Rollup failed to resolve import "@ember/enumerable/mutable"
from ".../@embroider/legacy-inspector-support/src/modules-4-12.js"
`@embroider/legacy-inspector-support` ships three entry points sharded by
ember-source range:
- ember-source-3.28 → Ember < 4.8 (uses legacy mutable-enumerable path)
- ember-source-4.8 → Ember 4.8–4.11 (adds @ember/enumerable/mutable)
- ember-source-4.12 → Ember >= 4.12 (also adds @ember/owner)
test-app/app/app.js was hard-coded to the 4.12 entry, so the min-supported
scenario (ember-source ~4.2.0) pulled in modules-4-12.js, which imports
`@ember/enumerable/mutable` — a module that doesn't exist in Ember 4.2.
Use macroCondition + dependencySatisfies + importSync from @embroider/macros
to pick the right entry at build time based on the installed ember-source.
The macros compile the untaken branches away, so each try scenario only
pulls in the import graph it can actually resolve.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
98674b0
into
ember-cli:nvp/its-vite-time
18 of 20 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
min-supportedtry-scenario on #317:@embroider/legacy-inspector-supportships three entry points, each paired with its ownmodules-*.jstailored to a different ember-source range:ember-source-3.28< 4.8@ember/-internals/runtime/lib/mixins/mutable_enumerableember-source-4.8>= 4.8 < 4.12@ember/enumerable/mutableember-source-4.12>= 4.12@ember/enumerable/mutable+@ember/ownertest-app/app/app.jswas hard-coded toember-source-4.12, so themin-supportedscenario (which installsember-source: ~4.2.0) ended up pulling inmodules-4-12.js→@ember/enumerable/mutable, which doesn't exist in Ember 4.2. Rollup couldn't resolve it and the build failed.Use
macroCondition+dependencySatisfies+importSyncfrom@embroider/macros(already a devDependency) to select the entry at build time based on the installedember-sourceversion:The macros compile the untaken branches away, so each try scenario only brings the import graph that its installed ember-source can satisfy.
Test plan
min-supported(ember-source ~4.2.0) goes green — picks the3.28entryember-lts-5.12/ember-lts-6.4/ember-latest/ember-beta/ember-alphastill pick the4.12entry and remain greenember-lts-4.12picks the4.12entry — note: that scenario has a separate, unrelated failure (Rollup failed to resolve import "require"in@ember/test-helpers/-internal/build-registry.js) that this PR does not address🤖 Generated with Claude Code