All Projects → adzerk-oss → Boot Cljs Repl

adzerk-oss / Boot Cljs Repl

Licence: epl-1.0
Boot task providing a REPL for ClojureScript development.

Programming Languages

clojure
4091 projects
clojurescript
191 projects

Labels

Projects that are alternatives of or similar to Boot Cljs Repl

Boot Figreload
Boot task providing live-reload using Fighweel client
Stars: ✭ 50 (-32.43%)
Mutual labels:  boot
Baapan
✨ Super Cool NPM Playground right on the Node REPL ✨
Stars: ✭ 60 (-18.92%)
Mutual labels:  repl
Drepl
A REPL for D
Stars: ✭ 70 (-5.41%)
Mutual labels:  repl
Nclap
NClap is a .NET library for parsing command-line arguments and building interactive command shells. It's driven by a declarative attribute syntax, and easy to extend.
Stars: ✭ 51 (-31.08%)
Mutual labels:  repl
Bootstrap
Tools to bootstrap micro computers
Stars: ✭ 55 (-25.68%)
Mutual labels:  boot
Geolocator
Location tracking & geofencing the easy way. Supports background, killed app, rebooted device different update intervals.
Stars: ✭ 60 (-18.92%)
Mutual labels:  boot
Debootstick
Generate a bootable live image from any Debian/Ubuntu filesystem tree.
Stars: ✭ 48 (-35.14%)
Mutual labels:  boot
Docker Pxe
A virtualized implementation of PXE supported by DNSMasq
Stars: ✭ 72 (-2.7%)
Mutual labels:  boot
Spring Cloud Stream Demo
Simple Event Driven Microservices with Spring Cloud Stream
Stars: ✭ 58 (-21.62%)
Mutual labels:  boot
Ts Node
TypeScript execution and REPL for node.js
Stars: ✭ 9,571 (+12833.78%)
Mutual labels:  repl
Ronin
Experimental Graphics Terminal
Stars: ✭ 1,065 (+1339.19%)
Mutual labels:  repl
I8086.js
16bit Intel 8086 / 80186 + X87 emulator written in TypeScript with REPL assembly compiler and tiny C compiler
Stars: ✭ 54 (-27.03%)
Mutual labels:  repl
Trymodule
➰ It's never been easier to try nodejs modules!
Stars: ✭ 1,115 (+1406.76%)
Mutual labels:  repl
Indium
A JavaScript development environment for Emacs
Stars: ✭ 1,058 (+1329.73%)
Mutual labels:  repl
Repl
🐚 an instant REPL for any command
Stars: ✭ 71 (-4.05%)
Mutual labels:  repl
Multibootusb
Create multiboot live Linux on a USB disk...
Stars: ✭ 1,042 (+1308.11%)
Mutual labels:  boot
Boot Http
A simple HTTP serve task for the Boot build tool
Stars: ✭ 60 (-18.92%)
Mutual labels:  boot
Ramtuary
Ramda + Ramda Fantasy + Sanctuary REPL 🌿
Stars: ✭ 72 (-2.7%)
Mutual labels:  repl
Akilang
A compiler for a simple language, built with Python and LLVM
Stars: ✭ 71 (-4.05%)
Mutual labels:  repl
Flask Konch
An improved shell command for the Flask CLI
Stars: ✭ 65 (-12.16%)
Mutual labels:  repl

boot-cljs-repl

[adzerk/boot-cljs-repl   "0.4.0"] ;; latest release
[cider/piggieback        "0.3.9"  :scope "test"]
[weasel                  "0.7.0"  :scope "test"]
[nrepl                   "0.4.5"  :scope "test"]

Boot task providing a ClojureScript browser REPL via Weasel and Piggieback.

This task requires Clojure 1.7+ to learn how to pin the Clojure version in a Boot project head to the Boot wiki.

NOTE: Version 0.3.0 changed how the REPL dependencies are handled. For now user is required to add dependencies to necessary libraries to one's project. Cljs-repl task will print the required dependecies when run. [1]

Usage

Add boot-cljs-repl to your build.boot dependencies and require the namespace:

(require '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]])

cljs-repl is the task to be used in the task pipeline whereas start-repl is how you connect to the ClojureScript REPL once you're in a Clojure REPL.

It's also a good idea to explicitly depend on the specific version of Clojure and ClojureScript needed for your application.

Build

Start a build pipeline with file-watcher, ClojureScript REPL server, and compile ClojureScript with no optimizations:

# note: cljs-repl task must precede cljs task
$ boot watch cljs-repl

or

(deftask dev []
  (comp (watch)
        (cljs-repl) ; order is important!!
        (cljs)))

For optional configuration see boot cljs -h and boot cljs-repl -h.

Important: The cljs-repl task injects things into your build so if you run the compiler before the cljs-repl task is being run your REPL will not work.

REPL

To start evaluating forms in the browser you must first connect to the running Clojure nREPL server (started by the cljs-repl task above) and create a new, browser-connected CLJS REPL.

Terminal

$ boot repl -c
boot.user=> (start-repl)

Emacs Cider

M-x cider-connect
boot.user=> (start-repl)
The cljs-repl-env task

There is a cljs-repl-env task that doesn't start a new nREPL server which you can use via cider-jack-in. An example is shown below.

(require ...
    '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl cljs-repl-env]]
    ...
    )

(deftask dev []
  (comp (watch)
        (cljs-repl-env) ; order is important!!
        (cljs)))
M-x cider-jack-in
boot.user=> (def p (future (boot (dev))))
...
boot.user=> (start-repl)

Vim Fireplace

:Piggieback (adzerk.boot-cljs-repl/repl-env)

Cursive

First specify an nREPL-port in the cljs-repl task:

(cljs-repl :nrepl-opts {:port 9009})

Then create a new nREPL in Cursive: Run -> Edit Configurations -> + -> Clojure REPL -> Remote

Pick "Connect to Server" and fill in

Host: localhost

Port: 9009

Help

You can see the task options available on the command line:

$ boot cljs-repl -h

or in the REPL:

boot.user=> (doc cljs-repl)

Notes

Cljs repl options

You can pass Cljs repl options at the start-repl call:

boot.user=> (start-repl :cljs-repl-opts {:repl-verbose true})

From Fireplace:

FIXME: Not supported...

Direct dependencies

For now user needs to add direct dependencies to REPL libs (piggieback, weasel) to one's project. This is because Boot tasks shouldn't modify the classpath of the application by adding new dependencies, either by calling set-env! or though transitive dependencies. The preferred way for Boot tasks to use additional libraries is through pods but because the REPL is currently run on the main pod (where your application code runs), it's not currently possible to use this.

License

Copyright © 2014-15 Adzerk

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].