{"id":15025866,"url":"https://github.com/lucifier129/react-lite","last_synced_at":"2025-05-15T00:10:02.885Z","repository":{"id":57334007,"uuid":"47268167","full_name":"Lucifier129/react-lite","owner":"Lucifier129","description":"An implementation of React v15.x that optimizes for small script size","archived":false,"fork":false,"pushed_at":"2019-03-29T05:26:10.000Z","size":7167,"stargazers_count":1726,"open_issues_count":23,"forks_count":98,"subscribers_count":46,"default_branch":"master","last_synced_at":"2024-10-29T15:27:34.237Z","etag":null,"topics":["optimizer","react","react-lite"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lucifier129.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-02T14:59:27.000Z","updated_at":"2024-10-10T04:08:16.000Z","dependencies_parsed_at":"2022-08-30T21:41:54.259Z","dependency_job_id":null,"html_url":"https://github.com/Lucifier129/react-lite","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucifier129%2Freact-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucifier129%2Freact-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucifier129%2Freact-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucifier129%2Freact-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lucifier129","download_url":"https://codeload.github.com/Lucifier129/react-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247517905,"owners_count":20951718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["optimizer","react","react-lite"],"created_at":"2024-09-24T20:03:11.449Z","updated_at":"2025-04-06T17:08:15.994Z","avatar_url":"https://github.com/Lucifier129.png","language":"JavaScript","readme":"# react-lite\n\n[![Travis](https://travis-ci.org/Lucifier129/react-lite.svg?branch=master)](https://travis-ci.org/Lucifier129/react-lite)\n[![npm](https://img.shields.io/npm/v/react-lite.svg)](https://www.npmjs.com/package/react-lite)\n[![Join the chat at https://gitter.im/Lucifier129/react-lite](https://badges.gitter.im/Lucifier129/react-lite.svg)](https://gitter.im/Lucifier129/react-lite?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n## Introduction\nreact-lite is an implementation of React that optimizes for small script size.\n\nNote: react-lite dose not support React v16.x now.\n\n### Size Comparison\n\n| Framework              | Version    | Minified Size |\n|------------------------|------------|---------------|\n| Ember                  | 2.2.0      | 446kb         |\n| Polymer                | 1.0.6      | 183kb         |\n| Angular                | 1.4.8      | 148kb         |\n| React                  | 0.14.3     | 136kb         |\n| Web Components Polyfill| 0.7.19     | 118kb         |\n| Riot                   | 2.3.11     | 20kb          |\n| React-lite             | 0.15.6     | 25kb          |\n| preact + preact-compat | 8.2.1      | 5kb           |\n\nReact-lite supports the core APIs of React, such as Virtual DOM, intended as a drop-in\nreplacement for React, when you don't need server-side rendering in browser(no `ReactDOM.renderToString` \u0026 `ReactDOM.renderToStaticMarkup`).\n\n### Usage\nIf you are using webpack, it's so easy to use react-lite, just [config alias](http://webpack.github.io/docs/configuration.html#resolve-alias) in webpack.config.js:\n\n```javascript\n// webpack.config.js\n{\n    resolve: {\n        alias: {\n            'react': 'react-lite',\n            'react-dom': 'react-lite'\n        }\n    }\n}\n```\n\nNote: feel free to try react-lite, if something happen and we can't fix it in time, then use [regular react](https://github.com/facebook/react) instead.\n## Installation\n\nYou can install react-lite from npm:\n\n```shell\nnpm install react-lite --save\n```\n\n## Browser compatibility\n\nsupports IE9+ / ES5 enviroment\n\n## Documentation\n\nlearn react-lite from [React official documentation](https://reactjs.org)\n\n## What can react-lite do?\n\njust the same as what react does, see some demos below(I just add the alias to webpack.config.js, no need to do anything else):\n\n- works with material-ui: [docs demo](https://lucifier129.github.io/material-ui/build)\n- works with react-bootstrap: [docs demo](http://react-lite-with-bootstrap.herokuapp.com/)\n- works with ant-design: [demo](http://lucifier129.github.io/ant-design/)\n- works with react-router: [examples](http://react-lite-with-react-router.coding.io/)\n- works with redux:\n\t* [async](http://lucifier129.github.io/redux-with-react-lite/async/index.html)\n\t* [counter](http://lucifier129.github.io/redux-with-react-lite/counter/index.html)\n\t* [shopping-cart](http://lucifier129.github.io/redux-with-react-lite/shopping-cart/index.html)\n\t* [todomvc](http://lucifier129.github.io/redux-with-react-lite/todomvc/index.html)\n\t* [todos-with-undo](http://lucifier129.github.io/redux-with-react-lite/todos-with-undo/index.html)\n- works with react-motion: [demos](http://lucifier129.github.io/react-motion-with-react-lite/index.html)\n- works with react-d3-components: [demos](http://lucifier129.github.io/react-d3-components-demos/)\n- works with react-d3: [demos](http://lucifier129.github.io/react-d3-demos/)\n- react-lite [vdom-benchmark](http://vdom-benchmark.github.io/vdom-benchmark/)\n- js-repaint-perf:\n\t* [react](http://lucifier129.github.io/react-lite-repaint-perf/react/index.html)\n\t* [react-lite](http://lucifier129.github.io/react-lite-repaint-perf/react/lite.html)\n\n## React-lite vs React\n\nvia react-lite:\n- all of React.PropTypes method is no-op(empty function)\n- use React in server side rendering, and use React-lite in browser\n\t* react-lite will replace the dom tree with new dom tree\n\t* you had better avoid `script|head|link` tag in client side\n- can not use react-dev-tool inspect react-lite, should switch to regular react for debugging\n- react-lite only works with a JSX toolchain([issue](https://github.com/Lucifier129/react-lite/issues/51))\n- unlike react, `event` object in react-lite is always persistent, and `event.persist` is set as no-op to avoid throwing error.\n- react-lite can't work with `react-tap-event-plugin`, please use `fastclick` instead. or add alias `'react-tap-event-plugin': 'react-lite/lib/react-tap-event-plugin'`, just like [here](https://github.com/Lucifier129/material-ui/blob/master/docs/webpack-production.config.js#L21)\n- can't work with `transform-react-inline-elements`, you will get a bundle include both `react` and `react-lite`.\n- `react-lite` just follow the best practice of `React`.\n\n## Test\nreact-lite reuses react's unitest(170), you can see them in `__test__`, and run the tests with:\n\n```shell\nnpm test\n```\n\nLicense: MIT (See LICENSE file for details)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucifier129%2Freact-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucifier129%2Freact-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucifier129%2Freact-lite/lists"}