-
Notifications
You must be signed in to change notification settings - Fork 439
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
Embroider support #2500
Embroider support #2500
Conversation
…in the consuming app
…onfiguring mirage
…o import from miragejs anyway
…handle how bad yarn is
b17be39
to
d9092e2
Compare
It's looking like this repo has been neglected long enough where the required changes to get everything working is going to require a good few PRs. |
d3f03ec
to
cddb424
Compare
21a5954
to
188f6bf
Compare
…ll, because @babel/core is unused by the babel that runs in the apps (for now) -- ember-cli-babel v8 will fix this
188f6bf
to
8825466
Compare
@NullVoxPopuli this looks promising! Please note I've made CI green in #2495. Then we could see if any other pieces could be split up. |
@NullVoxPopuli anything I can help with to get this PR work over the finish line? |
based on the conflicts, I think the PR has to start over. But if you want to take over, go for it |
This PR is exploring what it would take to properly support embroider for ember-cli-mirage.
There are a couple things that ember-cli-mirage is doing currently that are not compatible with how modern JS works:
mirage
folder lives outside the app, yet is expected to be able to import from the appmirage
folder is merged with theember-cli-mirage
addon, which is why files from the mirage folder cannot import from the appIt is reasonable that folks want to share constants / functions / whatever from their app with their mirage folder, so a goal of this PR is to figure out how to do that.
This PR will be large because it adds a new app:
03-embroider-app
undertest-packages
-- so a good chunk of the diff is boilerplate and lockfile.!! This is still in the exploratory phase
CI is running over in my fork: NullVoxPopuli#1
Breaking Changes
All pending, of course, just logging as I go
miragejs
is now a peer dependencyThis means that the consuming app must install miragejs.
This change happened because apps were importing from
miragejs
.If you import it, it must be declared (in the package.json)
The mirage folder is now in the
app
directorySetup is now in userland
create an app/initializers/setup-mirage.js
Configuration is now via
@embroider/macros
Mirage is disabled by default
Mirage is not a production tool, so it is disabled by default. to enable you can configure as above.
This allows folks to choose the logic by which mirage is enabled:
Embroider (temporarily) needs the compat adapter disabled
https://github.com/embroider-build/embroider/blob/main/packages/compat/src/compat-adapters/ember-cli-mirage.ts
the modulePrefix and podModulePrefix must manually be passed
This is for
discoverEmberDataModels
andapplyEmberDataSerializer
example: