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