Skip to content
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

Pass AST Plugins to each compile #119

Closed
rwjblue opened this issue Feb 23, 2018 · 4 comments
Closed

Pass AST Plugins to each compile #119

rwjblue opened this issue Feb 23, 2018 · 4 comments

Comments

@rwjblue
Copy link
Member

rwjblue commented Feb 23, 2018

This would need to detect Ember version, and when possible avoid calling registerPlugin (which mutates closure scope and requires bizarre cache clearing shenanigans). Instead of registerPlugin we would pass the plugins directly to the compile invocation (in options.plugins.ast).

Related to #116.

@rwjblue
Copy link
Member Author

rwjblue commented Dec 11, 2019

Implemented in #130, but needs a bit of a rebase in order to be able to land.

@fivetanley
Copy link
Contributor

@rwjblue Does this mean that I would be able to write an ember addon that registers an ember-cli-htmlbars plugin and it would affect the compilation output of all the addons included in an app (vs just the app's templates)? If so I'd be happy to take a stab at rebasing #130.

Copy link
Member Author

rwjblue commented May 18, 2020

@fivetanley - No it isn't quite exposing that capability, though it could be leveraged to do so (I think). This is specifically talking about _pre_registration of AST plugins taht we do, which ultimately mutates global state inside the evaluated ember-template-compiler.js. Because of that mutation, we are forced to bust the cache and re-require ember-template-compiler.js many times (resulting in non-trivial build cost, memory bloat, etc).

@rwjblue
Copy link
Member Author

rwjblue commented Mar 7, 2021

Implemented in #661

@rwjblue rwjblue closed this as completed Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants