Skip to content

Releases: adopted-ember-addons/ember-cli-flash

The road to 2.0.0

18 Feb 23:02
Compare
Choose a tag to compare

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

15 Nov 21:39
Compare
Choose a tag to compare

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

05 Nov 00:51
Compare
Choose a tag to compare

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

26 Oct 16:40
Compare
Choose a tag to compare

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

14 Oct 21:23
Compare
Choose a tag to compare

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

03 Sep 18:32
Compare
Choose a tag to compare

This patch release fixes an issue where the test helper would cause a JSHint error due to an unused variable.

Changelog

#93 Update ember-cli and dependencies
#95 Make jshint pass on test-helper.js – @blimmer

Dependency fix

13 Jul 14:47
Compare
Choose a tag to compare

This PATCH release fixes an issue where 1.3.2 would break builds by not installing ember-new-computed as a dependency. Thanks to @raytiley for reporting!

Changelog

#89 Moved ember-new-computed to dependencies instead of devDependencies by @poteto

Restoring compatibility

12 Jul 04:51
Compare
Choose a tag to compare

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

07 Jul 17:05
Compare
Choose a tag to compare

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!

Preventing duplicates

02 Jul 00:11
Compare
Choose a tag to compare

In 1.3.0, you can now set an option to prevent duplicate flash messages from being added to the service. First, you'll need to add an preventDuplicates option to your config as follows:

module.exports = function(environment) {
  var ENV = {
    flashMessageDefaults: {
      preventDuplicates: true
    }
  }

If true, only 1 instance of a flash message (based on its message) can be added at a time. For example, adding two flash messages with the message "Great success!" would only add the first instance into the queue, and the second is ignored.

Changelog
  • e98cdf5 [BUGFIX] Add active class to flash messages upon DOM insertion - @truenorth
  • ea75fa0 [BUGFIX] Fixed wrong method name in test helper blueprint - @poteto
  • cdba483 [FEATURE] Adds the ability to prevent duplicate messages from being added - @poteto