Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A short series of tutorials on ClojureScript

This branch is 923 commits behind magomimmo:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
compiler
doc
resources/public
src
test/modern_cljs
.gitignore
README.md
project.clj

README.md

modern-cljs

A series of tutorials to guide you in creating and setting up ClojureScript (CLJS) projects.

Introduction

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:

  1. $ git clone https://github.com/magomimmo/modern-cljs.git
  2. $ cd modern-cljs/compiler
  3. $ git clone https://github.com/magomimmo/clojurescript.git
  4. $ cd clojurescript
  5. $ ./script/bootstrap
  6. $ cd ../..
  7. $ lein ring server
  8. open a new terminal and cd in modern-cljs
  9. $ lein cljsbuild once
  10. $ lein trampoline cljsbuild repl-listen
  11. visit login-dbg.html and/or shopping-dbg.html
  12. 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.

Tutorial 1 - The basic

In the first tutorial you are going to create and configure a very basic CLJS project.

Tutorial 2 - Browser CLJS REPL (bREPL)

In this tutorial you are going to set up a browser connected CLJS REPL (bRepl) using an external http-server.

Tutorial 3 - CLJ based http-server

In this tutorial you are going to substitute the external http-server with ring, a CLJ based http-server.

Tutorial 4 - Modern ClojureScript

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.

Tutorial 5 - Introducing Domina

In this tutorial we're going to use domina library to make our login form validation more clojure-ish.

Tutorial 6 - Easy made Complex and Simple made Easy

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.

Tutorial 7 - On being doubly aggressive

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.

Tutorial 8 - Learn by contributing

In this tutorial we're going to patch CLJS compiler for solving the code duplication trouble we met in the previous tutorial.

Tutorial 9 - It's better to be safe than sorry - Part 1

In this tutorial we're going to illustrate the clojure testing tool using the patched CLJS compiler as a true and real-life case.

Tutorial 10 - It's better to be safe than sorry - Part 2

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.

Tutorial 11 - TO BE DONE

TO BE DONE

Appendices

In this section of the series I'll collect any content that would have weighted down any individual tutorials.

Appendix A - TBD

TO BE DONE

Appendix B - TBD

TO BE DONE

Appendix C - TBD

TO BE DONE

Appendix X - TBD

TO BE DONE

License

Copyright © Mimmo Cosenza, 2012. Released under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.