From 56c962b0f303ccf8ce2dd6c3df3acdfdbd487112 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Tue, 25 Nov 2025 14:43:08 -0500 Subject: [PATCH] Deprecate amd bundles #21009 added the optional feature to use ES modules instead of AMD bundles, this follows up by emitting a deprecation if you don't do that. --- .../amd-compat-entrypoints/ember-template-compiler.js | 6 +++++- broccoli/amd-compat-entrypoints/ember.debug.js | 6 ++++++ package.json | 2 +- packages/@ember/-internals/deprecations/index.ts | 10 ++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/broccoli/amd-compat-entrypoints/ember-template-compiler.js b/broccoli/amd-compat-entrypoints/ember-template-compiler.js index b47ea1714a4..06f1a57d9aa 100644 --- a/broccoli/amd-compat-entrypoints/ember-template-compiler.js +++ b/broccoli/amd-compat-entrypoints/ember-template-compiler.js @@ -18,7 +18,7 @@ d('@ember/-internals/utils/index', emberinternalsUtilsIndex); import * as emberCanaryFeaturesIndex from '@ember/canary-features/index'; d('@ember/canary-features/index', emberCanaryFeaturesIndex); -/* +/* The classic build included these modules but not their dependencies, so they never worked. Keeping this comment to document why the list of modules differs in @@ -200,3 +200,7 @@ d('simple-html-tokenizer', simpleHtmlTokenizer); if (typeof module === 'object' && module.exports) { module.exports = emberTemplateCompilerIndex; } + +console.log( + '\n\n--------\n+ Your app is using the legacy ember-template-compiler.js AMD bundle. This will be removed in ember-source 7.0. See https://deprecations.emberjs.com/id/using-amd-bundles for more details.\n--------' +); diff --git a/broccoli/amd-compat-entrypoints/ember.debug.js b/broccoli/amd-compat-entrypoints/ember.debug.js index 0f333b80ffa..ca11d1708df 100644 --- a/broccoli/amd-compat-entrypoints/ember.debug.js +++ b/broccoli/amd-compat-entrypoints/ember.debug.js @@ -473,3 +473,9 @@ d('rsvp', rsvp); if (typeof module === 'object' && typeof module.require === 'function') { module.exports = emberIndex.default; } + +emberDebugIndex.deprecate( + 'Your app loaded Ember via a legacy AMD bundle. Opt into loading it from the modern ES modules by setting the use-ember-modules optional feature.', + false, + emberinternalsDeprecationsIndex.DEPRECATIONS.DEPRECATE_AMD_BUNDLES.options +); diff --git a/package.json b/package.json index 9287d907065..d762b6a1441 100644 --- a/package.json +++ b/package.json @@ -405,4 +405,4 @@ } }, "packageManager": "pnpm@10.5.0" -} +} \ No newline at end of file diff --git a/packages/@ember/-internals/deprecations/index.ts b/packages/@ember/-internals/deprecations/index.ts index b68b84b616e..89ad88ed625 100644 --- a/packages/@ember/-internals/deprecations/index.ts +++ b/packages/@ember/-internals/deprecations/index.ts @@ -112,6 +112,16 @@ export const DEPRECATIONS = { until: '7.0.0', url: 'https://deprecations.emberjs.com/id/importing-inject-from-ember-service', }), + DEPRECATE_AMD_BUNDLES: deprecation({ + for: 'ember-source', + id: 'using-amd-bundles', + since: { + available: '6.10.0', + enabled: '6.10.0', + }, + until: '7.0.0', + url: 'https://deprecations.emberjs.com/id/using-amd-bundles', + }), }; export function deprecateUntil(message: string, deprecation: DeprecationObject) {