-
-
Save bhauman/146e067c8cc4d5aa3fd2 to your computer and use it in GitHub Desktop.
I'm also interested in a follow up!
You don't need to map and reduce with &&, there's every
method in javascript.
@kirilloid thanks!
Fantastic post! I'm interested in a follow-up as well 👍.
@bhauman Did you check mori.js? Can you highlight differences between Immutable.js and mori?
How is react.min.js
supposed to get in the build
directory? I downloaded it manually and added it to src
and everything went fine. Did I miss some step?
Very inspiring. I strive for this sort of simplicity/purity but the side effect and mutability potholes are plenty! What I did not like about the code were too short variable names at places. My biggest cognitive cost was to decipher what they represented. Would be interested in a followup!
With Babel 6, I had to modify the npm commands:
sudo npm install -g babel-cli
cd yome_widget
npm install babel-preset-es2015 babel-plugin-transform-react-jsx
The watch command is
babel -w -d build/ --presets es2015 --plugins transform-react-jsx src/
This handles ES2015 & JSX transpiling! 👍
Super, interesting and useful!
A friend and I worked through this setup for early 2017. A lot has changed in the tooling, but here’s a snapshot of the repo with everything working:
You’ll need:
- We downloaded react.min.js and react-dom.min.js from the CDN and put them in
build
: http://reactjs.cn/ npm install
to install Babel locally- Babel scripts in
package.json
that you run vianpm run build
. (This package.json doesn’t show it, but you should make awatch
script containing"babel -w src -d build"
(note that extra-w
flag for watch). .babelrc
.
Good article Bruce, thanks!
Just registering my interest for the follow up that you mentioned 👍