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

[DEPRECATE] registerPlugin / unregisterPlugin and legacy class based AST plugins #19429

Merged
merged 1 commit into from Feb 25, 2021

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Feb 25, 2021

The usage of registerPlugin/unregisterPlugin requires global state mutation which leaks AST plugins between addon's and applications. Tools like Embroider and ember-cli-htmlbars have avoided this by ensuring that we purge the Node module caching system between each attempt at using the template compiler. This results in massive memory growth (the entire ember-template-compiler.js source string is included in memory for each addon in the build, as well as any JIT artificats).

This is very bad.

This PR deprecates using registerPlugin/unregisterPlugin along with the legacy AST transform API. All of these APIs are private APIs (as is anything to do with the template compilation AST), but they are used fairly often so a proper deprecation cycle is useful.

Related:

…sed AST plugins

The usage of `registerPlugin`/`unregisterPlugin` **requires** global
state mutation which leaks AST plugins between addon's and applications.
Tools like Embroider and ember-cli-htmlbars have avoided this by
ensuring that we purge the Node module caching system between each
attempt at using the template compiler. This results in _massive_ memory
growth (the entire `ember-template-compiler.js` source string is
included in memory for each addon in the build, as well as any JIT
artificats).

This is **very _bad_**.

This PR deprecates using `registerPlugin`/`unregisterPlugin` along with
the legacy AST transform API. All of these APIs are private APIs (as is
anything to do with the template compilation AST), but they are used
fairly often so a proper deprecation cycle is useful.
@rwjblue rwjblue merged commit 3aff3c5 into master Feb 25, 2021
@rwjblue rwjblue deleted the deprecate-global-plugin-state branch February 25, 2021 16:20
@rwjblue
Copy link
Member Author

rwjblue commented Feb 26, 2021

ember-cli/ember-cli-htmlbars#661 should resolve the deprecation for ember-cli-htmlbars.

@rwjblue
Copy link
Member Author

rwjblue commented Feb 26, 2021

For folks seeing the registerPlugin / unregisterPlugin deprecation message during compilation, update to ember-cli-htmlbars@5.6.0 or higher.

See https://github.com/ember-cli/ember-cli-htmlbars/releases/tag/v5.6.0 for more details.

@lifeart
Copy link
Contributor

lifeart commented Aug 26, 2021

Is any reference on how to rewrite plugin and ember-cli integration? Deprecation messages is not really clear (

registerPlugin is deprecated, please pass plugins directly via `compile` and\or `precompile`

looks like registerPlugin is internal API, have no idea how to change it for:

image

@knownasilya
Copy link
Contributor

https://github.com/DockYard/ember-maybe-in-element also has this issue

k-fish added a commit to getsentry/sentry-javascript that referenced this pull request Oct 4, 2021
As noted in #4015, a registerPlugin deprecation is now caused by @sentry/ember because of the Ember version upgrade. As mentioned here, emberjs/ember.js#19429 updating htmlbars should fix this.
AbhiPrasad pushed a commit to getsentry/sentry-javascript that referenced this pull request Oct 4, 2021
As noted in #4015, a registerPlugin deprecation is now caused by @sentry/ember because of the Ember version upgrade. As mentioned here, emberjs/ember.js#19429 updating htmlbars should fix this.
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

4 participants