Create a gist now

Instantly share code, notes, and snippets.

Comments: Straightforward (Live) Functional JavaScript: Building the Yome Widget
@crofty
crofty commented Jun 11, 2015

Good article Bruce, thanks!
Just registering my interest for the follow up that you mentioned 👍

@tomisme
tomisme commented Jun 11, 2015

I'm also interested in a follow up!

@kirilloid

You don't need to map and reduce with &&, there's every method in javascript.

@bhauman
Owner
bhauman commented Jun 16, 2015

@kirilloid thanks!

@padge
padge commented Jun 16, 2015

Fantastic post! I'm interested in a follow-up as well 👍.

@edbond
edbond commented Jun 25, 2015

@bhauman Did you check mori.js? Can you highlight differences between Immutable.js and mori?

@orb
orb commented Jun 27, 2015

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?

@jonrh
jonrh commented Jun 28, 2015

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!

@fasiha
fasiha commented Feb 15, 2016

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! 👍

@rsmoorthy

Super, interesting and useful!

@fasiha
fasiha commented Jan 7, 2017

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:

mudroppi/Yome.js@b7f31a6

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 via npm run build. (This package.json doesn’t show it, but you should make a watch script containing "babel -w src -d build" (note that extra -w flag for watch).
  • .babelrc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment