Giter Club home page Giter Club logo

boot-cljs-repl's Introduction

boot-cljs-repl

[adzerk/boot-cljs-repl "0.1.9"] ;; latest release

or

[adzerk/boot-cljs-repl "0.1.10-SNAPSHOT"] ;; current snapshot

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

Usage

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

(set-env! :dependencies '[[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"]])
(require '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl])

You can see the options available on the command line:

$ boot cljs-repl -h

or in the REPL:

boot.user=> (doc cljs-repl)

Setup

A typical boot.build file for ClojureScript development:

(set-env!
  :src-paths    #{"src"}
  :dependencies '[[adzerk/boot-cljs      "0.0-X-Y" :scope "test"]
                  [adzerk/boot-cljs-repl "X.Y.Z"   :scope "test"]])

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

When compiling with optimization level none and you're not using the -u option with the cljs task you must add a script tag to the page HTML to connect the client to the REPL server:

<!-- Note: This is only needed when optimization level is :none
     and the -u (--unified) option is not specified for the cljs task. -->
<script type="text/javascript">goog.require('adzerk.boot_cljs_repl');</script>

Build

Start a build pipeline with file-watcher, ClojureScript REPL server, and compile ClojureScript with source maps, unified HTML loading, and no optimizations:

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

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 RET RET RET
boot.user=> (start-repl)

Vim Fireplace

:Piggieback (repl-env)

License

Copyright © 2014 Adzerk

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

boot-cljs-repl's People

Contributors

alandipert avatar martinklepsch avatar mdiin avatar micha avatar myguidingstar avatar nblumoe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.