The future is React without React.
Node.js v8 or newer is required.
Via the yarn client:
$ yarn add --dev unreactVia the npm client:
$ npm install --save-dev unreactunreact src/button.js --out-file views/button.pugunreact src --out-dir viewsDefault option is pug, you can also choose ejs.
unreact src/button.js --out-file views/button.ejs --template-engine ejs
unreact src --out-dir views -t ejsunreact src/main.js --out-file views/main.pug --add-beginning "include header.pug"unreact src/main.js --out-file views/main.pug --add-ending "include footer.pug"unreact src/main.js --out-file views/main.pug --initial-indent-level 1ALPHA: things may not work
- Only works with functional components and very simple ones.
Check the work bridging React and Prepack:
- https://github.com/facebook/prepack/pulls?utf8=%E2%9C%93&q=is%3Apr+react
- https://twitter.com/trueadm/status/1002812303824314369
- https://github.com/trueadm/ssr-with-prepack-hackathon
Feel free to dive in! Open an issue or submit PRs.
unreact follows the Contributor Covenant Code of Conduct.