Bump dexie from 3.2.7 to 4.0.1
Bumps dexie from 3.2.7 to 4.0.1.
Release notes
Sourced from dexie's releases.
Dexie v4.0.1
Dexie 4 Stable
After 3 years is alpha and beta, and a week in RC, Dexie@4 is finally out!
Cache
Non-transactional live queries utilize memory cache to assist in query resolution. It is possible to opt-out from using the cache using the option
{cache: 'disabled'}
. The cache can greatly improve simple pure range-based live queries and reduce the queries towards IndexedDB by reusing common queries from different components. The cache will be continously developed and optimized further to improve the new paging support in Dexie 5.0.Workarounds for flaky browsers
Dexie 4 catches various issues in the IndexedDB support for Chrome and Safari. Without dexie@4 tranasactions and write operations can suddenly fail in modern versions of Chrome and Safari but dexie makes sure to protect the end user from experience any issues. It does this by reopening the database or redoing the transaction when these things happen - all without the developer having to worry about it. See issues #543 and #613. (A close upcoming release on the 4.0-track will also address #1660 and #1829).
Supports Dexie Cloud
With Dexie 4.0, you can optionally use dexie-cloud-addon and connect your local database with a cloud based database. Dexie Cloud is a complete solution for authorization and synchronization of personal data with support for sharing data between users.
Improved Typing
Dexie 4 has some improved typing. Specifically, https://github.com/dexie/Dexie.js/blob/HEAD[https://github.com/dexie/Dexie.js/blob/HEADChttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADehttps://github.com/dexie/Dexie.js/blob/HEADchttps://github.com/dexie/Dexie.js/blob/HEADthttps://github.com/dexie/Dexie.js/blob/HEADihttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADnhttps://github.com/dexie/Dexie.js/blob/HEAD.https://github.com/dexie/Dexie.js/blob/HEADmhttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADdhttps://github.com/dexie/Dexie.js/blob/HEADihttps://github.com/dexie/Dexie.js/blob/HEADfhttps://github.com/dexie/Dexie.js/blob/HEADyhttps://github.com/dexie/Dexie.js/blob/HEAD(https://github.com/dexie/Dexie.js/blob/HEAD)https://github.com/dexie/Dexie.js/blob/HEAD]https://github.com/dexie/Dexie.js/blob/HEAD(https://github.com/dexie/Dexie.js/blob/HEADhttps://github.com/dexie/Dexie.js/blob/HEAD/https://github.com/dexie/Dexie.js/blob/HEADdhttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADchttps://github.com/dexie/Dexie.js/blob/HEADshttps://github.com/dexie/Dexie.js/blob/HEAD/https://github.com/dexie/Dexie.js/blob/HEADChttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADehttps://github.com/dexie/Dexie.js/blob/HEADchttps://github.com/dexie/Dexie.js/blob/HEADthttps://github.com/dexie/Dexie.js/blob/HEADihttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADnhttps://github.com/dexie/Dexie.js/blob/HEAD/https://github.com/dexie/Dexie.js/blob/HEADChttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADehttps://github.com/dexie/Dexie.js/blob/HEADchttps://github.com/dexie/Dexie.js/blob/HEADthttps://github.com/dexie/Dexie.js/blob/HEADihttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADnhttps://github.com/dexie/Dexie.js/blob/HEAD.https://github.com/dexie/Dexie.js/blob/HEADmhttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADdhttps://github.com/dexie/Dexie.js/blob/HEADihttps://github.com/dexie/Dexie.js/blob/HEADfhttps://github.com/dexie/Dexie.js/blob/HEADyhttps://github.com/dexie/Dexie.js/blob/HEAD(https://github.com/dexie/Dexie.js/blob/HEAD)https://github.com/dexie/Dexie.js/blob/HEAD) and https://github.com/dexie/Dexie.js/blob/HEAD[https://github.com/dexie/Dexie.js/blob/HEADThttps://github.com/dexie/Dexie.js/blob/HEADahttps://github.com/dexie/Dexie.js/blob/HEADbhttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADehttps://github.com/dexie/Dexie.js/blob/HEAD.https://github.com/dexie/Dexie.js/blob/HEADuhttps://github.com/dexie/Dexie.js/blob/HEADphttps://github.com/dexie/Dexie.js/blob/HEADdhttps://github.com/dexie/Dexie.js/blob/HEADahttps://github.com/dexie/Dexie.js/blob/HEADthttps://github.com/dexie/Dexie.js/blob/HEADehttps://github.com/dexie/Dexie.js/blob/HEAD(https://github.com/dexie/Dexie.js/blob/HEAD)https://github.com/dexie/Dexie.js/blob/HEAD]https://github.com/dexie/Dexie.js/blob/HEAD(https://github.com/dexie/Dexie.js/blob/HEADhttps://github.com/dexie/Dexie.js/blob/HEAD/https://github.com/dexie/Dexie.js/blob/HEADdhttps://github.com/dexie/Dexie.js/blob/HEADohttps://github.com/dexie/Dexie.js/blob/HEADchttps://github.com/dexie/Dexie.js/blob/HEADshttps://github.com/dexie/Dexie.js/blob/HEAD/https://github.com/dexie/Dexie.js/blob/HEADThttps://github.com/dexie/Dexie.js/blob/HEADahttps://github.com/dexie/Dexie.js/blob/HEADbhttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADehttps://github.com/dexie/Dexie.js/blob/HEAD/https://github.com/dexie/Dexie.js/blob/HEADThttps://github.com/dexie/Dexie.js/blob/HEADahttps://github.com/dexie/Dexie.js/blob/HEADbhttps://github.com/dexie/Dexie.js/blob/HEADlhttps://github.com/dexie/Dexie.js/blob/HEADehttps://github.com/dexie/Dexie.js/blob/HEAD.https://github.com/dexie/Dexie.js/blob/HEADuhttps://github.com/dexie/Dexie.js/blob/HEADphttps://github.com/dexie/Dexie.js/blob/HEADdhttps://github.com/dexie/Dexie.js/blob/HEADahttps://github.com/dexie/Dexie.js/blob/HEADthttps://github.com/dexie/Dexie.js/blob/HEADehttps://github.com/dexie/Dexie.js/blob/HEAD(https://github.com/dexie/Dexie.js/blob/HEAD)https://github.com/dexie/Dexie.js/blob/HEAD) use template literals to suggest code completion and type checking of keypaths to update.
Distinguish insert- from output types
The type passed to db.table.add() can be different from the type returned from db.table.get() and tb.table.toArray(). This mirrors reality better since some properties may be optional when adding (such as an auto-incremented primary key or dexie-cloud properties
realmId
andowner
).The generic type
Table<T, TKey>
is extended with a 3rd optional parameterTInsertType
making it possible to declare a table as such:class MyDB extends Dexie { friends!: Table< { id: number; name: string; age: number }, // T (id is always there) number, // TKey (type of primary key) { id?: number; name: string; age: number } // TInsertType (id is optional) >; }
A new helper generic
EntityTable<T>
also exists as a "don't repeat yourself" sugar on top of this, and will also omit any method on the type. In case the type is a mapped class with helper methods, you are still able to pass simple POJO objects to add() and put() with only data properties.interface Friend { id: number; name: string; age: number; } class MyDB extends Dexie { friends!: EntityTable<Friend, 'id'>; // Automatically makes id optional when adding and picks its TKey type. } </tr></table>
... (truncated)
Commits
-
396b884
Build output -
5894f19
Merge remote-tracking branch 'origin/releases' -
f7d3708
Releasing v4.0.1 -
77a7f59
Releasing dexie-cloud-addon@4.0.1 (stable) -
cc4962b
Releasing dexie-cloud-addon@4.0.1-rc.3 -
1c4328e
Restart websocket flow if persistedSyncState isnt loaded -
33fdadd
Fix tmp error on logout: cannot read undefined (serverRevision) -
3265585
Releasing dexie-cloud-addon@4.0.1-rc.1 -
057b257
Remove yarn.lock from todo-app example -
03b027d
Build output - Additional commits viewable in compare view
Dependabot commands
You can trigger Dependabot actions by commenting on this MR
-
$dependabot recreate
will recreate this MR rewriting all the manual changes and resolving conflicts