Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.2.4
->^4.0.0
Release Notes
dexie/Dexie.js (dexie)
v4.0.1
: Dexie v4.0.1Compare Source
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, Collection.modify() and Table.update() 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: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 objectsto add() and put() with only data properties.
If using Dexie Cloud, there's a
DexieCloudTable<T>
generic that will declare the implicit Dexie Cloud properties on the entity correctly for insert- and output types:A solution to dependency issues with mapped classes
In dexie 3, a mapped class that needs to access the database from its methods, will needs to access the a
db
instance. But it is a bit awkward to tie a method body to the same instance exported from thedb
module. For example, having two instances of db with different constructor parameters would not work as both would use one of the instances from their method bodies.In Dexie 4.0, this is solved using a lightweight dependency injection. There is a generic class
Entity
that your classes may extend from in order to get your database instance injected as a protected propertydb
on every entity instance. Your class methods can then perform queries onto the db without being dependant on thedb
module of your app. This use case will require a subclassed Dexie declaration though. There will still be cyclic import dependencies but only on the type level.Breaking Changes
No IE11 support
No support for Internet Explorer 11, legacy Edge (non-chromium) nor legacy Safari below version 14.
v3.2.7
: Dexie v3.2.7Compare Source
Bugfix: Removed invalid dependency. Dexie has no dependencies #1924
NOTE: Prepare for dexie@4.0.1 release candidate soon! It will have better stability by working around various browser issues and nicer version handling.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.