-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Clear mirage deprecations #664
Clear mirage deprecations #664
Conversation
42bf812
to
eb244bf
Compare
eb244bf
to
46b7e43
Compare
Thanks a lot for your contribution!
An alternative would be to pull the Mirage support out in a separate package before landing this changes as discussed in #641. This would make it less risky to include Using Embroider macros |
Ok, I took a pass at doing this with macros, however due to embroider-build/embroider#199 this will fail unless both |
173c81a
to
1af8783
Compare
I've added the optional peer dependencies and squashed commits, it looks like the embroider tests are hanging now though. Not sure if they need a restart or more attention. I'm going to run them locally and see what happens. |
Have restarted the CI for you 🤞🏻 |
Looks like something is still wrong with the import:
|
I ran the embroider test locally to see what I can debug. Quite interesting, Presumably something to do with the way/format So (besides still using a deprecated re-export) it actually does work with: const { Response } = importSync('ember-cli-mirage'); We could even move forward with that since it's deprecated until v3 (although not ideal). Thoughts @SergeAstapov @jrjohnson |
@gilest tried to debug on my local and can't see why embroider (or Tried to use |
I think I have seen an issue, which sounds similar if sub-dependencies pull in older versions of Embroider. In that case it was fixed by pinning recent Embroider version using yarn resolutions feature. Maybe something you want to try out here as well. |
I just finished creating a simple as possible reproduction which also fails with a brand new v4 addon and just started a discord conversation. I'm at a loss.
v3 is imminent. So hopefully a way forward can be found that is compatible. |
de6985e
to
c6764a6
Compare
In v3.x functions from miragejs will no longer be exported by mirage and must be pulled directly from miragejs. The configuration system has been modified to match the upstream expectations and by more explicit as well. Using embroider macros we can detect if ember-cli-mirage and miragejs are present and only include this code when that is true. For our own local tests we then add mirage as a dev dependency and require it as an optional peer dependency so embroider will know how it should work.
c6764a6
to
e2b447d
Compare
Well moving Annoyingly removing EAI from the resolutions fixes some, but breaks other scenarios. Hopefully there is an in between that will work. |
e2b447d
to
adafdeb
Compare
I think we stepped into grey zone of eai + I wonder if failure caused by any < v1.12 |
This is painful ❤️ – what about moving it to dependencies and pinning it 😅 |
this would be major version bump as consuming apps would have to migrate to e-a-i@2. Alternative option is to add e-a-i@2 to dependencies only in |
All current changes are being bundled into v5 until we can stand up a new docsite anyway.
😅 wouldn't this cause problems for consumers using embroider? |
Not sure 100% tbh, I would check in real app to be confident, however high chances you are right. |
This is required for the importSync embroiderr macro to work.
adafdeb
to
dcebe61
Compare
VICTORY 😤!!! In all my messing around I'd left EAI at 2.0 instead of ^2.0. Now that it's allowed to drift to 2.4 everything works as intended. I'm so happy I could scream. |
oh, so outdated version of EAI was the reason? can we now move it back to |
Unfortunately not @SergeAstapov, according to embroider-build/embroider#1091 it has to be in |
ahhhh, I see. |
Thank you both for your help with this 😍 |
In v3.x functions from miragejs will no longer be exported by mirage and
must be pulled directly from miragejs (which I've added as a development dependency here).
The configuration system has been modified to match the upstream
expectations and by more explicit as well.
It seems like
miragejs
would probably need to get pushed out as a dependency or peedDependency in order to be imported from theaddon
directory, however I'm not sure what impact that would have on the build of the consuming app, how to document peerDependencies (as they aren't used much), or if there is a way around this.I think the best path may be to remove
Response
and ship it as a local object which meets the interface needs of mirage, that's not usually a great idea though. Open to all suggestions!