-
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
Addon configuration. #1972
Addon configuration. #1972
Conversation
Implements: ember-cli#1907 A new `config` hook is available for addons. It can be used to alternate application configuration (example: toggling FEATURE flags for Ember) or to read the current config and change addon behaviour (example: importing dependencies conditionally). Interface: ``` // environment - 'development', 'test', 'production' // currentConfig - hash with config for given environment config: function(environment, currentConfig) {} ```
There will be more PR's incoming, but this gets us moving in the correct direction (and lands addon configuration merging). |
@@ -182,6 +183,10 @@ EmberApp.prototype._notifyAddonIncluded = function() { | |||
}, this); | |||
}; | |||
|
|||
EmberApp.prototype.configureAddons = function() { | |||
// do something that will make addon `config` hook to fire |
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.
For me that's the important part but not sure how to make it happen.
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.
Just to confirm, you want the configuration to be available within the included hook, right?
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.
So that you can tailor what is included based on the full addon + app config.
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.
Refactored this to Project.prototype.config
(and removed this configureAddons
function). If you need the configuration in an addon's included
hook, call this.project.config(this.app.env)
.
f9a2455
to
bc8c749
Compare
bc8c749
to
b0c240a
Compare
👍 |
config
hook for addons #1914.updateCache
method.Project.prototype.configPath
.Project.prototype.getAddonConfig
.Project.prototype.config
to merge addon config with application config.