Releases: adopted-ember-addons/ember-cli-flash
1.4.3
release 1.4.3 (#232)
The road to 2.0.0
This patch release deprecates the use of injectionFactories
. Automatic injection is an anti-pattern that we are removing with this release, in favor of explicitly injecting the flashMessages
service into the things that need it.
Automatic injection will be removed in 2.0.0.
To prepare for the upgrade and fix deprecation warnings, simply directly inject the service into your classes and remove the injectionFactories
config (if any):
// foo-bar/component.js
export default Ember.Component.extend({
flashMessages: Ember.inject.service(),
actions: {
foo() { return Ember.get(this, 'flashMessages').success('foobar'); }
}
});
// config/environment.js
module.exports = function(environment) {
var ENV = {
flashMessageDefaults: {
// remove `injectionFactories`
}
}
}
[BUGFIX] Acceptance tests
This patch release fixes a bug where acceptance tests would fail due to an old blueprint. If upgrading, you may need to run the following:
$ ember g ember-cli-flash
Fluent API
This patch release adds a small feature to support method chaining. You can now do the following:
Ember.get(this, 'flashMessages')
.registerTypes(['meow'])
.clearMessages()
.add({ message: 'foo' })
.meow('nyan');
Compatibility
This minor release fixes a compatibility issue with other addons, due to the specific version range specified for ember-new-computed
. Thanks to @rwjblue for this fix.
Ember 2.x compatibility
This patch release is a small one that fixes an initializer deprecation warning in the Ember 2.x series. Thanks to @jamesdixon for the fix!
Test helper fix
Dependency fix
Restoring compatibility
This release restores compatibility with Ember 1.11.x
, thanks to @truenorth for this one!
Changelog
- #86 Restore 1.11.x compatibility by @truenorth
- #85 Upgraded ember-cli to 1.13.1 by @martndemus
Unit test all the things
This bugfix release fixes an issue where injecting the service into a unit test via needs: [ 'service:flash-messages' ]
would break due to the way the addon was naming its files.
For unit tests that require the flashMessages
service, you'll need to do a small bit of setup:
moduleFor('route:foo', 'Unit | Route | foo', {
needs: [ 'service:flash-messages' ],
beforeEach() {
const typesUsed = [ 'warning', 'success' ];
this.container.lookup('service:flash-messages').registerTypes(typesUsed);
}
});
If you're only using the add
method to add flash messages, you can skip this step.
Go forth and test your Ember apps!