本版本對setState與forceUpdate內部依賴的setStateImpl進行了重構,性能穩定在60pfs之上。並且將組件實例的所有內部方法與屬性都改成以___
開頭。
https://github.com/RubyLouvre/anu
- disabled的元素不能觸發點擊事件
- 修正mouseenter/mouseleave在IE6-8中的BUG,涉及到relatedTarget的正確獲取與LCA處理
- 簡化alignVnode的邏輯,減少插入列隊的生成
- 重構setStateImpl,實現以列隊為基礎的異步更新
_component
更名為__component
,_currentElement
更名為__current
- react/lib中添加一些簡用的外圍模塊,如ReactComponentWithPureRenderMixin,shallowCompare,sliceChildren
使用
npm i anujs
或者使用架手架 https://github.com/Levan-Du/anu-cli
npm i -g anu-cli
webpack.config中如何代替原來用React編寫的項目
resolve: {
alias: {
'react': 'anujs',
'react-dom': 'anujs',
'react-tap-event-plugin': 'anujs/lib/injectTapEventPlugin', //如果你在移動端用到了onTouchTap事件
}
},
歡迎大家為anujs加星星與試用!!!