-
-
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
Fix embroider builds #432
Fix embroider builds #432
Conversation
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.
Thanks a lot for working on this. The solution looks good to me. But just to be safe I would prefer to land fixes to CI first.
A test scenario for Embroider would also be great. But not sure if adding one before upgrading dependencies would cause a lot additional work. If so, merging without would be fine for me.
@jelhan I looked into enabling embroider test scenarios, and as you suspected they are difficult to set up with such old dependencies, so I gave up. Also, as I discovered over in my other PR upgrading dependencies, the embroider scenarios don't pick up this failure because this only fails when building under embroider and excluding the mirage files from the build. I briefly looked into adding an ember-try scenario that excludes embroider files, but that messed up the tests that The good news is that I manually verified that this fixes the embroider-but-no-mirage-files build issue. I totally understand wanting to wait until CI is fixed, and I have a workaround for the issue in my app, so I wouldn't object either way. FWIW, my workaround is adding this to my app's webpack config (although I don't use the mirage helpers at all, so I was able to just do this unconditionally which made it easier): module: {
rules: [
{
include: [
/\/ember-file-upload\/mirage\//,
],
use: 'null-loader',
},
],
}, |
@bendemboski Please rebase 🙇 |
@bendemboski could you please rebase and push so that the new CI can run 🙇 If you don't I'll open a new PR with your changes soon so that we can get ahead of the embroider release. |
Embroider builds fail when mirage's files are not included in the build (e.g. production builds) because our mirage helper module's static import fails to resolve. So import dynamically inside the handler function when we know mirage's files must be present.
57aefe2
to
d93e652
Compare
@gilest I rebased, but the optimized scenario is failing, which I was worried might happen. I don't know if it's possible to get embroider to support this kind of dynamic importing from I think the real solution is probably conditionally including this file in the build, as discussed here. I'm not sure if there's really a way to support optimized settings as long as |
Thoughts on a way forward with this @bendemboski ? I see the issues and PRs in |
@gilest I'd have to pack this all back into my head to be certain, but I'm fairly sure that the best path forward would be to port this solution to |
@bendemboski Thanks! With this guidance I've staged #567 |
Embroider builds fail when mirage's files are not included in the build (e.g. production builds) because our mirage helper module's static import fails to resolve. So import dynamically inside the handler function when we know mirage's files must be present.