In general, it's good to run ember g ember-cli-mirage
after upgrading.
Update notes:
-
There was a bug where dasherized multiword serializers and fixtures were not registered correctly. This has been fixed, so if you happen to have camelized multiword serializers or fixtures
/mirage/serializers/blogPost.js /mirage/fixtures/blogPosts.js
you can rename these to dasherized names
/mirage/serializers/blog-post.js /mirage/fixtures/blog-posts.js
In Mirage 0.2, all filenames should be dasherized, following the conventions of Ember CLI. If you ever encounter a situation where this doesn't work, please file an issue, as this is a bug.
Changes:
- [ENHANCEMENT] Better blueprints
- [BUGFIX] Ensure multiword dasherized serializers work #333
- [BUGFIX] Ensure multiword dasherized fixtures work
Update notes:
Serializer#relationships
was renamed toSerializer#include
.
Before:
export default Serializer.extend({
relationships: ['comments']
});
After:
export default Serializer.extend({
include: ['comments']
});
- We now use
destroyApp
test helper in Ember-CLI to shutdown the Mirage server after each test to resolve a memory leak reported in #226. It's important to runember g ember-cli-mirage
when upgrading to take advantage of this fix. - Inserting records with numerical IDs that have already have been used will throw an error per changes from #417
model.type
was renamed tomodel.modelName
, and is dasherized (instead of camelized)
Changes:
- [BREAKING CHANGE] POST and PUT shorthands require a Serializer#normalize function, and will transform your attrs to camelCase. (If you're using JsonApiSerializer or ActiveModelSerializer, this is done for you). To keep using the db yourself, write custom POST and PUT route handlers.
- [BREAKING CHANGE] Serializer#relationships was renamed to Serializer#include #424 @lolmaus
- [BREAKING CHANGE] Change
model.type
tomodel.modelName
, ensure it's dasherized #454 - [BREAKING CHANGE] Inserting records with numerical IDs that have already have been used will throw an per changes from #417
- [BREAKING CHANGE] DB stores ids as strings #462 @jherdman
- [BREAKING CHANGE] GET shorthand with single owner and many children throws an error.
- [BREAKING CHANGE] Arrays in shorthands should always contain singularzied model names (e.g. dasherized)
- [FEATURE] Add
?include
query param support in JSONAPISerializer @lolmaus - [FEATURE] Add
build
&buildList
to factories #459 @ballpointpenguin - [ENHANCEMENT] JSONAPISerializer defaults to dasherized types and relationships (and other JSONAPI enhancements) @lolmaus
- [ENHANCEMENT] shutdown Mirage server on destroyAppp @blimmer
- [ENHANCEMENT] createList perf enhancement @alvinvogelzang
- [ENHANCEMENT] improve DB autoincrement @jherdman
- [FEATURE] Allow nested factory objects @john-kurkowski
- Other bugfixes/enhancements @jherdman, @ef4, @seanpdoyle, @alecho, @bekzod
Update notes:
- Move
/app/mirage
to/mirage
Changes:
- [FEATURE] ORM, Serializers
- [ENHANCEMENT] @heroiceric
- [BREAKING CHANGE] missing routes will now throw an Error instead of logging to the Logger's
error
channel.
Update notes: none
Changes:
- [BUGFIX]
Update notes: none
Changes:
- [BUGFIX]
Update notes:
- When this library first came out, you defined routes using
this.stub('get', '/path'...)
in yourmirage/config.js
file.stub
has been removed, so if you happen to be using it, just replace those calls with thethis.get
,this.post
, etc. helper methods. - If you happen to be using the orm (it's private + not ready yet), know that there were some changes to how the data is stored. Contact me if you want to upgrade.
Changes:
- [BREAKING CHANGE] remove #stub from Server (see update note) @samselikoff
- [FEATURE] add
.passthrough
API @samselikoff - [FEATURE] add
.loadFixtures
API @samselikoff - [FEATURE] add .random.number.range to faker @iamjulianacosta
- [IMPROVEMENT] better missing route message @blimmer
- [IMPROVEMENT] upgrade Ember CLI 1.13.8 @blimmer
- [IMPROVEMENT] improve logging @gaborsar
- [IMPROVEMENT] cleanup @jherdman
- [BUGFIX] fixup blueprints @samsinite
- [BUGFIX] fix ie8 bug @jerel
- [BUGFIX] avoid dep warning in Ember 2.x @mixonic
Update notes: none
Changes:
- [BUGFIX] remove console.log from server.js
Update notes:
- We use
ember-inflector
from NPM now, so after upgrading you should removeember-inflector
from your bower.json.
Changes:
- [ENHANCEMENT] Add support for fully qualified domain name @jamesdixon
- [IMPROVEMENT] upgrade Ember CLI, Pretender 0.9 @cibernox @blimmer
- [IMPROVEMENT] use ember-inflector from NPM @alexlafroscia @eptis
- [IMPROVEMENT] note requirement of .bind @brettchalupa
Update notes:
-
If you happened to be manipulating db objects using object references instead of the db API, e.g.
let contact = db.contacts.find(1); contact.name = 'Gandalf';
this will no longer work, as the db query methods now return copies of db data. This was considered a private API. You'll need to use the db api (e.g.
db.update
) to make changes to db data.
Changes:
- [ENHANCEMENT] add PATCH to mirage @samselikoff
- [ENHANCEMENT] update Faker to 3.0, expose all methods @blimmer
- [ENHANCEMENT] add basics of orm layer @samselikoff
- [IMPROVEMENT] general refactorings @makepanic @cibernox
Update notes: none
Changes:
- [BUGFIX] fixtures bug @bantic
- [BUGFIX] jshint on blueprint files @dukex
- [BUGFIX] allow beta to break build @bantic
Update notes:
- If you run the generator to update deps, the blueprint will put a file under
/scenarios/default.js
. The presence of this file will mean your fixtures will be ignored during development. If you'd still like to use your fixtures, delete the/scenarios
directory.
Changes:
- [IMPROVEMENT] factory-focused initial blueprints
Update notes: none
Changes:
- [ENHANCEMENT] #29 add faker + list helpers @mupkoo
- [IMPROVEMENT] upgrade ember cli to 0.2.7 @blimmer
- [BUGFIX] #167 allow ids of 0 @samselikoff
- empty release
Update notes: none
Changes:
- [IMPROVEMENT] remove unrelated folders from npm @mupkoo
- [BUGFIX] allow testConfig to be optional @samselikoff
Update notes: none
Changes:
- [ENHANCEMENT] Ability to use factories to seed development database @g-cassie
- [ENHANCEMENT] Ability to specify test-only Mirage routes @cball
- [BUGFIX]
db.where
now coerces query params to string @cibernox - [BUGFIX] #146 fix es6 template bug with blueprint
Update notes: none
Changes:
- [BUGFIX] fix url with slash before ? @knownasilya
Update notes: none
Changes:
- [ENHANCEMENT] 'coalesce' option to support GET multiple ids @cibernox
- [ENHANCEMENT] #117 db.find supports array of ids @samselikoff
- [BUGFIX] #115 IE8 safe @samselikoff
- [BUGFIX] can remove collection then add records again @seawatts
- [IMPROVEMENT] automatically add server to .jshint @bdvholmes
- [IMPROVEMENT] use lodash.extend instead of jQuery.extend @seawatts
- [IMPROVEMENT] use 200 HTTP code if responseBody exists @cibernox
- [IMPROVEMENT] better logging @bdvholmes
Update notes: none
Changes:
- [IMPROVEMENT] remove
tmp
dir from git @ahmadsoe - [BUGFIX] ensure string ids that start with ints can be used @cibernox
Update notes: none.
Changes:
- [ENHANCEMENT] #70 Allow function route handler to customize status code, HTTP headers and data. See the wiki for details.
- [BUGFIX] #81 Include assets in dev build, in case users visit /tests
from
ember s
. - [BUGFIX] smarter id coercion in controller @mikehollis
- [IMPROVEMENT] import mergeTrees and funnel @willrax @cibernox
- [IMPROVEMENT] better status code lookup @cibernox
- [IMPROVEMENT] use ember-try @willrax
- npm is hard :(
Update notes: The config options force
or disable
aren't support anymore, please use enabled
as explained here: https://github.com/samselikoff/ember-cli-mirage/wiki/Configuration#enabled
Changes:
-
[BREAKING CHANGE] There's no more
force
ordisable
option, simply specifyENV['ember-cli-mirage'].enabled = [true|false]
in whichever environment you need to override the default behavior.
-
[ENHANCEMENT] #51 Adds generators:
ember g factory contact
andember g fixture contacts
-
[ENHANCEMENT] Allow response logging in tests via
server.logging = true
-
[BUGFIX] #66 ignore query params in shorthands
Update notes: None.
Change:
- #53 allow arbitrary factory attrs
- #50 do not use Mirage if /server/proxies dir exists
- load fixtures in test environment if no factories exist
Update notes:
-
Rename your
/app/mirage/data
directory to/app/mirage/fixtures
. -
Move your
/tests/factories
directory to/app/mirage/factories
. -
store
, the data cache your routes interact with, has been renamed todb
and its API has changed.Your shorthand routes should not be affected, but you'll need to update any routes where you passed in a function and interacted with the store.See the wiki entry for more details, and the new API.
Changes:
- [BREAKING CHANGE] Rename
/data
directory to/fixtures
. - [BREAKING CHANGE] Move
/tests/factories
directory toapp/mirage/factories
- #41 [BREAKING CHANGE] Renamed
store
todb
, and changed API. See the wiki entry. - #42 [ENHANCEMENT] Add ability to change timing within tests, e.g. to test the UI on long delays.
- #6 [ENHANCEMENT] Add ability to force an error response from a route.
- [ENHANCEMENT] Return POJO from route
- [BUGFIX] ignore assets if Mirage isn't being used
Update notes:
This project has been renamed from ember-pretenderify to ember-cli-mirage. Please update your package.json
dependency accordingly, and
-
rename the
/app/pretender
dir to/app/mirage
-
if you have factories, change
import EP from 'ember-pretenderify';
to
import Mirage from 'ember-cli-mirage';
Changes:
- #26 [ENHANCEMENT] Added support for factory inheritance
- #36 [BUGFIX] Fix bug where createList didn't respect attr overrides @ashton
- #37 [INTERNAL] Add tests for createList @cibernox
- #35 [INTERNAL] Return [] from store#findAll
- Deprecation notice for new name.
Hotfix for #34, no changes require to update.
Update notes:
- the testing API has changed. Before, you used
store.loadData
, now you use factories. See the Getting Started guide below for an example, or the factories wiki page for the full API.
Changes:
- Basic factory support
Update notes:
-
the testing API has changed. Before, you added data directly to
serverData
, e.g.serverData.contacts = [{id: 1, name: 'Link'}];
Now, use the store directly:
store.loadData({ contacts: [{id: 1, name: 'Link'}] });
-
this
in your config file no longer refers to the Pretender instance; usethis.pretender
instead.
Changes:
- [FEATURE] you can use
this.get
,this.post
,this.put
andthis.del
instead ofthis.stub(verb)
now - bug fixes + refactoring
Update notes: None.
Changes:
- actually fix bower package version of inflector
Update notes: None.
Changes:
- fix bower package version of inflector
Update notes: None.
Changes:
- clean up [string].pluralize calls
Update notes:
- Run
bower install
. This brings alongember-inflector
as a separate package. - This update contained one or more breaking changes (see below).
Changes:
- [breaking change] If you happen to be using
store.find(type)
to return a collection (e.g. without anid
), usestore.findAll(type)
instead - Various updates/refactorings to store
- Don't log server responses during testing
- Use standalone ember-inflector package, no more dependency on ember data
Update notes:
-
Before, the following was part of the install:
Testing
In your
tests/helpers/start-app.js
,import pretenderifyTesting from '../../ember-pretenderify/testing'; export default function startApp(attrs) { ... pretenderifyTesting.setup(application); return application; }
You no longer need this code, so just delete it all from the
start-app
file. The server will automatically instantiate via the initializer during tests.
Changes:
- fixed bug with stub#delete (so it works more than once. hah.)
- instantiate server in initializer