Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a simple deprecation for staticEmberSource: false #2245

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions packages/compat/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,19 @@ export default interface Options extends CoreOptions {
// apply.
staticAddonTestSupportTrees?: boolean;

// when true, we will load ember-source as ES modules. This means unused parts
// of ember-source won't be included. But it also means that addons using old
// APIs to try to `require()` things from Ember -- particularly from within
// vendor.js -- cannot do that anymore.
//
// When false (the default) we load ember-source the traditional way, which is
// that a big ol' script gets smooshed into vendor.js, and none of ember's
// public module API actually exists as modules at build time.
/**
* When true, we will load ember-source as ES modules. This means unused parts
* of ember-source won't be included. But it also means that addons using old
* APIs to try to `require()` things from Ember -- particularly from within
* vendor.js -- cannot do that anymore.
*
* When false (the default) we load ember-source the traditional way, which is
* that a big ol' script gets smooshed into vendor.js, and none of ember's
* public module API actually exists as modules at build time.
*
* Note: This setting will be removed in the next version of Embroider and
* will effectively default to true
*/
staticEmberSource?: boolean;

// Allows you to override how specific addons will build. Like:
Expand Down Expand Up @@ -114,6 +119,11 @@ export type CompatOptionsType = Required<
Pick<Options, 'staticHelpers' | 'staticModifiers' | 'staticComponents' | 'staticInvokables'>;

export function optionsWithDefaults(options?: Options): CompatOptionsType {
if (!options?.staticEmberSource) {
console.log(
`The setting 'staticEmberSource' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticEmberSource: true' in your Embroider config.`
);
}
return Object.assign({}, defaults, options);
}

Expand Down
Loading