[BREAKING] Remove AMD bundles (Ember 7.0)#21102
Closed
wagenet wants to merge 7 commits intoemberjs:mainfrom
Closed
[BREAKING] Remove AMD bundles (Ember 7.0)#21102wagenet wants to merge 7 commits intoemberjs:mainfrom
wagenet wants to merge 7 commits intoemberjs:mainfrom
Conversation
Implements RFC emberjs#1101 (Deprecate Ember Vendor Bundles). The four AMD bundles deprecated in 6.10.0 are now removed: - dist/ember.debug.js - dist/ember.prod.js - dist/ember-testing.js - dist/ember-template-compiler.js The ESM template compiler at dist/packages/ember-template-compiler/index.js is the only supported template compiler going forward. The use-ember-modules optional feature is now the only mode — all classic builds use ember-auto-import to consume ember-source as a v2 addon. - Remove AMD rollup build configs (legacyBundleConfig, templateCompilerConfig, amdDefineSupport, concatenateAMDEntrypoints, licenseAndLoader) - Delete broccoli/amd-compat-entrypoints/ and packages/loader/ - Make lib/index.js unconditionally use ESM paths - Remove DEPRECATE_AMD_BUNDLES deprecation entry (until: 7.0.0 reached) - Update package.json exports and files - Remove AMD-dependent node tests; update template-compiler-test for ESM - Update smoke-test babel configs to use ESM compiler path - Remove classicUseModulesFeature smoke-test scenario (now the only mode) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0504ed6 to
d6d1237
Compare
Contributor
Estimated Asset SizesDiff --- main/out.txt 2026-02-17 19:37:18.000000000 +0000
+++ pr/./pr-22201294522/out.txt 2026-02-19 21:43:30.000000000 +0000
@@ -1,15 +1,15 @@
╔═══════╤═══════════╤═══════════╗
║ │ Min │ Gzip ║
╟───────┼───────────┼───────────╢
-║ Total │ 351.99 KB │ 203.84 KB ║
+║ Total │ 351.79 KB │ 203.76 KB ║
╚═══════╧═══════════╧═══════════╝
╔══════════════════════╤═══════════╤═══════════╗
║ @ember/* │ Min │ Gzip ║
╟──────────────────────┼───────────┼───────────╢
-║ Total │ 313.39 KB │ 181.91 KB ║
+║ Total │ 313.2 KB │ 181.82 KB ║
╟──────────────────────┼───────────┼───────────╢
-║ -internals │ 36.65 KB │ 26.22 KB ║
+║ -internals │ 36.46 KB │ 26.13 KB ║
║ application │ 13.23 KB │ 8.05 KB ║
║ array │ 13.01 KB │ 7.46 KB ║
║ canary-features │ 304 B │ 389 B ║Details
|
…s paths, smoke-test deps
Three issues discovered after the AMD bundle removal:
1. @embroider/compat and babel-plugin-ember-template-compilation hardcode
`dist/ember-template-compiler.js`. Add an ESM re-export at that path plus
`dist/package.json` with `{"type":"module"}` so that Node 20.19+
`require(esm)` works on it without a separate CJS build.
2. The `implicit-modules` paths in `lib/index.js` for all `exposedDependencies()`
packages (@glimmer/*, @simple-dom/*, dag-map, route-recognizer, router_js, rsvp)
referenced non-existent flat `.js` files. The rollup build actually emits
these as `pkg/index.js` directories. This was masked by the AMD bundle
(which provided those AMD modules directly); without the bundle, AMD module
resolution for these packages was broken in classic and embroider/webpack builds.
3. The smoke-test app-template was using packages that access the `ember` barrel
(`@ember/test-helpers@3.x` via Ember._ContainerProxyMixin, `ember-qunit@8`
via Ember.Test.adapter) which throws in Ember 7.0. Update to:
- ember-cli-app-version@7 (uses @ember/-internals/metal directly)
- @ember/test-helpers@5.x (v2 addon, no barrel access)
- ember-qunit@9 (uses setAdapter/setTesting directly, no barrel)
- ember-qunit@9 removed loadTests() from start(); call it explicitly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
babel-plugin-ember-template-compilation auto-discovers the template compiler path, so the explicit compilerPath option is unnecessary. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
I'm trying to bring the node tests back over here: #21105 -- but as ESM |
Member
|
Def doesn't close #21089. |
The AMD removal commit deleted node tests that depended on loading dist/ember.debug.js globally. This restores them using ESM dynamic imports of the individual dist packages. Key additions: - tests/node/helpers/ember-esm.js: async loader caching all needed dist packages, including a compile() helper using precompile + createTemplateFactory - tests/node/helpers/build-owner.js: rewritten to accept modules object instead of the Ember barrel - tests/node/helpers/setup-component.js: async beforeEach using loadEmberModules() - tests/node/helpers/setup-app.js: async beforeEach using loadEmberModules() - tests/node/instrumentation-test.js: direct ESM import of instrumentation module - Restored unchanged: assert-html-matches.js, component-rendering-test.js, app-boot-test.js, visit-test.js The non-template-compiler dist packages leave @embroider/macros as a live external import (Embroider replaces it at app build time). Running them directly in Node.js causes isDevelopingApp() to throw. Fixed via a Node.js ESM loader hook (macros-loader.mjs) registered by NODE_OPTIONS in test:node, which redirects @embroider/macros to a stub returning true for debug flags. Test count: 50 → 69, all passing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kategengler
reviewed
Feb 20, 2026
| mkdirSync('dist', { recursive: true }); | ||
| writeFileSync('dist/package.json', JSON.stringify({ type: 'module' })); | ||
|
|
||
| // ESM re-export at the legacy path that @embroider/compat and babel-plugin hardcode |
Member
There was a problem hiding this comment.
From RFC Review: dist/package.json just with a type module is suspicious
Contributor
|
Open issues:
|
Contributor
|
Appreciate your efforts! This PR has been superseded by:
And has helped generate a number of PRs that progress us towards getting our v7 cleanup tytyty |
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
Implements RFC #1101 (Deprecate Ember Vendor Bundles). Partially addresses #21089.
The four AMD bundles deprecated in 6.10.0 are now removed for 7.0:
dist/ember.debug.jsdist/ember.prod.jsdist/ember-testing.jsdist/ember-template-compiler.jsAll classic builds now consume ember-source as a v2 addon via ember-auto-import. The
use-ember-modulesoptional feature is removed — the ESM module graph is the only mode.Changes
Core removal
rollup.config.mjs: Remove AMD build configs (legacyBundleConfig,templateCompilerConfig,amdDefineSupport, etc.). Adddist/package.json({"type":"module"}) anddist/ember-template-compiler.js(ESM re-export) so that@embroider/compatandbabel-plugin-ember-template-compilation, which hardcodedist/ember-template-compiler.js, can continue torequire()it via Node 20.19+'s unflaggedrequire(esm).broccoli/amd-compat-entrypoints/: Delete directorypackages/loader/: Delete package (only used by AMD bundles)lib/index.js: RemoveuseEmberModulesconditional — ESM paths are now unconditional. Fiximplicit-modulespaths for allexposedDependencies()packages (@glimmer/*,@simple-dom/*,dag-map,route-recognizer,router_js,rsvp): these were referenced as flat.jsfiles but the build emits them aspkg/index.jsdirectories.treeForVendornow creates empty shim files (renamedemberVendorShims) to satisfy ember-cli's expectation that these paths exist in vendor.js.package.json: Remove AMD bundle entries fromexportsandfiles; adddist/package.jsonanddist/ember-template-compiler.jstoexportsandfiles.packages/@ember/-internals/deprecations/index.ts: RemoveDEPRECATE_AMD_BUNDLES(until: 7.0.0 reached)tsconfig/compiler-options.json: Removerequirepath mapping (pointed to deleted loader types)types/publish.mjs: Remove loader fromREMAPPED_LOCATION_MODULEStests/node/helpers/ember-esm.jsloader. The non-template-compiler dist packages leave@embroider/macrosas a live external import (Embroider resolves it at app build time); a Node.js ESM loader hook (tests/node/helpers/macros-loader.mjs, registered viaNODE_OPTIONSintest:node) stubs it so packages are directly importable in Node.js. Tests covering FastBoot/SSR rendering, server-side component rendering, and instrumentation are all present and passing.compilerPathfrom babel configs (auto-discovered bybabel-plugin-ember-template-compilation); removeclassicUseModulesFeaturescenario. Update app-template to packages that don't access theemberbarrel (ember-cli-app-version@7,@ember/test-helpers@5,ember-qunit@9); callloadTests()explicitly (ember-qunit@9 removed it fromstart()).Test plan
pnpm lint— passespnpm build:types— passespnpm type-check— passespnpm vite build --mode=development— passespnpm test— 8684 pass, 23 skip, 0 failpnpm build && pnpm test:node— 69 passpnpm test:blueprints— passesALL_DEPRECATIONS_ENABLED=true pnpm test— passesOVERRIDE_DEPRECATION_VERSION=15.0.0 pnpm test— passesclassic-basics,embroiderWebpack-basics,embroiderVite-basics) — all pass🤖 Generated with Claude Code