Releases: dexie/Dexie.js
Dexie v1.4.0-beta2
Resolves issues #127 and #245. See also release notes for v1.4.0-beta.
Dexie v1.4.0-beta
Optimized, simplified and debug friendlier.
This pre-relase contains an optimized and simplified code base that also is much easier to debug. Please help me test it out.
Long Stacks for Easier Debugging
- Long stack support on all thrown errors in debug mode.
- Debug mode is defined via
Dexie.debug
static property. - Dexie.debug will default to true when served from localhost.
Dexie.debug = true; // Enables long stacks (Default on when served from localhost)
db.friends.toArray(friends => {
return friends.map(friend => friend.name);
}).then (names => {
console.log(names.join(', ');
}).then (()=> {
throw new Error ("oops!");
}).catch (function (e) {
console.error ("Oops: " + e.stack); // Will see long stacks containing async flow:
// Error: oops!
// at yourSource:file:line
// From previous:
// at yourSource of prevous promise
// ...
// From previous:
// at yourSrouce even earlier...
// ...
});
Totally Rewritten Promise
The Promise class has been rewritten totally in order to be more optimized and execute all tasks in a virtual microtick engine.
Promise.scheduler = customScheduler;
It is now possible to set a custom scheduler for Promise, like Bluebird's setScheduler(). The scheduler MUST be indexedDB friendly though. Maybe this could be something to use with angular to track digests and maintain scopes.
Dexie.Promise.scheduler = function customScheduler (callback, args) {
$rootScope.$evalAsync(function() {
callback.apply(null, args);
});
};
I have not tested this with angular, so please help me test it. Setting a custom scheduler inactivates the internal virtual micro-tick engine and will always use the provided scheduler to call then-handlers in Promises. When using a custom scheduler, pay attention to whether indexedDB transaction survives your scheduler or not. setTimout() would not survive it. setImmediate() maybe.
Cleaner Code
Dexie.js and its other modules has been revised and some complex methods has been simplified.
Reusable Collections
If you prepare a collection:
var collection = db.friends.where('age').above(25);
...you can reuse that collection in any transaction later:
db.transaction('r', db.friends, function() {
collection.toArray(function (result) {
console.log(JSON.stringify(result));
});
});
In previous versions, Collections where bound to the transaction where they were created.
Other
- Issue fixed: Promise.on('error') wasn't signaled for rejections outside transactions: e7f3275
- Behave if indexedDB implementatino throws undefined or null: b82be5c
- Wrong class expected in options to Dexie constructor 614a456.
- #130 resolved (No leaking arguments, https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments)
See also pull request #242 which contains most of the changes in this release.
Dexie v1.3.6
News since v1.3.4
Features
- WriteableTable.bulkPut();
- WriteableTable.bulkDelete();
- New options in Dexie constructor: indexedDB and IDBKeyRange. Makes it possible to specify a backing indexedDB implementation.
- Support for WriteableTable.bulkAdd() for non-inbound primary keys (added second keys array argument)
- Collection.raw() - inactivates 'reading' hooks for the collection. (Needed internally).
- Collection.clone() - clone the collection to add additional filters without modifying existing collections.
- Collection.filter() - alias to Collection.and().
- Polyfilling 'versionchange' event on IE,Edge and Safari if happens in same window.
Optimization
- Enormous optimization of WriteableCollection.delete() #208. Before it could take 30 seconds to delete 100,000 items. Now it takes just 300 ms on chrome and 3s on IE/Edge. 9ad2018, d539d18,
Help Debugging
- Unless overriden, Dexie will now console.warn() by default for the following events:
- Promise.on('error') (unhandled promise rejection)
- db.on('blocked') (other db connection blocks us from upgrading or deleting db)
- db.on('versionchange') (other db connection wants to upgrade or delete db)
- db.transaction() will now fail if returning a non-Dexie promise. 1214974
Quality Assurance
- Rigorously unit testing CRUD hooks f9176fe
- eslint all Dexie modules.
- Continous integration using travis and browserstack
- In release script, unit tests run on various browsers. In this release, the following browsers were run:
- Edge 13 on Windows 10
- Firefox 45.0 on OS X El Capitan
- Chrome 49 on OS X Mountain Lion
Fixes
- Fixes in Error handling (DexieError and its sub classes) 21cdf2e, b417aa3, c48e2e6.
- In some situations, Promise.on('error') was signaled even when a promise was handled.
- IEDeleteObjectStoreBug still present on Windows Edge Browser #205
- Adding version to bower.json
- Bugs in CRUD hooks API:
- Bug in hooks handling of bulkAdd() found via tests and corrected (when using non-inbound keys)
- Bug in hooks handling of put() found via tests and corrected (when using non-inbound keys)
- Found bug in Table.add() when direct error is thrown, neither onerror or onsuccess called on the hook subscribers.
- 64c83f2
- 214f215
- If using and() on a collection that is executed with .keys(), .eachKey() or .eachUniqueKey(), the argument passed to and() was undefined.
Dexie v1.3.6-rc.1
News since v1.3.4
Features
- WriteableTable.bulkPut();
- WriteableTable.bulkDelete();
- New options in Dexie constructor: indexedDB and IDBKeyRange. Makes it possible to specify a backing indexedDB implementation.
- Support for WriteableTable.bulkAdd() for non-inbound primary keys (added second keys array argument)
- Collection.raw() - inactivates 'reading' hooks for the collection. (Needed internally).
- Collection.clone() - clone the collection to add additional filters without modifying existing collections.
- Collection.filter() - alias to Collection.and().
- Polyfilling 'versionchange' event on IE,Edge and Safari if happens in same window.
Optimization
- Enormous optimization of WriteableCollection.delete() #208. Before it could take 30 seconds to delete 100,000 items. Now it takes just 300 ms on chrome and 3s on IE/Edge. 9ad2018, d539d18,
Help Debugging
- Unless overriden, Dexie will now console.warn() by default for the following events:
- Promise.on('error') (unhandled promise rejection)
- db.on('blocked') (other db connection blocks us from upgrading or deleting db)
- db.on('versionchange') (other db connection wants to upgrade or delete db)
- db.transaction() will now fail if returning a non-Dexie promise. 1214974
Quality Assurance
- Rigorously unit testing CRUD hooks f9176fe
- eslint all Dexie modules.
- Continous integration using travis and browserstack
- In release script, unit tests run on various browsers. In this release, the following browsers were run:
- Edge 13 on Windows 10
- Firefox 45.0 on OS X El Capitan
- Chrome 49 on OS X Mountain Lion
Fixes
- Fixes in Error handling (DexieError and its sub classes) 21cdf2e, b417aa3, c48e2e6.
- In some situations, Promise.on('error') was signaled even when a promise was handled.
- IEDeleteObjectStoreBug still present on Windows Edge Browser #205
- Adding version to bower.json
- Bugs in CRUD hooks API:
- Bug in hooks handling of bulkAdd() found via tests and corrected (when using non-inbound keys)
- Bug in hooks handling of put() found via tests and corrected (when using non-inbound keys)
- Found bug in Table.add() when direct error is thrown, neither onerror or onsuccess called on the hook subscribers.
- 64c83f2
- 214f215
- If using and() on a collection that is executed with .keys(), .eachKey() or .eachUniqueKey(), the argument passed to and() was undefined.
Dexie v1.3.6-beta.3
Quality assurance:
- Run eslint on all code and enforce eslint passing in release script
- Launch unit tests on browserstack d9228dc in release script. Currently just Chrome, Firefox and Edge. Will add more devices and browsers later.
- Code review and some actions taken b29ec59:
- Separating extend() into extendProto() and extend() (different use cases).
- db-classes (Collection, Table etc) now have non-enumerable methods now on their prototype.
- New method dump() on errors derived from DexieError. Returns string. To be used instead of (e.stack || e). It will dump name, message and stack. Like 'stack' on chrome but also for Firefox.
- Static method Dexie.dump(error). Works as DexieError.dump().
- Promise default uncaught handler: console.warn() instead of console.error().
- Typescript definitions updates.
Dexie v1.3.6-beta.2
Dexie v1.3.6-beta.1
Several improvements and bugfixes:
- Big optimization of WriteableCollection.delete() (this time it DOESN'T crash IE or Edge!)
- Support for bulkPut() and bulkDelete().
- New methods on Collection: Collection.raw() and Collection.clone()
- Default console.warn() when db upgrade or deletion was blocked (overridable)
- Rigorous unit testing of CRUD hook api. Found and corrected several bugs.
- Updated typings with added methods.
Production release will come within couple of days...
Dexie v1.3.5-beta.2
- #208 Optimization of WriteableCollection.delete()
- Feature: Possible to provide the indexedDB and IDBKeyRange implementation in Dexie constructor (using options.indexedDB and options.IDBKeyRange).
- Bugfix in DexieError subclasses - didnt set inner property. b417aa3
- Bugfix: Promises never return on node (when MissingAPIError was thrown)
- By default, log to console.error if any Promise was uncaught #206
- False alarms in Promise.on('error') (also explained in #206)
- Bugfix:
IEDeleteObjectStoreBug still present on Windows Edge Browser #205
Dexie v1.3.5-beta
- Feature: Possible to provide the indexedDB and IDBKeyRange implementation in Dexie constructor (using options.indexedDB and options.IDBKeyRange).
- Bugfix in DexieError subclasses - didnt set inner property. b417aa3
- Bugfix: Promises never return on node (when MissingAPIError was thrown)
- By default, log to console.error if any Promise was uncaught #206
- False alarms in Promise.on('error') (also explained in #206)
- Bugfix:
IEDeleteObjectStoreBug still present on Windows Edge Browser #205
Dexie v1.3.4
Bugfixes
- dexie seems to be published as an ES6 module on JSPM #195
- Including built addons for dexie's bower package (Bower install for addons #185)
- Missing stacks on exceptions
- bulkAdd() support on non-inbound tables if primKey is auto incremented (#90)
- SecurityError when storage is disabled #158
- Removed the "typescript/definitions" element of package.json (commit 0eaec3b)
- Typescript definitions should now cover the entire public API and is a little smarter.
- Bugfix in typescript sample (commit 4038135)
- addons have peerDependencies instead of dependencies.
Development environment
- "build" renamed to "tools".
- Include src, build and test in npm- and bower packages (can be nice to be able to see or lab with the code without having to fork and clone. Also, I believe it is more conventional to point jsnext:main to src, not dist)
- Include addons in bower packages (not npm, because they have their own npm packages)
- Removed es6 output from dist and instead point jsnext:main to src/Dexie.js
- Refactored Dexie.js some more - extracted more classes and functions.
- Unit tests can utilize "spawnedTest" instead of "asyncTest" for prettier code using yield.
Minor changes: