Releases: dexie/Dexie.js
Dexie v3.2.1-beta.2
Dexie v4.0.0-alpha.1
The initial release on 4.0. Currently pretty much identical to 3.2.1+ but with:
- More precise typings for Collection.modify() and Table.update() using template literal types for keyPaths.
- Typings: Table.add() and Table.put() won't require methods to be present on the object to add. Allows for adding POJO objects rather than having to construct the full class to add a row.
- Typings of Table generic: A property name can be used as 2nd generic argument (TKey) rather than the direct type. This will infer the key type from the type of that property and make it optional in Table.add() and Table.put() (see sample below)
- New class exported class
Entity
that can be optionally used as a base class in order to resolve dependency issues when mapping tables to classes. A subclass of Entity has a private propertythis.db
which is the Dexie instance it originates from.Entity
subclasses are not meant to be constructed by application code.export class Friend extends Entity<FriendsDB> { id!: number; name!: string; age!: number; birthday() { return this.db.friends.update(this.id, friend => ++friend.age); } } export class FriendsDB extends Dexie { friends!: Table<Friend, 'id'>; constructor() { super("FriendsDB"); this.version(1).stores({ friends: '++id, name, age' }); this.friends.mapToClass(Friend); } }
Dexie v3.2.1-beta.1
Contains a workaround for Chrome issue #613. Needs to be tested in the field a while before we can release this publicly.
Dexie v3.2.0
Dexie.js has become Reactive
After one year in alpha, beta and RC, Dexie.js with liveQuery() is now officially released. The main reason for this new feature is better integration with frontend libraries like React, Svelte, Vue and Angular.
Together with this release, the website https://dexie.org also got a face lift with tutorials for React, Svelte, Vue and Angular.
dexie.org
Take a look past the updated website. Old tutorials are replaced with modern relevant framework specific ones. We've added React, Svelte, Vue and Angular samples on the landing page.
All changes since 3.0.3 in chronological order
- PR 1104: dbName follows dependencies.indexedDB (II)
- Option
{allKeys: true}
to bulkPut() and bulkAdd() will be equally fast as not providing that option. - Code cleanup and optimizations.
- Expose IDB 'close' event: #1212
- BulkError: Possible to track individual errors. Add failuresByPos property: #1209
- Dexie.getDatabaseNames(): Small optimization for our workaround for non-chromium browsers lacking the IDBFactory.databases(). commit.
- Argument to on.ready() callback will get a special Dexie instance that is not blocked (vip Dexie). This was the case also before but then we had to rely on zone state. This change makes it possible to perform non-dexie operations in on.read() callback (such as fetch()), loosing the zone state (PSD) but still have VIP access to the Dexie instance. This makes the code in a on.ready() callback not having to deal with wrapping all non-Dexie calls with Promise.resolve().
- Allow multiple calls to Version.upgrade() on the same version - will run all of them instead just of the latest registered.
- Retiring old workaround for safari 8 bug not allowing array argument to IDBDatabase.transaction().
- Dexie.delete() specifies an empty addons list to ensure no addons are involved when deleting a database using that static method.
- Minor extended the DBCore interface to make it possible for Dexie Cloud to sync certain operations consistently. Specifically, middlewares that implement the DBCoreTable.mutate() endpoint now also gets information on the where-critera and the update specification when originating from Collection.modify() or Collection.delete().
- Support for Chrome's transaction durability option in Dexie constructor. PR #1367
- Official event Dexie.on('storagemutated')
- Typings: Stop exporting Dexie as namespace. Enables VSCode's ergonomic auto-import feature for dexie. The namespace export was not even working as expected. The intent had been to support those that code Typescript without using modules. But even they must have been disappointed because the typings did not only reveal parts of the Dexie API.
- Let liveQuery() be type-wise compable with RxJS (PR #1417)
- Switch to JS implementation of indexedDB.cmp() (PR #1412)
Fixed Bugs since 3.0.3 in chronological order
- #1195 The 'update' crud-hook interpreted array properties as object with number keys.
- #1280 Cannot add CryptoKeys to table with auto-incrementing primary key
- Typing correction: Fix version signatures (PR #1287)
- Fix #1236 - problems updating FileSystemFileHandle properties.
- Bugfix: Transaction.abort() does not rollback changes (filed as a repro PR in #1329). Fixed in PR #1330.
- Bugfix in Virtual Indexes (the reuse of compound indexes as plain indexes): Couldn't reuse parts of primary keys - only parts of indexes.
- PR #1379 fix(bulk-delete): correctly define keys type. Fixes #1364.
- Bugfix for #1381 Collection.delete() fails silently for queries on virtual indexes that use .filter().
- Deleting multiple tables in a new version using null (#1418)
- (Another) mysterious MissingAPI error (#1400)
Dexie v3.2.0-rc.3
Dexie v3.2.0-rc.2
Two minor changes:
- Typings: Stop exporting Dexie as namespace. Enables VSCode's ergonomic auto-import feature for dexie. The namespace export was not even working as expected. The intent had been to support those that code Typescript without using modules. But even they must have been disappointed because the typings did not only reveal parts of the Dexie API.
- Bugfix: #1397 Safari 14 fix breaks fakeIndexedDB
Dexie v3.2.0-rc.1
This release is candidate for a new stable dexie release with liveQuery()
support.
Documentation is underway.
- Official event Dexie.on('storagemutated')
- Bugfix for #1381 Collection.delete() fails silently for queries on virtual indexes that use .filter().
- PR #1379 fix(bulk-delete): correctly define keys type. Fixes #1364.
Dexie v3.2.0-beta.3
Support for Chrome's transaction durability option in Dexie constructor
const db = new Dexie("TestDBTrans", { chromeTransactionDurability: 'relaxed' });
PR #1367
Dexie v3.2.0-beta-2
Minor updates required for addons to integrate easier in db.on('ready') to give special (vip) access to the db while initial sync or authentication is still going on (before db.open() promise finally resolves, as it won't resolve until all db.on('ready') subscribers finish their work, but they themselves will need to interact with the db to finish their work).
We are still in beta until decided whether PR #1244 should be completed before determining the official API for the undocumented liveQuery()
and txcommitted
event.
Note however that the useLiveQuery() API is stable no matter where we decide with PR #1244 and the not yet settled API with the similar name liveQuery()
that backs useLiveQuery ().
Dexie v3.2.0-beta.1
This release contains the changes and bugfixes needed to make dexie-cloud-addon able do its job. Se details below.
Bumping middle version number due to subtle changes in a few API:s.
Using DBCore.transaction()
Before, we didn't call DBCore.transaction() internally to allow middlewares to intercept transaction creation. This PR corrects that and also added a second argument for which tables / object stores to include in the transaction. This allows for DBCore middlewares to inject code into both implicit and explicit transactions.
Supplying more information to DBCoreTable.mutate().
DBCoreMutateRequest has been extended with optional parameters criteria
and changeSpec
. This allows for middlewares to understand the intent of the mutation (which range-query that was the criteria for the change, and which properties that is meant to be updated). For Dexie Cloud, this feature makes it possible perform consistent operations across peers and maintain offline consistency for range- or index based calls to Collection.modify() and Collection.delete().
Bugfix in virtual index
Couldn't reuse parts of primary keys - only parts of indexes.
Safari workaround: Mutations in a service worker weren't propagated to liveQuery() in browser windows.
Dexie's liveQuery() functionality broadcasts changes using BroadcastChannel which is not supported on Safari. To workaround this, we've so far been using localStorage/onstorage to communicate changes across tabs. This workaround was eventually broken with the latest release of Safari where localStorage became broken when having multiple tabs open. Also the workarond didn't solve broadcasting changes between service worker and tabs/windows. This change makes mutations that are made in the service worker propagate to all service worker clients - which can be tabs/windows or other workers, so that liveQuery() observables will emit correctly when changes are made in the service worker - also on Safari. For other browsers, this hasn't been a problem.
Other changes:
- Dexie.delete() specifies an empty addons list to ensure no addons are involved when deleting a database using that static method.
- Correcting typescript Observable interface to better comply with RxJs.
- Retiring old workaround for safari 8 bug not allowing array argument to IDBDatabase.transaction().
- Allow multiple calls to Version.upgrade() on the same version - will run all of them instead just of the latest registered.
- Argument to on.ready() callback will get a special Dexie instance that is not blocked (vip Dexie). This was the case also before but then we had to rely on zone state. This change makes it possible to perform non-dexie operations in on.read() callback (such as fetch()), loosing the zone state (PSD) but still have VIP access to the Dexie instance. This makes the code in a on.ready() callback not having to deal with wrapping all non-Dexie calls with Promise.resolve().