Giter Club home page Giter Club logo

anu's Introduction

anu

GitHub license npm version CircleCI PRs Welcome

npm install anujs

读作 安努 ,苏美尔的主神,开天辟地。一个高级兼容官方React16的迷你React框架,用于上线时无痛替换React,压缩整个项目的体积。 QQ交流学习群: 370262116

体积变化

数据来源: https://bundlephobia.com/

特点:

  1. 支持React16的各种新功能,Fragment, componentDidCatch, creactContext, createRef, forwardRef...
  2. 体积非常迷你(3000行相对于react+react-dom的3万行, gz为其1/3大小)
  3. 跑通官方700多个单元测试(其他迷你库都无法跑官方测试)
  4. 支持React全家桶(react-redux, react-router-dom, react-router-redux, react-lazy-load, react-hot-loader...)
  5. 支持99%的antd组件

官方脚手架

https://github.com/RubyLouvre/create-anu-app

IE8脚手架

https://gitee.com/menhal/React_IE8_boilerplate

image

开源协议

MIT

轻松切换已有的React项目

//webpack配置
resolve: {
   alias: {
      'react': 'anujs',
      'react-dom': 'anujs',
        // 若要兼容 IE 请使用以下配置
        // 'react': 'anujs/dist/ReactIE',
        // 'react-dom': 'anujs/dist/ReactIE',
        // 'redux': 'anujs/lib/ReduxIE',//这主要用于IE6-8,因为官方源码中的isPlainObject方法性能超差
        // 如果引用了 prop-types 或 create-react-class
        // 需要添加如下别名
        'prop-types': 'anujs/lib/ReactPropTypes',
        'create-react-class': 'anujs/lib/createClass'
        //如果你在移动端用到了onTouchTap事件
        'react-tap-event-plugin': 'anujs/lib/injectTapEventPlugin',  
   }
},

详细用法与示例见 wiki

测试

npm test

anu's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.