Upgrade to babel-plugin-ember-template-compilation v2#762
Conversation
| { | ||
| precompile, | ||
| // As above, we present the AST transforms in reverse order | ||
| transforms: [...pluginInfo.plugins].reverse(), |
There was a problem hiding this comment.
This new API uses forward order so the reverse() should not be needed.
There was a problem hiding this comment.
I'll double check, but without the reverse I believe I was seeing inverted execution order compared to what's on master
There was a problem hiding this comment.
Ok, well I trust your findings over my memory as long as you're checking.
There was a problem hiding this comment.
I think you're right, I think the plugin runs them in the order stated, but it's ember-cli-htmlbars that has always reversed them before handing them onward.
There was a problem hiding this comment.
Confirmed: if I register the test plugin twice and log from the PathExpression visitor, keeping the reverse() call preserves the same output ordering I see on master.
|
I tested this change out on a big app and a very big app, no problems EDIT: both apps are on 3.28 |
The 2.0 release of
babel-plugin-ember-template-compilationintroduces the ability for template AST transforms to manipulate JS scope, but it also reworked the plugin's options format slightly, so we need to adjust how we configure it here.Note: this diff is more legible with the "Hide whitespace changes" button, as a fair chunk of change in
utils.jsis moving logic we no longer need forbabel-plugin-ember-template-compilationunder the other arm of the surrounding conditional.I've tested this out in a couple medium-sized projects that are on Ember 3.27+, but I'd love extra 👀 (particularly from @ef4)