Skip to content

Instantly share code, notes, and snippets.

@astarr
Created May 10, 2014 20:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astarr/ae47969fa976cb745ee1 to your computer and use it in GitHub Desktop.
Save astarr/ae47969fa976cb745ee1 to your computer and use it in GitHub Desktop.
Getting started with cljs-start and Reagent
$ lein new cljs-start wonderful-lib
$ lein test
# So far, so good. Now, modify project.clj to add reagent as dependency:
...
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2138"]
[reagent "0.4.2"]]
...
$ lein test
# Still good. Next, modify profiles.clj, to add react in preamble:
...
{:shared {...
:cljsbuild
{:builds {:wonderful-lib
{:source-paths ["test/cljs"]
:compiler
{:output-dir "dev-resources/public/js"
:source-map "dev-resources/public/js/wonderful_lib.js.map"
:preamble ["reagent/react.js"]}}}
...
$ lein do clean, test
# Running ClojureScript test: phantomjs
# TypeError: 'undefined' is not a function (evaluating 'RegExp.prototype.test.bind(
# /^(data|aria)-[a-z_][a-z\d_.\-]*$/
# )')
@astarr
Copy link
Author

astarr commented May 10, 2014

@holmsand, I'm excited to start using Reagent -- thanks for writing it!

I'm hoping to get started with ClojureScript and cljs-start is a nice way to get tests, and a repl, and etc. all working at once. But, then, following the instructions to set up Reagent leads to sadness. Without a Clojure, Leiningen, Maven, ClojureScript or React background, I'm not doing a very good job of figuring out why this is failing.

@martindemello
Copy link

cemerick/clojurescript.test#32 for the lein test error at the end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment