-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Refactor preprocessors to work with addons. #1030
Refactor preprocessors to work with addons. #1030
Conversation
* Create plugin subclasses to allow usage of inheritance, but still use custom `toTree` methods. * Make `preprocessJS` defer to the plugins `toTree` method (allows plugins to require from their own node_modules folder). * Make `preprocessTemplates` defer to the plugins `toTree` method (allows plugins to require from their own node_modules folder). These changes allow addons to add their own preprocessors during their `included` hook. Please review the following for implementation details on the addon side: * [ember-cli-esnext](https://github.com/rjackson/ember-cli-esnext/blob/master/index.js) * [sample app](rwjblue/_____ember-cli-test@4391e62)
|
||
function Registry(plugins, app) { | ||
this.registry = {}; | ||
this.availablePlugins = plugins; | ||
this.app = app; | ||
this.pluginTypes = { | ||
'js': JavascriptPlugin, |
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 we should aim to suppose multiple plugins per type, so people refactoring from coffee
-> js
can do so. My quick skim implies this isn't ?
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.
It is not supported by this PR, but it isn't impacted by it either (we didn't previously support it).
IMHO, I can add that as a refactoring after my round of addon stuff is done...
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.
sounds good!
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.
Added #1033 so we don't loose track.
…sure Refactor preprocessors to work with addons.
toTree
methods.preprocessJS
defer to the pluginstoTree
method (allows plugins to require from their own node_modules folder).preprocessTemplates
defer to the pluginstoTree
method (allows plugins to require from their own node_modules folder).These changes allow addons to add their own preprocessors during their
included
hook.Please review the following for implementation details on the addon side: