Skip to content

Commit 56c962b

Browse files
committed
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.
1 parent fd9a557 commit 56c962b

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

broccoli/amd-compat-entrypoints/ember-template-compiler.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ d('@ember/-internals/utils/index', emberinternalsUtilsIndex);
1818
import * as emberCanaryFeaturesIndex from '@ember/canary-features/index';
1919
d('@ember/canary-features/index', emberCanaryFeaturesIndex);
2020

21-
/*
21+
/*
2222
2323
The classic build included these modules but not their dependencies, so they
2424
never worked. Keeping this comment to document why the list of modules differs in
@@ -200,3 +200,7 @@ d('simple-html-tokenizer', simpleHtmlTokenizer);
200200
if (typeof module === 'object' && module.exports) {
201201
module.exports = emberTemplateCompilerIndex;
202202
}
203+
204+
console.log(
205+
'\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--------'
206+
);

broccoli/amd-compat-entrypoints/ember.debug.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,9 @@ d('rsvp', rsvp);
473473
if (typeof module === 'object' && typeof module.require === 'function') {
474474
module.exports = emberIndex.default;
475475
}
476+
477+
emberDebugIndex.deprecate(
478+
'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.',
479+
false,
480+
emberinternalsDeprecationsIndex.DEPRECATIONS.DEPRECATE_AMD_BUNDLES.options
481+
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,4 +405,4 @@
405405
}
406406
},
407407
"packageManager": "[email protected]"
408-
}
408+
}

packages/@ember/-internals/deprecations/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ export const DEPRECATIONS = {
112112
until: '7.0.0',
113113
url: 'https://deprecations.emberjs.com/id/importing-inject-from-ember-service',
114114
}),
115+
DEPRECATE_AMD_BUNDLES: deprecation({
116+
for: 'ember-source',
117+
id: 'using-amd-bundles',
118+
since: {
119+
available: '6.10.0',
120+
enabled: '6.10.0',
121+
},
122+
until: '7.0.0',
123+
url: 'https://deprecations.emberjs.com/id/using-amd-bundles',
124+
}),
115125
};
116126

117127
export function deprecateUntil(message: string, deprecation: DeprecationObject) {

0 commit comments

Comments
 (0)