anujs1.3.0是一款高性能React-like框架,是目前世界上對React16兼容最好的迷你庫。node
自React16起,相繼推出createContext,createPortal, createRef與createResource等新API,代表官方正積極由純view庫向大而全的框架演變,它將會愈來愈好用。一些迷你庫可能跟不上步伐,如今也只有anujs有這實力跟進。react
1.3.0的改進以下:webpack
屬性名與方法名大改動,與React16的Fiber靠近git
vnode.vtype
--> fiber.taginstance.__isStateless
--> fiber._isStatelessupdater
--> fiberupdater.vnode
--> fiber._reactInternalFiberupdater.willReceive
--> fiber._willReceiveupdater.children
--> fiber._childrenupdater.isMounted()
--> fiber._isMounted()updater.insertCarrier
--> fiber._mountCarrierupdater.insertPoint
--> fiber._mountPointupdater.parentContext
--> fiber._unmaskedContextgetChildContext
--> getUnmaskedContextgetContextByTypes
--> 爲getMaskedContextCompositeUpdater.js
--> ComponentFiber.js`DOMUpdater.js
--> HostFiber.js使用github
npm i anujs
或者使用架手架 https://github.com/Levan-Du/a...web
npm i -g anu-cli
webpack.config中如何代替原來用React編寫的項目npm
resolve: { alias: { 'react': 'anujs', 'react-dom': 'anujs', // 若要兼容 IE 請使用如下配置 // 'react': 'anujs/dist/ReactIE', // 'react-dom': 'anujs/dist/ReactIE', // 若是引用了 prop-types 或 create-react-class // 須要添加以下別名 'prop-types': 'anujs/lib/ReactPropTypes', 'create-react-class': 'anujs/lib/createClass' //若是你在移動端用到了onTouchTap事件 'react-tap-event-plugin': 'anujs/lib/injectTapEventPlugin', } },
歡迎你們爲anujs加星星與試用!!!antd