3 ms·
So, what's the current ES5, non-Babel/Webpack/Rollup/Brunch/etc story of React? When I first tested it, all you had to include was two Javascript files and you
by mhd 9y ago
So, what's the current ES5, non-Babel/Webpack/Rollup/Brunch/etc story of React? When I first tested it, all you had to include was two Javascript files and you could go, and if you were foregoing JSX it was even easier.
These days it seems you need to download half the internet for even the most trivial uses, never mind using the half-finished ersatz JS du jour. And yes, I know that it gets compiled to a tiny thing worth of the IOCCC for the end user, but sometimes even us programmers want an easy setup.
It seems the only framework that still has a good story regarding that is Mithril…
- l1ambda 9y agohttp://jamesknelson.com/learn-raw-react-no-jsx-flux-es6-webpack/ http://jamesknelson.com/learn-raw-react-no-jsx-flux-es6-webp... Looks like Mithril code (https://mithril.js.org/ https://mithril.js.org/) if you alias React.createElement to a short function name. I learned Mithril before React, and kinda think it's a better learning experience to learn the simple way like this first, and then add build tools, Redux, JSX later (if you choose to).
- danabramov 9y agoIt's exactly the same as it always have been. See the doc: https://facebook.github.io/react/docs/react-without-es6.html https://facebook.github.io/react/docs/react-without-es6.html https://facebook.github.io/react/docs/react-without-jsx.html https://facebook.github.io/react/docs/react-without-jsx.html
- spicyj 9y agoIn particular: you just need these script tags: <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script> <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
- deleted 9y ago[deleted]
- amk_ 9y agoWrote about that recently: https://medium.com/@alexkrolick/writing-react-components-for-3rd-party-embedding-50331c18e26 https://medium.com/@alexkrolick/writing-react-components-for... See also: the docs