- add force flag as optional third parameter to set the state values without forcing an update (no usage of setState) - 6ba8f90
- bug fix: in-browser source include loading - c32c0a5
There are no longer initialization requirements for react-mixin-manager. React.mixins no longer exists - it is now the return value from the react-mixin-manager
require.
The required changes to your app are as follows:
- the initialization code is now just ```require('react-mixin-manager');'''
- All code referencing
React.mixins.whatever
must now change toReactMixinManager.whatever
(assuming ReactMixinManager =require('react-mixin-manager')
)
- always return boolean value from shouldComponentUpdate - b8a62a9
- add method will now always replace a previous mixin with the same alias & removed the replace function - 7c005c0
In order to have deterministic behavior with mixins that are added w/o namespaces and un-qualified references to mixins registered with a namespace there is no longer a React.mixins.replace
and React.mixins.add
will always replace a mixin if it currently exists with the same alias.
If you only want to add a mixin if it does not previously exist, you can use
if (!React.mixins.exists('mixinName')) {
React.mixins.add('mixinName', ...);
}
Also, getting close to a 1.0 release
- add namespace support - a03f201
If the name contains a dot "." the prefix is assumed to be the namespace. A mixin can be retrieved by either using the fully qualified name or the suffix. The first mixin to be added with any suffix will be returned if there are 2 different namespaces with the same suffix.
React.mixins.add('namespace-a.foo', aFoo);
React.mixins.add('namespace-b.foo', bFoo);
mixins: ['foo'] // will result to [aFoo]
mixins: ['namespace-a.foo'] // will result to [aFoo]
mixins: ['namespace-b.foo'] // will result to [bFoo]
- fix bug when named mixins were using the mixins attribute to define dependencies - f2dea59
- fix token comment in un-minified source (for react-backbone) - df41ae9 (no functional change)
- add customizable deferUpdate timer - 9b28b4e
React.mixins.defaultDeferUpdateInterval
can be used to set the interval in milis between the deferUpdate
call and the actual forceUpdate
call. A value < 0 will not defer the forceUdpate
call (beneficial only to change behavior of 3rd party mixins that depend on this functionality).
The defer interval can also be adjusted on a per component basis. Any mixins registered as dependencies of the React component will obey the value that is set for the component. It can be set using the mixin parameter.
React.createClass({
// call forceUpdate 100 ms after the deferUpdate call
mixin: ['deferUpdate(100)'],
somethingThatRequiresUpdate: function() {
this.deferUpdate();
}
});
- initiatedOnce mixins should accept array or argument arrays - dc3cdc4
Compatibility notes: If you are using the advanced "initiatedOnce" capabilities, the argument structure has changed.
Previously, there would be a function argument representing each parameterized mixin reference and now there is a single argument which is an array of argument arrays. The length of this array would be equal to the number of times the mixin was referenced with parameters.
For example:
mixins: ['foo("a")', 'foo("b", "c")']
Would previously execute the mixin wrapper function as
function(["a"], ["b", "c"])
But will now use
function([["a"], ["b", "c"]])
- code cleanup and remove accidental global var 5f4674f
no functional code changes. There is just an additional comment that is used to create react-backbone/with-deps.js
- allow object mixin references to have a "mixins" attribute to define dependencies - e6a1edd
- for AMD, you must execute the function with params (see README AMD install instructions) - 37c72bb
require(
['react', react-mixin-manager'], function(React, reactMixinManager) {
reactMixinManager(React);
});
- add React.mixins.getState / React.mixins.setState methods - 42443d2
- add "state" mixin - 4c00d185
- add react-component keyword - bcdeeb9
- #1 - Once initiated mixins support. (@anatolikurtsevich)
- bug fix: include dependencies when mixin parameters are used - ec68956
- add React component provided mixin parameters - e574075
- allow add/replace signature (name, array) where array is [mixin, dependencies...] - 798c6a2
- add bower.json - ea204e6
- remove console.log - 3e2bc8a
- Update README.md - 286555c
- added the "deferUpdate" mixin - 4e74d21
- add new "inject" functionality - 7fc5324
- change "group" function name to "alias" - 21e6242
- fix author email address - 85358eb
- add mixing group registration API - f53d869
- allow mixins to be functions for later execution - e81cfb3
- require React to be passed as param for commonJS init - 887f7d8
- add index.js