Skip to content

cloojure/cljs-template-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClojureScript Template Project

A complete, working sample project to demonstrate working code with external JavaScript dependency

Overview

Say you have a JavaScript library you need to include in a ClojureScript project. We have an example file dino.js we wish to depend on. The file dino-externs.js shows how to tell the Google Closure compiler about the dependency. The project.clj file shows the right syntax to make everything work as it should.

Setup

Project was created using lein new figwheel

Prior to running, you must install NodeJS dependencies:

./npm-install.bash    # => downloads npm modules (saved in `./node_modules` dir)

To get an interactive development environment run:

lein clean ; lein figwheel

A browser window will open. Go to the developer console to view results.

To clean all compiled files:

lein clean    # very important if build crashes & corrupt output files remain

To run Doo tests:

lein doo  chrome   test once    # can also test using Chrome browser
lein doo  chrome   test         # rerun the tests after every file edit       (*** CURRENTLY BROKEN ***)

lein doo  firefox  test once    # can also test using Firefox browser
lein doo  firefox  test         # rerun the tests after every file edit       (*** CURRENTLY BROKEN ***)

lein doo  safari   test once    # can also test using Safari browser
lein doo  safari   test         # rerun the tests after every file edit       (*** CURRENTLY BROKEN ***)

TODO

  • Add reagent stuff

  • Add reframe stuff

Obsolete or nonworking stuff

# slimer won't work with current version of firefox as of 2019-4-4
# lein doo  slimerjs  test once    # run the tests once and exit (note: not `phantomjs`)
# lein doo  slimerjs  test         # rerun the tests after every file edit       (*** CURRENTLY BROKEN ***)

# phantomjs is stuck with obsolete version of React as of 2019-4-4
# lein doo  phantom  test once    # run the tests once and exit (note: not `phantomjs`)
# lein doo  phantom  test         # rerun the tests after every file edit       (*** CURRENTLY BROKEN ***)

License

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.