Skip to content

v0.4.13

Compare
Choose a tag to compare
@samselikoff samselikoff released this 24 Jan 13:25
· 1053 commits to master since this release
848f5f0

Update notes:

#1466 changed some existing behavior that I expect almost no one to be relying upon, but I could be wrong.

For no particular reason, when we originally coded the Db we had it sort new records by the id field.

This means if you had fixture files like

[
  { id: 2, name: 'Yehuda' },
  { id: 1, name: 'Tom' }
]

they would end up in Mirage's Db as [ { id: 1, name: 'Tom' }, { id: 2, name: 'Yehuda' } ].

We've changed this behavior so records are just added to the Db in the order they were at insertion time.

The only way this could affect your app or tests is if you are doing something like return schema.users.all(), and you're relying on the order of that response, and the source data is unsorted. (In general, if you're relying on an order, it's best practice for your query and/or route handler to specify that sort order with e.g. schema.users.sort((a, b) => b.title < a.title })).

I expect this undocumented behavior to not be something anyone is relying on. Please let me know if I'm wrong!

📝 Documentation

🚀 Enhancements

  • #1457 Allow native async functions as route handlers

🏠 Internal

  • #1466 Db doesn't automatically sort records anymore
  • #1456 Upgrade Ember CLI

View all commits: v0.4.12...v0.4.13