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

Remove usage of registerPlugin / unregisterPlugin #661

Merged
merged 1 commit into from Feb 26, 2021

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Feb 26, 2021

These APIs force Ember to use global mutable state (the list of plugins) and require some pretty gnarly cache busting techniques to avoid having addons break each other (due to the global mutable state leaking from one addon to another).

In order to discourage this mutable state issue, Ember has deprecated usage of Ember.HTMLBars.registerPlugin and Ember.HTMLBars.unregisterPlugin (as of Ember 3.27).

This PR changes all invocations to pass the required AST transforms directly in to the compiler invocation (instead of calling registerPlugin before hand), and allows us to continue working properly while avoiding the deprecation (and that evil mutable state).

References:

These APIs force Ember to use global mutable state (the list of plugins)
and require some pretty gnarly cache busting techniques to avoid having
addons break each other (due to the global mutable state leaking from
one addon to another).

In order to discourage this mutable state issue, Ember has deprecated
usage of `Ember.HTMLBars.registerPlugin` and
`Ember.HTMLBars.unregisterPlugin` (as of Ember 3.27).

This PR changes all invocations to pass the required AST transforms
directly in to the compiler invocation (instead of calling
`registerPlugin` before hand), and allows us to continue working
properly while avoiding the deprecation (and that evil mutable state).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant