-
Notifications
You must be signed in to change notification settings - Fork 143
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
Module resolver: virtualize test-support.js #1807
Module resolver: virtualize test-support.js #1807
Conversation
425215f
to
0c31ba0
Compare
44981c2
to
00e95a1
Compare
00e95a1
to
f61220a
Compare
…neration of test-support.js with the virtual entrypoint
|
||
function impliedAddonTestSupport(engine: Engine): string[] { | ||
let result: Array<string> = []; | ||
for (let addon of sortBy(Array.from(engine.addons.keys()), pkg => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can delete the sortBy. It was only being used by implicit-scripts
not implicit-test-scripts
, and now that this function only handles implicit-test-scripts
this part should never have an effect.
packages/core/src/module-resolver.ts
Outdated
|
||
if (!pkg?.isV2Ember()) { | ||
throw new Error(`bug: an import of ${request.specifier} in non-ember package at ${request.fromFile}`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this check, the check up above for being the first engine is sufficient.
Thanks, nice work! |
Virtualization of the test-support entry point.
This PR replaces the script tag
src="assets/test-support.js"
with the virtual entry pointsrc="@embroider/core/test-support"
in theindex.html
of the rewritten app. The content that was previously written inassets/test-support.js
is now generated by thevirtual-test-support
's functions.How to test
virtual-vendor
branch: