Brak opisu

Lucas Stadler a58f73fe66 some impressions & a note to tryout css-layout 11 lat temu
..
.gitignore ee9e35002c hello, es6 & webpack 11 lat temu
README.md a58f73fe66 some impressions & a note to tryout css-layout 11 lat temu
comments.json 8a83c48c5d load comments from json 11 lat temu
content.js ee9e35002c hello, es6 & webpack 11 lat temu
entry.js bde08d37cd render comments on submit 11 lat temu
index.html 3a8728880a start working through the react tutorial 11 lat temu
package.json 52d1b31722 support markdown in comments 11 lat temu
style.css ee9e35002c hello, es6 & webpack 11 lat temu
webpack.config.js ee9e35002c hello, es6 & webpack 11 lat temu

README.md

Playing with React

More opinions/impressions coming later, when I have played with this more.

Impressions

  • ES6 is quite cool, especially if you wrote just plain JS before (using 6to5)

    Some things: import React from "react";, template strings, () => ...,

  • webpack is fun/convenient/surprisingly fast (and has support for all the things we use here, e.g. react/jsx, 6to5, css)

  • JSX works well, even though I'd prefer doing it in Clojure (hiccup syntax, e.g. nested vectors & collections. has someone written a library for that already?)

  • showdown, which was suggested by the tutorial, doesn't work with module loaders and it was a pain to figure out how to fix it. (the fix was using a different library.)

How to run this thing

$ npm install -g webpack
$ npm install
$ webpack --watch

# visit index.html in your browser

$ vi entry.js      # change something!

Ideas

  • follow "the way", at least at first, see how it works.
    • e.g. JSX, 6to5, webpack (JSX is a react thing, 6to5 & webpack are for sanity)
  • things to try
    • build a tiny thingy ("profile badge")
    • put it in a list
    • sort the list
    • filter the list
    • make the filter dynamic (optional/difficult)
  • in the future:
    • try out immutable.js & reimplement the above
    • try out css-layout and/or styles in js

Resources

  • React.js Conf 2015 seemed fun & quite interesting. For inspiration, watch HYPE!
  • om, because you actually want to use Clojure ;)

Misc

  • npm config set prefix $HOME/.local --global