Releases: omniscientjs/omniscient
v2.0.1
v2.0.0
As of v2.0.0
, Omniscient is dependent of React v0.12.0
. This React version introduces some changes, and no longer allows components, but elements. With this some changes, not too big but breaks the previous API.
Statics as properties
The most notable change is that the statics
are moved to be a part of the properties.
Statics still doesn't effect whether or not the component should update.
Before you could do:
OmniscientComponent('someKey', cursor, statics);
But now you have to do:
OmniscientComponent('someKey', { cursor: cursor, statics: statics });
As a result of this, you now always get passed props to your render function.
Before you could do:
var OmniscientComponent = component(function (cursor) {
return React.DOM.text({}, cursor.deref());
});
Now you have to do:
var OmniscientComponent = component(function (props) {
return React.DOM.text({}, props.cursor.deref());
});
This:
OmniscientComponent(cursor);
Is translated to:
OmniscientComponent({ cursor: cursor });
You could also name your cursor:
var OmniscientComponent = component(function (props) {
return React.DOM.text({}, props.name.deref());
});
// Usage
OmniscientComponent({ name: cursor });
With JSX
Also, with the way React now requires elements instead of components, there have to be a change in how we use Omniscient with JSX.
Before you could do:
<OmniscientComponent cursor={someCursor} />
But now you have to do:
<OmniscientComponent.jsx cursor={someCursor} />
// or
OmniscientComponent = OmniscientComponent.jsx;
<OmniscientComponent.jsx cursor={someCursor} />
// or
var OmniscientComponent = require('someComponent').jsx;
<OmniscientComponent.jsx cursor={someCursor} />
Notice the .jsx
after OmniscientComponent
v1.3.1
v1.3.0
Additions
-
Custom Omniscient Components can now have children:
var Comp = component(function (cursor) { // this.props.children[0] === h1 element }); var App = component(function (cursor) { return Comp(cursor.get('item'), React.DOM.h1(null, 'Hello')); });
-
Adds regex filters for debugging
-
Adds better print out for debug statements.
-
Updates Immutable.js dependency to latest.
v1.2.0
v1.1.0
Fixes
- Fixed bug with shouldComponentUpdate mixin, where the method couldn't be overridden.
- Removed duplicated dependencies from
package.json
.
Additions
- Added component name support for debugging
var Component = component(debugName, function () {});
- Adds debug method for printing out valuable debug-information for shouldComponentRender and render.