From 4f164b5bfc3812eb43fa70f3a611ff203fd1e7d0 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Sun, 2 Apr 2023 21:15:47 -0400 Subject: [PATCH 1/4] Correctly detect where modules loop back to AMD from webpack Fixes #504. Removes earlyBootSet, because that was a hack for the lack of this feature. earlyBootSet never actually worked correctly anyway. I'm considering this a bugfix and not a breaking change, since nobody could reliably use that setting anyway. --- packages/ember-auto-import/README.md | 1 - packages/ember-auto-import/ts/auto-import.ts | 1 - packages/ember-auto-import/ts/bundler.ts | 2 +- packages/ember-auto-import/ts/package.ts | 12 - .../ts/tests/inserter-test.ts | 1 + packages/ember-auto-import/ts/webpack.ts | 218 ++++++------------ test-scenarios/v2-addon-test.ts | 13 -- 7 files changed, 74 insertions(+), 174 deletions(-) diff --git a/packages/ember-auto-import/README.md b/packages/ember-auto-import/README.md index ab0d3ec8a..5e1e0c6d9 100644 --- a/packages/ember-auto-import/README.md +++ b/packages/ember-auto-import/README.md @@ -126,7 +126,6 @@ let app = new EmberApp(defaults, { Supported Options - `alias`: _object_, Map from imported names to substitute names that will be imported instead. This is a prefix match by default. To opt out of prefix-matching and only match exactly, add a `$` suffix to the pattern. -- `earlyBootSet`: _function, returning an array of strings_, (only supported on ember-source >= 3.27.0) defaults to undefined, but when used, the function will receive the default earlyBootSet, which is a list of common modules found at the source of rare timing / package / ordering issues in the compatibility / cross-communication between requirejs and webpack. This is a temporary escape hatch to allow non-embroider apps to consume v2 addons at any place in their dependency graph to help ease transitioning to embroider as this problem doesn't occur once an app is using embroider. See [issue#504](https://github.com/ef4/ember-auto-import/issues/504) for details. Note that if any modules listed here belong to v2 addons, they will be removed from the set. To opt out of default behavior, return an empty array. - `exclude`: _list of strings, defaults to []_. Packages in this list will be ignored by ember-auto-import. Can be helpful if the package is already included another way (like a shim from some other Ember addon). - `forbidEval`: _boolean_, defaults to false. We use `eval` in development by default (because that is the fastest way to provide sourcemaps). If you need to comply with a strict Content Security Policy (CSP), you can set `forbidEval: true`. You will still get sourcemaps, they will just use a slower implementation. - `insertScriptsAt`: _string_, defaults to undefined. Optionally allows you to take manual control over where ember-auto-import's generated `