A Minimalistic Wrapper for IndexedDB
APACHE-2.0 License
Published by dfahlander about 8 years ago
Published by dfahlander over 8 years ago
Fixes issue #264
Published by dfahlander over 8 years ago
Much of the code base has been rewritten since v1.3.6 for the purposes of both optimization and code simplification.
Dexie.debug
static property.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...
// ...
});
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.
The Promise class has been rewritten totally in order to be more optimized and execute all tasks in a virtual indexedDB-compliant microtick engine.
Dexie.js and its other modules has been revised and some complex methods has been simplified.
See also pull request #242 which contains most of the changes in this release.
new Error().stack
at startup, it will fail there if karma-source-map-support and zone.js are loaded.Published by dfahlander over 8 years ago
Probably the final pre-relase for 1.4.0. No new bugfixes or features added since the last beta. Just some build- and test improvements.
This rc was built using node 6 instead of node 4 that was used earlier.
Published by dfahlander over 8 years ago
Fixed issue #248: 'modifications' object in 'updating' hook can be bizarre.
To install this pre-release from npm, use:
npm install dexie@next
or if you want to be more specific:
npm install [email protected]
Published by dfahlander over 8 years ago
Resolves issues #127 and #245. See also release notes for v1.4.0-beta.
Published by dfahlander over 8 years ago
This pre-relase contains an optimized and simplified code base that also is much easier to debug. Please help me test it out.
Dexie.debug
static property.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...
// ...
});
The Promise class has been rewritten totally in order to be more optimized and execute all tasks in a virtual microtick engine.
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.
Dexie.js and its other modules has been revised and some complex methods has been simplified.
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.
See also pull request #242 which contains most of the changes in this release.
Published by dfahlander over 8 years ago
Published by dfahlander over 8 years ago
News since v1.3.4
Features
Optimization
Help Debugging
Quality Assurance
Fixes
Published by dfahlander over 8 years ago
Quality assurance:
Published by dfahlander over 8 years ago
Published by dfahlander over 8 years ago
Several improvements and bugfixes:
Production release will come within couple of days...
Published by dfahlander over 8 years ago
Published by dfahlander over 8 years ago
Published by dfahlander over 8 years ago
Bugfixes
Development environment
Minor changes:
Published by dfahlander over 8 years ago
News:
new Dexie("name", {autoOpen: false})
Published by dfahlander over 8 years ago
Dexie v1.3.0 was at last released, six months after the previous release, 1.2.0. There are a lot of news, check out!
New WhereClause methods
Improved WhereClause methods:
noneOf() Supports large array as argument
notEqual() More efficient
Support for using yield (as await)
New method for improved performance when adding thousands of items into a table:
Updated Typescript definition.
Module based instead of global.
Supports latest typescript compiler.
typings attribute in package.json eliminates the need of DefinitelyTyped and tsd.
"typescript.definitions"attribute in package.json makes tsd detect the typings in github.
Support for the new standard module format "es6" (separate output).
The files in the dist
directory has been moved. dist/latest
is removed and files are put directly under dist
and are all in lowercase.
Dist files are removed from the master
branch. They are only checked in by the release.sh
script in the releases
branch so that each release will have them (so that our bower users get happy).
Addons are no more part of the npm package (or bower package). They are also ES6 based and have their own build system. They are released separately as their own npm modules
npm install dexie-observable --save
npm install dexie-syncable --save
Bower users can also install the npm modules through:
bower install https://npmcdn.com/dexie-observable@SEMVER/bower.zip
bower install https://npmcdn.com/dexie-syncable@SEMVER/bower.zip
...where SEMVER is a version query in semver format, such as 0.1.x, ~0.1.2, ^0.1.3 etc.
Wow, there's been a lot of small little fixes. 6 months are hard to conclude here. Read the commit log to see the details.
Introduced scripts for building, testing and releasing Dexie.js. Source code is migrated to the ES6 module format as a base for further refactoring of Dexie.js into separate modules. Now, to contribute to Dexie.js you will need to:
npm install
npm run build
or npm run watch
And to test in command line (thanks to @YuriSolovyov)
npm test
There's a little guide in README#Contributing on how to use npm link
to symlink you github clone to your app's node_modules/dexie, which works perfectly well on windows systems as well.
Published by dfahlander over 8 years ago
Features:
Fixes:
For all the details, see https://github.com/dfahlander/Dexie.js/commits/master
Published by dfahlander over 8 years ago
This release only have some README.md typo fixes since v1.3.0. See release notes for 1.3.0.
Published by dfahlander about 9 years ago