Socket
Book a DemoInstallSign in
Socket

hotreload-cljs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hotreload-cljs

hotreload clojurescript without JVM

0.3.0
latest
npmnpm
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

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")
endfunc
au 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
(ns app.core)
(def root (. js/document getElementById "root"))
(set! (. root -textContent) "hello")

with index.html

<html>
<head>
  <style> body { margin: 0; color: gray; background-color: black; } #root { position: absolute;} </style>
</head>
<body>
  <div id="root"></div>
  <canvas id="canvas"></canvas>
  <script type="text/cljs" src="src/app/core.cljs"></script>
</body>
</html>

with inline cljs

<html>
<head>
  <style> body { margin: 0; color: gray; background-color: black; } #root { position: absolute;} </style>
</head>
<body>
  <div id="root"></div>
  <canvas id="canvas"></canvas>
  <script type="text/cljs">
(ns app.core)
(def root (. js/document getElementById "root"))
(set! (. root -textContent) "hello")
  </script>
</body>
</html>

inline cljs

add this to your index.html. demo

<script src="https://unpkg.com/hotreload-cljs/dist/cljs.js"></script>

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

Keywords

clojurescript

FAQs

Package last updated on 17 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.