Skip to content

Instantly share code, notes, and snippets.

@bhauman
Last active January 7, 2017 14:39
Show Gist options
  • Save bhauman/146e067c8cc4d5aa3fd2 to your computer and use it in GitHub Desktop.
Save bhauman/146e067c8cc4d5aa3fd2 to your computer and use it in GitHub Desktop.
Comments: Straightforward (Live) Functional JavaScript: Building the Yome Widget
@crofty
Copy link

crofty commented Jun 11, 2015

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

@tomisme
Copy link

tomisme commented Jun 11, 2015

I'm also interested in a follow up!

@kirilloid
Copy link

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

@bhauman
Copy link
Author

bhauman commented Jun 16, 2015

@kirilloid thanks!

@padge
Copy link

padge commented Jun 16, 2015

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

@edbond
Copy link

edbond commented Jun 25, 2015

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

@orb
Copy link

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
Copy link

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
Copy link

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
Copy link

Super, interesting and useful!

@fasiha
Copy link

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