hotreload : clojurescript development without jvm
npm i -g hotreload-cljs
hotreload
open http://localhost:3000
Flags
- --port default to 3000
Immidate feedback: vim config
func Hotreload() silent call system('/usr/bin/curl -H "Content-Type: text/plain" http://localhost:3000/hotreload/' . expand("%:p") . " -d " . shellescape(join(getline(1,'$'), "\n")) . " > /dev/null")endfuncau FileType clojure,html,javascript,css noremap <F5> :call Hotreload()<cr>au TextChanged,TextChangedI *.cljs,*.js call Hotreload()
Examples
without index.html
; src/app/core.cljs - must be inside src
with index.html
with inline cljs
inline cljs
add this to your index.html. demo
Features
- eval clojurescript in devtools console by
e`(prn "hello world")`
- write clojurescript inside
<script type="text/cljs"></script>
- load external clojurescript
<script type="text/cljs" src="myns.cljs"></script>
( only works in firefox when opened directly without a http server )
Tips
-
write clojurescript without an external editor
- devtools Sources
- Add folder to workspace
- edit
- Ctrl+S
- Ctrl+R
-
Take a look at klipse for faster experience