Releases: bookshelf/bookshelf
Releases · bookshelf/bookshelf
0.14.0
0.14.0 Dec 09, 2018 - Diff
Breaking changes
- The
previous()
andpreviousAttributes()
methods were changed so that whenever a model is saved or destroyed the previous attributes are no longer reset to the current attributes. Since the old behavior wasn't very useful it's likely this won't cause issues for many people. There's a migration guide in case you are affected by this change. #1848 - Fix incorrect results in collection when models have duplicate ids. Checkout the migration guide in case you are affected by this. #1846
- Empty
hasOne
relation will now returnnull
instead of{}
when serialized: #1839. There's a migration guide in the rare event this causes you problems. - Add more helpful error messages on bad or insufficient
morphTo
data: #1824. There's a migration guide in case you are affected by this. - Changed the existing functionality so that saving a model that hasn't changed will not update its
updated_at
attribute: #1798. Checkout the migration guide in case you are affected by this.
Enhancements
Bug fixes
- Return clones of nested objects in
previousAttributes()
: #1876 - Fix incorrect
rowCount
value when usinggroupBy
withfetchPage()
: #1852 - Fix eager loading of relations when using
parse
/format
: #1838 - Fix inability to install bookshelf from git commit: #1835
- Fix
timestamp()
setting a key named"null"
in some cases: #1820 - Fix performance of including relationships: #1800
Test Suite
- Add test to check for adding
withRelated
inside events: #1853 - Add Node.js 10 to the Travis config: #1829
- Fix incorrect output ordering in tests in some cases: #1825
Documentation
- Change the JSDoc theme to add a Guides section (this was already released): #1909
- Fix
hasOne
's doc: #1890 - Fix many-to-many tutorial code: #1888
- Add code syntax highlighting for tutorials: #1850
- Fix a few issues with the collection documentation: #1836
- Fix
Model.load()
relations param: #1834 - Fix incorrect docs for collection:fetching event: #1831
- Add note on needing the Pagination plugin to use
fetchPage()
: #1803 - Fix incorrect data types and undocumented Model property: #1797
Dependencies
0.13.3
0.13.3 Mar 26, 2018 - Diff
Potentially breaking changes
- Saving a model that hasn't changed will not update its
updated_at
attribute. This was included in a patch release because the chances of any applications depending on this behavior are very small: #1798
Bug fixes
- Clean up automatic timestamps feature: #1798
Documentation
- Expand documentation of the automatic timestamps feature: #1798
0.13.2
0.13.0
0.13.0 Mar 18, 2018 - Diff
Breaking changes
- Make
require: true
the default when deleting models: #1779 - Remove the second argument to the model's destroyed event handler: #1777
- Events are now triggered sequentially even when the handlers execute asynchronous code: #1768
- Drop support for Node versions older than 4: #1696
- Reorder
saving
andcreating
events to reflect the documentation: #1142
Enhancements
- Only request
returning
attribute if client supportsreturning
: #1770 - Throw error if user doesn't pass a valid Knex instance on initialize: #1756
- Add parameterized virtual properties to virtuals plugin: #1755
- Add individual attribute processor plugin to core: #1741
- Format
idAttribute
on save and delete: #1680 - Add
withSchema
option to all database operations: #1638 - Add a case converter plugin to core: #1093
Bug fixes
- Fix inconsistent timestamp values between save and fetch: #1784
- Set
model.id
if attributes being.set()
contain a parsed version ofidAttribute
: #1760 - Fix pagination plugin's
fetchPage()
ignoring or hanging with transactions: #1625 - Fix
fetchPage()
from pagination plugin not working for relation collections: #1561 - Don't try to update
idAttribute
if it hasn't changed: #1260
Test suite
- Increase timeout of the large arrays test: #1778
- Add test to verify that
parentId
is not undefined when usingfetchAll
with relations: #1769 - Fixes and general improvements to the test suite: #1753
- Remove OracleDB tests: #1744
- Fix invalid test related to dirty attributes: #1312
Documentation
- Improve docs about running tests: #1761
- Fix typo on parse-and-format tutorial: #1748
- Add Bookshelf Manager to list of community plugins: #1747
Dependencies
0.12.1
0.12.1 Jan 8, 2018 - Diff
- Lots of documentation fixes and updates:
- Fix incorrect value of second argument to model event handlers: #1723
- Fix incorrect return value from
.detach()
: #1720 - Fix incorrect return value from
model.has()
: #1712 - Fix
fetching:collection
andfetched:collection
not being generated or visible on the navigation bar: #1114 - Update contributing document and issue templates: #1736
- Add more information and links to Parse and Format docs: #1727
- Add bookshelf-ez-fetch to Community Plugins: #1708
- Add bookshelf-default-select to Community Plugins: #1706
- Add information and examples about calling
super()
on model'sinitialize()
: #1529 - Add npm version badge to readme: f4dd792
- Fix inability to attach belongsToMany relation to models fetched with
fetchAll()
: #1716 - Fix foreign key = 0 not fetching related object: #1639
- Fix unparsed
previousAttributes
for related models: #1457 - Update some dependencies: #1734, #1733, #1732, #1728, #1726
0.12.0
0.12.0 Nov 27, 2017 - Diff
- Skip visibility-plugin
hidden
andvisible
attributes #1699.- Used w/
<model>.toJSON({ visibility: false })
- Used w/
- Updated knex peer dependency version to 0.14.x #1694.
- Documentation typo fixes #1693.
- Now caching
node_modules
to speed up travis-ci builds #1695. - Use Docker containers for test runs #1674.
- Make
postpublish
work regardless of git remote config #1697.
0.11.1
0.11.0
0.11.0 Nov 15, 2017 — Diff
- Moved
.babelrc
->src/.babelrc
#1470 - Timestamp on save now utilizes a date option for timestamp updates on insert and update. #1592
- Used in options on save like so:
m.save({item: 'test'}, { date: dateInThePast })
- Used in options on save like so:
- Added
morphValues
formorphTo
relation. #1326 - Added ability to also set timestamps as model attributes in save. #
- Removed non-production files from packaging / added them to .npmignore #1679
- Development Facing
- Oracle tests only run when oracle is installed.
- Refactoring on the registry plugin
- Updated a lot of documents related to repo organization.
0.10.4
Changes in this version:
- Allow knex 0.13.x
- Use uuid instead of node-uuid
- Test Bookshelf with Node v7
- Updated Author info in package.json
- Remove lodash from build script
- Add OracleDB integration tests
- Add opportunity to override
visible
andhidden
behaviour for toJSON function - Do not load belongsTo if foreignKey is null
- Optimise
timestamp
function: respect updated_at/created_at being part of the query - Fix
fetchPage
on Collection (pagination plugin) - Fixing virtuals when
omitNew=true
- Lot's of typo fixes and documentation updates
Full changelog:
0.10.3
Changes in this version:
- Drop Node support for 0.10 and 0.12
- Trigger creating event for attached models
- Add support for uninstantiated models relations
- Add foreignKeyTarget to relation methods
Full changelog:
0.10.2...0.10.3