Skip to content

Releases: dexie/Dexie.js

Dexie v4.0.1-alpha.8

17 Feb 08:42
Compare
Choose a tag to compare
Dexie v4.0.1-alpha.8 Pre-release
Pre-release

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

25 Jan 20:26
Compare
Choose a tag to compare
Dexie v4.0.1-alpha.7 Pre-release
Pre-release

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

23 Jan 13:15
Compare
Choose a tag to compare

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

Dexie v4.0.0-alpha.4

30 May 22:30
Compare
Choose a tag to compare
Dexie v4.0.0-alpha.4 Pre-release
Pre-release
  • Fix for #1576 Node.js process not exiting when Dexie.js is imported
  • PR #1559 Support for FileSystemDirectoryHandle when cloning

Dexie v4.0.0-alpha.3

27 Apr 13:40
Compare
Choose a tag to compare
Dexie v4.0.0-alpha.3 Pre-release
Pre-release

Security fix

Prohibit possible prototype pollution in Dexie.setByKeyPath() (1d655a6)

Bugfix

Fix #1473 Cannot use Dexie in react-native

A corresponding release 3.2.2 contains the same fixes for 3.x.

Dexie v3.2.2

27 Apr 13:39
Compare
Choose a tag to compare

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

16 Feb 13:16
Compare
Choose a tag to compare
  • 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

05 Jan 01:25
Compare
Choose a tag to compare
Dexie v3.2.1-beta.2 Pre-release
Pre-release

Should resolve #1439 and #1369 by extending the "exports" field to include "require" compliant version of dexie.

Dexie v4.0.0-alpha.1

05 Jan 01:23
Compare
Choose a tag to compare
Dexie v4.0.0-alpha.1 Pre-release
Pre-release

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 property this.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);
      }
    }