-
Notifications
You must be signed in to change notification settings - Fork 142
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
Move responsibility of booting the app from Embroider internals to the Ember app #1957
Conversation
0a017b4
to
b063489
Compare
b3d26ec
to
ac6a130
Compare
I think this PR should remove the support for |
1452428
to
bf49153
Compare
ae5593a
to
54b0cef
Compare
…er/ember-app-boot.js to the new app-boot.js file
8236571
to
6f393a8
Compare
6f393a8
to
0efc667
Compare
0efc667
to
6f2af28
Compare
88ffed3
to
3ea4714
Compare
expectAudit | ||
.module('./node_modules/my-addon/_app_/components/hello-world.js') | ||
.resolves('my-addon/components/hello-world') | ||
.to('./node_modules/my-addon/components/hello-world.js', 'remapped to precise copy of my-addon'); |
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 removed this assertion because I need to go through this resolve path anyway to test the content of my-addon/components/hello-world.js
in another test. So I simply moved the message "remapped to precise copy of my-addon" to a comment in that other test.
3ea4714
to
aa95998
Compare
window.define("my-app/components/second-choice", function () { | ||
return importSync("#embroider_compat/components/second-choice"); | ||
}); | ||
window.define("my-addon/synthetic-import-1", function () { | ||
return importSync("../synthetic-import-1"); | ||
}); | ||
import Component from '@ember/component'; | ||
import layout from '../templates/components/hello-world'; | ||
import computed from '@ember/object/computed'; | ||
import somethingExternal from 'not-a-resolvable-package'; | ||
import { importSync } from "@embroider/macros"; | ||
export default Component.extend({ | ||
dynamicComponentName: computed('useDynamic', function () { | ||
return this.useDynamic || 'default-dynamic'; | ||
}), | ||
layout | ||
}); |
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.
Do we want to keep asserting all the imports are present, or do we just want enough proof that this is the right file that has been loaded?
aa95998
to
9993260
Compare
The app-boot script is now part of the Ember app
This PR implements the 1st part of #1960:
virtual-entrypoint.ts
so the app-boot no longer happens in Embroider internals.index.html
andapp/app.js
files).How it drives the decision to stop the support of content-for "app-boot"
The app-boot script specifies instructions to boot the app. During the classic build, some Broccoli plugins and Ember libraries work together to generate the correct app-boot instructions, so it used to be something internal.
If you are an addon author and the way your addon works requires customizing the app-boot, you couldn't provide any configuration instructions to your users because they have no control over the app-boot anyway. But classic addons let you provide the required content yourself using the
contentFor
hook. There is an example in ember-cli-fastboot.With this PR, app developers now have control over the app-boot script: it's written directly in the
index.html
. Classic addons won't be able to impact this script, it will be the responsibility of the app.A new error message has been implemented so if the app uses at least one classic addon providing custom content for app-boot, an explanation about how to move the instructions on the app side will be displayed.