Releases: SierraSoftworks/Iridium
Version 6.5.3
This is a maintenance release responsible for updating various libraries (including lodash to version 4.x) and transitioning to Travis CI's container infrastructure (something which was previously held back by lack of support for recent versions of MongoDB).
You should notice no changes between this version and v6.5.1 in terms of overall usage.
Changes
- Switch to Travis CI container architecture.
- Update TypeDoc to latest version.
- Update Lodash to 4.5 and refactor calls to make use of their new API.
- Some small fixes to Omnom (the document diff tool used internally).
- Updated chai 3.x and removed (now unnecessary) chai-fuzzy.
- Updated TypeScript compiler to 1.7.5
Version 6.5.1
This release adds a bit of new functionality (it should not break existing code) as well as fixes for some strange behaviour when working with complex object types.
Features
- Transforms now receive additional context in the form of the property name and model upon which the transform is acting. This should allow you to create generic transforms which can be applied to a wide variety of models.
- It is now possible to register a transform which applies on the document level by supplying the
$document
transform.
Documentation
- Added a section on registering custom schema validators and transforms.
- Added a section for examples of useful transforms.
Fixes
- Various complex types are now cloned correctly, you will now see the correct
MongoDB.ObjectID
,MongoDB.Binary
andBuffer
types rather than strange object-analogues.
Version 6.4.1
This release is intended to add support for storing binary data within your MongoDB collections through the use of Buffer
objects and the MongoDB Binary
type.
It is now possible to mark a property as requiring binary serialization and validation using the Iridium.Binary
decorator.
In addition to this, there was a bit of refactoring done to make adding additional default validators and transforms easier in future.
This patch addresses an issue with cloning a buffer object, resulting in random memory being used to populate the new buffer.
Version 6.4.0
This release is intended to add support for storing binary data within your MongoDB collections through the use of Buffer
objects and the MongoDB Binary
type.
It is now possible to mark a property as requiring binary serialization and validation using the Iridium.Binary
decorator.
In addition to this, there was a bit of refactoring done to make adding additional default validators and transforms easier in future.
Version 6.3.0
This release re-adds support for asynchronous hooks with an emphasis on maintaining performance wherever possible by minimizing the number of round-trips to the event queue in situations where the functionality is not used.
To make use of asynchronous hooks, your implementations should return a promise object which resolves once your hook has completed. Take a look at the documentation for more information on how to do so.
Performance considerations
When using async hooks, the best way to ensure good performance is to make sure that you return a Bluebird
promise object, this allows Iridium's internal implementation to simply pass the promise through and removes the overhead of needing to wrap the promise beforehand.
Additionally, if you are not making use of a hook, it is better to remove the method definition than it is to leave it there, as doing so will allow Iridium to skip calling it and therefore avoid the context-switch overhead of a method call.
Version 6.2.0
This release adds the .one()
method to a cursor - allowing you to quickly retrieve a single document from the .find()
method.
In addition to this, it is now possible to specify a read preference on a cursor using the .readFrom()
method. It is important to note that the MongoDB documentation explicitly mentions that you should not use this method as a way to gain "free read performance" as if any of your cluster's nodes go down you will hit performance constraints which would otherwise not be there.
v6.1.1
Added
- Support for passing through low level connection options to the node-mongodb-native driver. You can review the full list of options here.
import * as Iridium from 'iridium';
var core = new Iridium.Core("mongodb://localhost/test", {
options: {
server: {
socketOptions: {
connectionTimeoutMS: 10000
}
}
}
});
This release is backwards compatible with most code, with the exception of those users who are already making use of an options
field in their connection settings for MongoDB.
v6.0.0
This release, despite being a major version bump, isn't all that spectacular in terms of new features. In fact, the only user facing change is support for TypeScript 1.6 - which requires a major version change as it affects the external API and could break code using the 5.x branch of Iridium (which targeted TypeScript 1.5).
In spite of this, changing to TypeScript 1.6 offers a number of awesome advantages as we progress, including the ability to start transitioning away from using our own d.ts
files for the various NodeJS modules Iridium depends on. It also opens up the possibility of using intersection types to simplify common model definitions and remove some of the boilerplate code associated with them.
Added
- TypeScript 1.6 support including support for new module resolution logic as well as addressing a couple of minor issues related to stricter object literals.
Changed
- Switched to VS Code 0.8.0 - with the resulting changes in where the project settings are located.
- Switched to using
tsconfig.json
for all TypeScript build configuration flags.
v5.11.0
Added
- Connection hooks to
Iridium.Core
in the form of onConnecting and onConnected. - Added a link to the new documentation to the README file.
Description
Connection hooks allow you to implement custom logic controlling the way in which Iridium's Core both creates its database connection, as well as being notified once the connection has been established. This comes in very handy for implementing automatic index generation for your models.
Here's an example of how one would go about automatically setting up your indexes for a model when the database connection is established. It is important to be aware that, unless your indexes are set to { background: true }
, this operation will block the completion of the Iridium.Core.connect method - and generating indexes on a large database can take some time...
class MyCore extends Iridium.Core {
MyModel = new Iridium.Model<MyModelDocument, MyModelInstance>(this, MyModelInstance);
protected onConnected() {
return this.MyModel.ensureIndexes();
}
}
v5.10.1
Added
- Automatic generation of our brand new documentation at http://sierrasoftworks.github.io/Iridium
Description
This release is primarily focused around adding support for the automatic generation of documentation for Iridium. It changes a couple of internal module definitions to avoid using export default
, since TypeDoc doesn't support it terribly well. Since these are internal modules they should not break anybody's code, but if you are using internal Iridium modules in your project (which you shouldn't) here's how to fix it.
If your original import looked like this:
import Model from 'iridium/lib/Model';
You need to change it to look like this instead:
import {Model} from 'iridium/lib/model';
If you are using Iridium through the standard index.ts
file then there are no changes you will need to make to your code. You'll know you're using index.ts
if your Iridium import looks like any of these:
import Iridium from 'iridium';
import Iridium = require('iridium');
var Iridium = require('iridium');