embedded-hoplon-example
This project demonstrates attaching a Hoplon element to a div in a static HTML file.
assets/index.html
is a static HTML file containing a div with the id mountpoint
.
src/app/main.cljs.hl
is a ClojureScript file processed by Hoplon. It contains
an ns
header instead of page
, so the Hoplon compiler emits only
ClojureScript, not HTML.
In src/app/main.cljs.hl
, jQuery is used to find the div to mount to. Then, an
instance of the counter
component is attached to it.
A Hoplon project designed to...well, that part is up to you.
Dependencies
- java 1.7+
- boot
Usage
Development
-
Start the
dev
task. In a terminal run:$ boot dev
This will give you a Hoplon development setup with:
- auto compilation on file changes
- audible warning for compilation success or failures
- auto reload the html page on changes
- Clojurescript REPL
-
Go to http://localhost:8000 in your browser.
-
If you edit and save a file, the task will recompile the code and reload the browser to show the updated version.
Production
-
Run the
prod
task. In a terminal run:$ boot prod
-
The compiled files will be on the
target/
directory. This will use advanced compilation and prerender the html.
License
Copyright © 2016, Your Name Goes Here