Giter Club home page Giter Club logo

figwheel-riesling-template's Introduction

figwheel-template

A Leinigen template to get started with Figwheel.

Usage

Make sure you have the latest version of leiningen installed.

lein new figwheel hello-world

Options

--react     Adds a bare bones React app, including Sablono.
--reagent   Adds a bare bones Reagent app.
--rum       Adds a bare bones Rum app.
+no-bundle  Generates a project without npm and webpack support.

Include the options using -- to separate them from Leiningens options, like so

lein new figwheel hello-world -- --reagent

Usage

To get an interactive development environment run

npm install

and then

lein figwheel

from the project root directory.

Wait ... until the project finishes compiling and then ... open your browser at localhost:3449/index.html.

Figwheel will now be running and will auto compile and send all changes to the browser without the need to reload.

After the compilation process is complete, and you have loaded the compiled project in your browser you will get a ClojureScript REPL prompt that is connected to the browser.

An easy way to verify this is:

(js/alert "Am I connected?")

and you should see an alert in the browser window.

To clean all compiled files:

lein clean

To create a production build run:

lein do clean, cljsbuild once min

And open your browser in resources/public/index.html. You will not get live reloading, nor a REPL.

Npm dependencies

The generated project is compatible with Webpack and npm and you can add JavaScript dependencies via the normal npm install route.

From the Clojure REPL

Alternatively you can lauch Figwheel from the REPL.

If you run lein repl a Clojure REPL will launch.

From this REPL prompt you can run

user> (fig-start)

and this will launch figwheel but will not launch the ClojureScript REPL.

You can launch the Figwheel ClojureScript REPL like so:

user> (cljs-repl)

Please see dev/user.clj for more information.

Note: you should always run lein figwheel to verify that you have setup everything correctly.

License

Copyright © 2020 Bruce Hauman

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

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.