Releases: dexie/Dexie.js
Dexie v4.0.1-alpha.8
Minor fix
Append sourceMappingUrl in minified files
This fix makes the all JS files in the dist folder have the source mapping file pointed out so that bundlers can generate a correct final map file for the application or library that bundles dexie into it.
If dexie was used without bundling it into the app, this change will have no benefit as chrome devtools is still able to locate the map files without the mapfile comment-line.
Dexie v4.0.1-alpha.7
Typings fix for Table.update(), Table.bulkUpdate() and Collection.modify()
In Dexie 4.0.1-alpha.6, Table.bulkUpdate() was introduced as well as improving the typings of Table.update(), Collection.modify() to using typescript template literals that would correcltly type the changes
argument and provide a nice code completion. However, there was a typings bug in this release that made the typings unusable for updating nested properties.
This version fixes the typings of Table.update(), Table.bulkUpdate() and Collection.modify() so that they work according to the expected format.
Requires Typescript 4.8 or later
The typings in this release requires Typescript 4.8 or later in order to accept numeric keypaths and allow updating individual array items.
The UpdateSpec type
A new type UpdateSpec<T>
is expected as the second argument to Table.update(). This type can also be imported from dexie when the library user need to build the updateSpec using custom code before finally send along to Table.update() or in an array keysAndChanges to Table.bulkUpdate().
import type { UpdateSpec } from 'dexie';
interface Contact {
name: string;
address: Address;
}
interface Address {
city: string;
street: string;
streetNo: number;
}
let updateSpec: UpdateSpec<Contact> = {};
updateSpec["address.streetNo"] = 44;
db.contacts.update(1, updateSpec);
Dexie v3.2.3
Bugfixes:
This was fixed for 4.x but with this release it is also fixed in the official latest stable version of dexie.
Dexie v4.0.1-alpha.6
News:
Typings:
- Revert to dexie 3 style Table<T, TKey>
- Updated Collection.filter type (PR 1658)
- feat(d.ts): creating hook subscriber return value
dexie-cloud addon (4.0.1-beta.26)
- Check BigInt availability without getting errors
- Bugfix when Buffer is polyfilled by webpack
- Imported rx operators wrong
- Bugfix default GUI fail if the JS is included in
- Bugfix "shopping card" use case: Failed to sync local data after logging in user
- Bugfix synk of ArrayBuffer data failed.
Other addons
- Release version-bumps of dexie-observable, dexie-syncable, dexie-export-import with updated deps to dexie@4.x.
Misc
- Stop testing on IE11
- Updated browser test matrix
- Converted to pnpm
- Removed some still-remaing uses of
indexedDB.cmp()
and make use of the faster js version everywhere - Removed link to feathub, as that app is gone
- Tests: Avoid Safari issue for IDBObjectStore.put()
- Vue sample: fix: lint error
- Vue sample: refactor: use vue composition api script setup syntax and vite
- Removing the "engines" field
Dexie v4.0.0-alpha.4
Dexie v4.0.0-alpha.3
Dexie v3.2.2
Security fix
Prohibit possible prototype pollution in Dexie.setByKeyPath() (1d655a6)
Bugfix
Fix #1473 Cannot use Dexie in react-native
A corresponding release 4.0.0-alpha.3 contains the same fixes for 4.x.
Dexie v3.2.1
- Workaround for issue #613: Automatically reopen IndexedDB connection in case it was unexpectedly closed, and redo the operation. When a transaction couldn't be created due to invalid state, Dexie will reopen the IndexedDB connection and retry creating the transaction.
- Resolves #1439 and #1369 by extending the "exports" field to include "require" compliant version of dexie.
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); } }