Giter VIP home page Giter VIP logo

boot-cljs-example's Introduction

boot-cljs-example Build Status

Example project using the boot build tool with the boot-cljs, boot-cljs-repl, and boot-reload tasks.

Prepare

Install boot. Then, in a terminal:

boot -u

This will update boot to the latest stable release version. Since boot is pre-alpha software at the moment, you should do this frequently.

Build

In a terminal do:

boot serve -d target/ watch speak cljs-repl cljs -usO none reload

This builds a pipeline for your project:

  • serve Starts a local web server. This task is not from a library - it is defined in build.boot.

    • -d Use target/ as the document root
  • watch Starts incremental build loop. Project will be rebuilt when source files change.

  • speak Audible notification (plays a sound file) for each build iteration, notifying of errors or warnings when appropriate.

  • cljs-repl Starts REPL and websocket servers. The browser client will connect to the websocket when the CLJS REPL is started (see below).

  • cljs Compiles ClojureScript namespaces to JavaScript.

    • -u Add <script> tags to HTML files when optimizations is none.
    • -s Create source maps for compiled JavaScript files.
    • -O none Use optimizations none (no GClosure compiler pass).
  • reload Starts live-reload websocket server and connects browser client to it. Resources (stylesheets, images, HTML, JavaScript) in the page are reloaded when they change.

You can view the generated content by opening http://localhost:3000/index.html in your browser.

OutOfMemoryError Troubleshooting

boot provides a tool called pods that make it possible for multiple independent Clojure classpaths to exist in the same JVM. Task authors can use Maven dependencies without worrying about shadowing or otherwise interfering with the dependencies in other pods.

One downside of pods is that their use results in higher-than-usual memory consumption by the JVM, particularly PermGen.

If you are using Java 7, you may see errors related to PermGen. You can consult the JVM Options wiki page for settings that can help.

You may also consider upgrading to Java 8, as it resolves many PermGen-related issues.

Start Browser REPL

With the build pipeline humming in the background, you can connect to the running nREPL server with either your IDE or at the command line in a new terminal:

boot repl --client

Then, you can start a CLJS REPL:

boot.user=> (start-repl)

The page will automatically reload and connect to the CLJS REPL websocket.

License

Copyright © 2014 Adzerk

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

boot-cljs-example's People

Contributors

alandipert avatar ducky427 avatar micha avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.