-
Notifications
You must be signed in to change notification settings - Fork 137
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
Enforce correct plugin order in addon-dev #2136
Conversation
|
||
babel({ babelHelpers: 'bundled' }), | ||
|
||
addon.hbs(), |
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 babel must be the last. whats the issue with the order?
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.
ah, I see, thats how the blueprint is.
But the recent PR changed hbs & gjs plugins to use transform hook. So the order of the blueprint must be changed.
the tests in embroider were already at correct order before the change... I wonder why it wasnt the same order in the blueprint
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.
looks like the PR i did was more of a breaking change then?
ah, but it was included into a breaking release anyway.
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.
Yeah, exactly. It should have at least a notice on the breaking change in the changelog. But I think it could be fixed maybe, trying this out in this draft PR! Will ping you once I'm ready.
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.
well, the blueprint should really have the babel plugin as last.
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.
@patricklx ready to go now, see the PR description!
well, the blueprint should really have the babel plugin as last.
We can still decide to make that change in the blueprint if we feel this is the safer path forward. But the change in this PR makes this optional, which I think is better than forcing this on users by running into build errors...
Weird, |
Canary is not really the current canary. #2073 |
nvm, the passing scheduled job was for |
b2a875d
to
8f53b7a
Compare
The recent release of
addon-dev@v6
was bringing in an undocumented breaking change (which by itself would be ok, since this was a new major) as #2121 required a specific plugin order, where babel has to come last, or at least after hbs and gjs.The first commit here aligned the plugin order in tests to what we have in the addon-blueprint, where babel comes before hsb and gjs. I think we should keep these in sync, as that would have uncovered the breaking change!
After that change, you can see here how the babel plugin fails to parse the (untransformed) gjs file. Same happens in the PR to update deps in the addon-blueprint: embroider-build/addon-blueprint#299
We could tell users to change the plugin order, but that causes a lot of churn, as basically every v2 addon out there has the order as in the blueprint. And I think ideally from DX perspective would be good if the order didn't matter to users.
This PR enforces the hbs and gjs plugins to run before others (including babel).
Btw, for the hbs plugin, I believe this shouldn't really be needed in 99%+ of cases, only when you have hbs transforms registered via
babel-plugin-ember-template-compilation
, which we had in our tests.