Thinky 1.15.1 and a sneak peek at the future posted on 12 November 2014

Thinky 1.15.1 just got released! Sorry for the wait, I was quite busy these last weeks. Here is what comes with this new release:

  • More readable code
    • Running tests now takes about 30 seconds instead of 3 minutes. This is mostly because tests now re-use the same tables.
    • Some big and cumbersome methods have been refactored in smaller ones like save, hooks etc.
  • Better Performance, a simple benchmark that creates/validates documents runs about 3 times faster:
    • The code was optimized for v8 try/catch, bind, etc.
    • Generating virtual fields does not require a full traversal of a document, the comlexity being now O(n) where n is the number of virtual fields. The same goes for fields with default values. This was first mentioned by @colprog via the pull request 139
    • Less copying for documents and options.
  • Some bug fixes:
    • #134save should not remove some foreign keys
    • #137enforce_extra: remove should not save the fields in the database, not just hide them.

One important note is that now, we have the following behavior:

var values = {name: "Michel"};
var user = new User(values);
assert.strictEqual(user, values); // This used to be false before

// But do not worry, this still holds true
var userCopy = new User(values);
assert.notStrictEqual(user, userCopy);

About the next steps, there are two interesting things coming:

  • Introduce a new way to declare schema, sometihng similar to hapi/joi and unify the schema under the hood. This should eventually provide sightly better performance.
  • RethinkDB 1.16 is close, and it introduces point change feeds, meaning that thinky will be able to provide a document that will automatically update and emit an event when it is the case.
    This will probably come with a light module that will automatically hook thinky to sockjs. This is going to be pretty cool, trust me :)

Feedback/suggestions? Ping me on Twitter via @neumino or shoot me an email at [email protected].