A series of tutorials to guide you in creating and setting up ClojureScript (CLJS) projects.
This series of tutorials will guide you in creating, setting up and running simple CLJS projects. The series follows a progressive enhancement of projects themselves.
Assuming you already have installed leiningen 2, to run the last available tutorial without coding:
$ git clone https://github.com/magomimmo/modern-cljs.git
$ cd modern-cljs/compiler
$ git clone https://github.com/magomimmo/clojurescript.git
$ cd clojurescript
$ ./script/bootstrap
$ cd ../..
$ lein ring server
- open a new terminal and cd in modern-cljs
$ lein cljsbuild once
$ lein trampoline cljsbuild repl-listen
- visit login-dbg.html and/or shopping-dbg.html
- play with the repl connected to the browser
NOTE: If you want to access the code of any single tutorial because you don't want to
copy&paste
it or you don't want to write it yourself, do as follows:
$ git clone https://github.com/magomimmo/modern-cljs.git
(if you have not already done);$ cd modern-cljs
$ git checkout tut-01 # for tutorial 1, tut-02 for tutorial 2 etc.
That said, I suggest coding yourself the content of the tutorials. In my experience is always the best choice if you are not already fluent in the programming language you have under your fingers.
In the first tutorial you are going to create and configure a very basic CLJS project.
In this tutorial you are going to set up a browser connected CLJS REPL (bRepl) using an external http-server.
In this tutorial you are going to substitute the external http-server with ring, a CLJ based http-server.
In this tutorial we start having some fun with CLJS form validation, by porting from JS to CLJS the login form example of Modern Javascript: Development and desing by Larry Ullman.
In this tutorial we're going to use domina library to make our login form validation more clojure-ish.
In this tutorial we're going to investigate and solve in two different ways the not so nice issue we met in the last tutorial.
In this tutorial we're going to explore CLJS/CLS compilation modes by
using the usual lein-cljsbuild
plugin of leiningen
, but we'll
discover a trouble we do not know how to manage yet.
In this tutorial we're going to patch CLJS compiler for solving the code duplication trouble we met in the previous tutorial.
In this tutorial we're going to illustrate the clojure testing tool using the patched CLJS compiler as a true and real-life case.
In this tutorial we're going to finish the work started in the previus one by introducing mocks to manage the tests of CLJS compiler in the mutable world of the file system.
TO BE DONE
In this section of the series I'll collect any content that would have weighted down any individual tutorials.
TO BE DONE
TO BE DONE
TO BE DONE
TO BE DONE
Copyright © Mimmo Cosenza, 2012. Released under the Eclipse Public License, the same as Clojure.