Pre-release

@dfahlander dfahlander released this Jun 3, 2018 · 11 commits to master since this release

Assets 2

Overview of Changes

  • Improved Database Upgrading (see "Details" below)
  • Improved Node support (when used together with IndexedDBShim on node)
  • Failing gracefully when cookies are disabled in Firefox (#619). This fix was also committed to master-2 and release in latest stable (v2.0.4).
  • #696 Possible to query multiple multiEntry properties using db.table.where({tags: 'browser', categories: 'database'}).
  • #692 Console warnings with indexing advices shall only happen in debug mode.
  • Improved tests

Details

Improved Database Upgrading (PR #714)

It is now possible to read data from a table in upgrader and delete the same table in a later db-version. It is now also possible to change a primary key of a table (on all platforms except IE and Edge). You could also change the table's name, or use data from one table into other tables, and then delete the origin table.

This has been an issue for years, mentioned in #88#105, #287 and #713.

To take advantage of the new upgrade support, upgrade() functions can only access such tables through the transaction instance given to the upgrade function (single argument) and not through the Dexie instance. The specific scenario that is now possible in 3.0.0-alpha.3 and later, is the following:

const db = new Dexie('MyDatabase');
db.version(1).stores({
  friends: 'name, age'
});
db.version(2).stores({
  friends2: '++id, name, age'
}).upgrade (tx => tx.friends.toArray().then(friends => {
  // As a part of renaming the table,
  // copy it to the new table friends2:
  return tx.friends2.bulkAdd(friends);
}));
db.version(3).stores({
  friends: null // delete friends table
})

What Did Not Work Before

In all previous versions of Dexie, upgraders could never access a table that was being deleted, even if it was being deleted in a later version than what the upgrade() was attached to. The upgrade() callback would fail due to missing table, as the table was already non-existing from the API point-of-view. So the upgrader in the above sample would fail with "NotFoundError Table 'friends' is does not exist".

IMPORTANT NOTICE

In order to access "death-sentenced tables" from an upgrader, it MUST access it through given upgrade transaction, and not just the global Dexie instance db.friends. A good practice henceforth is to always use the upgrade transaction, generally from upgrade callbacks. This is also backward compatible (Upgraders has always had the upgrade transaction as an argument, but it was not required to use it). Documentation of how to write upgraders are updated so that every upgrade() sample in the docs now use the given transaction instance.

Improved Node support

A lot of effort has been made to fix issues in Dexie when running on node (using IndexedDBShim. We're still seeing issues along the unit tests when running on node. One pull-request for IndexedDBShim has also been made. We're still not experiencing full IndexedDB compatibility on node though due to some remaining test failure of the dexie test suite when it runs on node (#709).

Improved Tests

Updated supported browsers to later versions (d2c24f4)
This release was successfully tested on the following browsers:

  • Firefox 47
  • Firefox 59
  • Edge 13
  • Edge 17
  • IE 11
  • Chrome 49
  • Chrome 66
  • Safari 10.1

Why still in Alpha?

In Dexie 3.0.0-alpha.1, all code was migrated to Typescript + splitted into smaller modules. The feature set is still almost identical to the stable 2.x version and is tested as rigorously. However, as the changes made to the code base were so large, I thought is was safe to increase the major version. Also, the d.ts files are completely rewritten, which implies breaking changes for Typescript users.

Until issue #659 is solved in one or other way, we will still be in alpha. If you experience problems using the library from your typescript code, please comment on #659. If you have ideas on how to fix it, please PR!


David Fahlander

@dfahlander dfahlander released this May 24, 2018 · 100 commits to master since this release

Assets 2

This patch release includes a bugfix: If disabling cookies in Firefox, Dexie.js failed to load (see PR #619).

Note that 2.x releases are now maintainance releases only and is backed by branch "master-2". The master branch maps to dexie@3.x-alpha.

To install this release

npm install dexie

To install the very latest version,

npm install dexie@next

@dfahlander dfahlander released this Apr 26, 2018 · 100 commits to master since this release

Assets 2

Maintainance release

This release fixes issue #617: SecurityError when storage is disabled (again)

Pre-release

@dfahlander dfahlander released this Mar 3, 2018 · 34 commits to master since this release

Assets 2

PR #670: updating hook's onsuccess will get the updated object as documented, instead of the primary key.

PR #672: fix for setByKeyPath when removing array items

@dfahlander dfahlander released this Mar 1, 2018 · 100 commits to master since this release

Assets 2

Fix: PR #670: updating hook's onsuccess will get the updated object as documented, instead of the primary key.

Pre-release

@dfahlander dfahlander released this Feb 9, 2018 · 38 commits to master since this release

Assets 2

This is the first release after refactored dexie to typescript (Announcement #622, PR #653).

In summary, everything should work the same as latest stable, version 2.0.1.

To install:

npm install dexie@next

Keeping it on new major due to the massive rewrite and possible backward incompatibilities in the typings file (should only concern typescript users though). The only 2 known incompatibilities are:

  1. When using dexie-relationships from a typescript perspective. It may not be able to declare the typings of extended table and collection methods correctly.
  2. Requires a newer Typescript version (2.6.1 tested) to understand the d.ts file.

@dfahlander dfahlander released this Oct 2, 2017 · 106 commits to master since this release

Assets 2

Angular / Zonejs issue

  • "Maximum call stack exceeded" with Zonejs 0.8.18 #589

Performance issue

  • Performance issue of toArray() not using optimized getAll() (#591)

@dfahlander dfahlander released this Sep 22, 2017 · 110 commits to master since this release

Assets 2

At last, we have version 2.0.0 out and it is way more tested, compliant and bug free than the old 1.x branch.

I would bore you if listing all details since the last stable release (version 1.5.1 in November 2016) so I'll try to summarize it with focus on the most interesting parts:

Support for native and transpiled async / await

  • Use async functions within database transactions without loosing track of current ongoing transaction.
  • Compatible with Typescript 2.x, 1.x and babel.
  • Compatible with even native async / await across all browser inluding Safari, Chrome, Edge and Firefox*. Firefox still suffers from this issue which makes native await calls loose the transaction. This is something that only can be adressed by the Mozilla team. NOTE: You can still do async/await within transactions and target Firefox - just make sure to not use native async/await, but transpile it to ES5 or ES6 using a transpiler such as Babel or Typescript!

IndexedDB 2.0 support

Unit tests of Binary Keys (IndexedDB 2.0 feature) has been fixed along with some issues in Dexie related to binary key support. Binary Keys are a more optimal way of storing binary data in IndexedDB. IndexedDB 2.0 supports any typed array (such as Uint8Array, Float64Array, etc) as well as ArrayBuffer to be indexed or used as primary key. Browsers that support IndexedDB 2.0 are: Firefox(*), Chrome, Opera and Safari.

(*) Firefox < 57 have an issue with using binary keys as primary keys. This issue was fixed recently and will be solved in Firefox 57 (a future release).

Native Safari (including Iphone) Support

Safari 10.1 is now at last fully IndexedDB compliant and part of the CI tests of Dexie. We run the Safari tests on an IPhone 7 device at browserstack.com. IndexedDBShim is no more needed when targeting latest version of Safari (10.1).

Full test matrix is now:

BrowserVersionOSAuto-tested for each PRTested on publish (publish.sh)
Firefox 47 Debian
Internet Explorer 11 Windows 7
Firefox 55 Windows
Safari 10.1 iOS
Firefox 47 OS X
Microsoft Edge 15 Windows 10
Chrome 49 OS X
Chrome 60 Windows

We use travis ci and browserstack for continous integration and automatic pre-relase tests. If you'd like to extend the test matrix, please file a PR where you add your desired browser to karma.browers.matrix.js. You must also define the browser in karma.browserstack.js. Submitting the PR will tell whether it would work or not (just add your new browser to the "ci" array of karma.browsers.matrix.js and define the same browser in karma.browserstack.js).

NOTE: Integration tests of dexie-observable, dexie-syncable and dexie-relationships are still not tested against the full matrix quite yet.

A pick of other news...

  • Dexie.waitFor() makes it possible to call non-indexedDB API:s (promise-returning async API:s!) without loosing the transaction.

  • Simpler queries like:

    await db.friends.where({
        name: "Bobby",
        age: 42
    }).toArray()

    will try using a compatible compound index [name+age] if present (and browser supports it), else just utilizing one of the indexes and JS-filter on the second criteriea.
    See Table.where()

  • Simpler way of getting a single row by index instead of primary key:

    const foo = await db.friends.get({email: 'foo@bar.com'})

    See Table.get()

  • Improved typescript definitions in general

  • Much work has been put on rewriting and fixing issues in dexie-syncable and dexie-observable. Thanks @nponiros !

Backward Compatibility

Keeping backward compatibility is a number one priority for Dexie.js, so there are not a lot of API changes. However, some things need to change some time and a few API methods that have been deprecated for a time have gone obsolete. The full list can be viewed here: http://dexie.org/docs/Deprecations

Pre-release

@dfahlander dfahlander released this Sep 6, 2017 · 112 commits to master since this release

Assets 2

This is a stability release with:

  • Improved browser support (latest Safari, Firefox and Chrome)
  • IndexedDB 2.0 support
  • Typings fixes
  • Optimization of addon dexie-syncable.

We will try to get out a 2.0.0 version very soon, as this branch feels way more stable and reliable than the 1.x branch (that is currently still marked as 'latest' on npm).

Native Safari Support

Safari 10.1 is now at last fully IndexedDB compliant and part of the CI tests of Dexie. We run the Safari tests on an IPhone 7 device at browserstack.com. IndexedDBShim is no more needed when targeting latest version of Safari (10.1).

Full test matrix is now:

BrowserVersionOSAuto-tested for each PRAuto-tested in release.sh
Firefox 47 Debian
Internet Explorer 11 Windows 7
Firefox 55 Windows
Safari 10.1 iOS
Firefox 47 OS X
Microsoft Edge 15 Windows 10
Chrome 49 OS X
Chrome 60 Windows

We use travis ci and browserstack for continous integration and automatic pre-relase tests. If you'd like to extend the test matrix, please file a PR where you add your desired browser to karma.browers.matrix.js. You must also define the browser in karma.browserstack.js. Submitting the PR will tell whether it would work or not (if adding you new browser to the "ci" array of karma.browsers.matrix.js and defining the same browser in karma.browserstack.js).

NOTE: Integration tests of dexie-observable, dexie-syncable and dexie-relationships are not tested against the full matrix quite yet. Will see if we can improve that somehow before 2.0.0 final.

IndexedDB 2.0 support

Unit tests of Binary Keys (IndexedDB 2.0 feature) has been fixed along with some issues in Dexie related to binary key support. Binary Keys are a more optimal way of storing binary data in IndexedDB. IndexedDB 2.0 supports any typed array (such as Uint8Array, Float64Array, etc) as well as ArrayBuffer to be indexed or used as primary key. Browsers that support IndexedDB 2.0 are: Firefox(*), Chrome, Opera and Safari.

(*) Firefox < 57 have an issue with using binary keys as primary keys. This issue was fixed recently and will be solved in Firefox 57 (a future release).

List of PRs since 2.0.0-beta.11

  • #540 Fix typing for .on('ready')
  • #534 Make hook callbacks compatible with typescript noImplicitThis option
  • #570 Change apply-changes to use a transaction to manage changes instead of using chanined promises.
  • #579 Workaround for Safari issue with getAll()
  • #580 Fix typescript (type error) on adding addons
  • #581 Fix IndexedDB 2.0 flaws in Dexie and make unit tests of binary keys work.
  • #583 Include Safari and smartphones in test suite and fix Dexie bugs and -workarounds for making Safari work fully with Dexie.
Pre-release

@dfahlander dfahlander released this May 19, 2017 · 142 commits to master since this release

Assets 2

Fixes

  • Fixed bower config to meet best practices (#488) #490

  • Typings (d.ts) correction of Dexie.exists() and Dexie.delete()#497

  • Bubble up QuotaExceededError instead of AbortError: Transaction aborted #514

    Fixes #323

    Rather than throwing Unhandled rejection: AbortError: Transaction aborted when the user is out of disk space, the underlying transaction error (QuotaExceededError) is bubbled up. This allows consumers of the Dexie API to identify QuotaExceededErrors and handle them accordingly.

    NOTE: I used http://www.cylog.org/utilities/filldisk.jsp to fill up my hard disk to try this code locally.

  • Update typescript Promise definition #518
    Dexie.Promise typings needed adjustments to compile correctly with tsc > v2.3.

Breaking Change

  • Don't use IndexedDBShim just because it's included #511
    Resolves #342 and #148

    This change is a breaking change (though to the better), since the shim will no more be used on browsers where it's not needed. We need to collect some user feedback about how this affects apps. What we know is that we now go over letting the shim to its job to detect whether it should be applied or not. To be backward compatible, call shimIndexedDB.__useShim(); before including dexie.