ClojureScript: A Great Place for React - Jorge Colindres @ ReactNYC
HTML-код
- Опубликовано: 5 июл 2018
- This talk is about a few things that make React development a natural fit within ClojureScript. I will cover things like immutability, functional programming, EDN and S-expressions, macros, and a few other things.
RESOURCES
ClojureScript Official Site
clojurescript.org
ClojureScript API
cljs.github.io/api
Closure Generated API Docs
google.github.io/closure-libr...
ClojureScript for JavaScript Developers Starter Repo
github.com/colindresj/cljs-fo... - Наука
Note that starting with ClojureScript does not need to be hard. All you need are a JDK and Leiningen, then you can just create a project by running: lein new reagent-frontend myapp
This creates a skeleton application from a template with everything setup to work out of the box.
Here's a workshop I put together that runs through making a small app using Reagent, and packaging a release artifact: github.com/ClojureTO/JS-Workshop
Pretty unique introduction to some of the strengths of ClojureScript. I especially liked the extend-type example and the app state serialisation.
16:53 - they meant more signal to noise, not less. Thankfully I'm here to correct it.
What about other js ui libraries? And native html + js?
Great talk indeed. But how about the tooling and setup?
It's so simple. Leiningen/Boot for app builder, Lumo as a compiler without JVM. Cursive for editing (for example).
15:43 What is the setup to replicate reactive states like that ? :O
It comes pretty much for free in ClojureScript development. You store your entire state using Clojure data structures in a single container called an atom and the contents of this can be easily serialised into a JSON-like format called EDN. You just load that data somewhere else to recreate the state. This would work with basically any React-based library in Clojure, e.g. reagent, re-frame, rum, etc.
16:53 - i think your Javascript could be cleaner, and i don't think that is a direct comparison of Javascript and ClojureScript, it was an interesting talk though