Questions tagged [figwheel]

Figwheel builds your ClojureScript code and hot loads it into the browser as you are coding.

Features

  • Live code reloading: If you write reloadable code, figwheel can facilitate automated live interactive programming. Every time you save your ClojureScript source file, the changes are sent to the browser so that you can see the effects of modifying your code in real time.

  • Supports Node.js: You can use figwheel to live code ClojureScript in Node.js!

  • Static file server: The inclusion of a static file server allows you to get a decent ClojureScript development environment up and running quickly. For convenience there is a :ring-handler option so you can load a ring handler into the figwheel server.

  • Live CSS reloading: Figwheel will reload your CSS live as well.

  • Heads up display: Figwheel has a non-intrusive heads up display that gives you feedback on how well your project is compiling. By writing a shell script you can click on files in the heads up display and they will open in your editor!

  • Built-in ClojureScript REPL: When you launch figwheel it not only starts a live building/reloading process but it also optionally launches a CLJS REPL into your running application. This REPL shares compilation information with the figwheel builder, so as you change your code the REPL is also aware of the code changes. The REPL also has some special built-in control functions that allow you to control the auto-building process and execute various build tasks without having to stop and rerun lein-figwheel.

  • Robust connection: Figwheel's connection is fairly robust. I have experienced figwheel sessions that have lasted for days through multiple OS sleeps. You can also use figwheel like a REPL if you are OK with using print to output the evaluation results to the browser console.

  • Message broadcast: Figwheel broadcasts changes to all connected clients. This means you can see code and CSS changes take place in real time on your phone and in your laptop browser simultaneously.

  • Respects dependencies: Figwheel will not load a file that has not been required. It will also respond well to new requirements and dependency tree changes.

  • Calculates minimal reload set: Figwheel does its best to only reload what needs to be reloaded. This minimizes the surface area of dynamically reloaded code, which in turn should increase the stability of the client environment.

  • Doesn't load code that is generating warnings: If your ClojureScript code is generating compiler warnings Figwheel won't load it. This, again, is very helpful in keeping the client environment stable. This behavior is optional and can be turned off.

Source: [https://github.com/bhauman/lein-figwheel]

84 questions
10
votes
2 answers

How do I deploy a single-page app. written in ClojureScript / Figwheel to a static server?

I'm playing with Figwheel and writing a simple single-page app that doesn't require any server-side intelligence. In principle, this app. could be placed on any static web-server. But how do I actually deploy it? It looks like the main.js which is…
interstar
  • 22,620
  • 31
  • 101
  • 161
7
votes
1 answer

Can Figwheel evaluate ClojureScript code when a resource file changes?

I have a macro that slurps a markdown file from resources. It provides a convenient way to provide some content. But when I edit the markdown file, Figwheel has no way to know that it needs to re-evaluate the macro. Putting the markdown in a string…
Timothy Pratley
  • 10,106
  • 3
  • 29
  • 55
5
votes
1 answer

lein figwheel vs lein cljsbuild auto

What is the difference between lein figwheel and lein cljsbuild auto because I believe that they are both used to compile clojurescript. Also is there any benefit to using one over the other?
rbb
  • 919
  • 6
  • 14
5
votes
2 answers

How can I communicate with the backend using ClojureScript and Figwheel?

Note: I'm a moderately experienced programmer in general and using clojure but have never done serious web development. I set up a basic ClojureScript project using Chestnut and walked through the "Hello World" steps just fine. However I would…
Sebastian Oberhoff
  • 1,057
  • 1
  • 8
  • 12
4
votes
1 answer

Trouble setting up Figwheel REPL within CIDER

I just started playing around with making a simple cljs app using the following template: lein new figwheel someproject -- --reagent I was hoping to use the REPL in cider for cljs development the same way I typically would for a normal clj project,…
Solaxun
  • 2,454
  • 1
  • 13
  • 33
4
votes
1 answer

Accessing defrecord methods in ClojureScript Figwheel

I have some code in cljc files which compiles to both Clojure and ClojureScript. in protocols.cljc (defprotocol Transformable ".." (scale [this scalar] "" ) ...) in pattern.cljc (defrecord APattern [paths] Transformable (scale [this…
interstar
  • 22,620
  • 31
  • 101
  • 161
4
votes
1 answer

Connect Cider to Luminus +CLJS Figwheel repl

I've had pretty simple use of Cider REPL in the past; within a project's clj file I use cider-jack-in and I'm good to go (assuming the following in my .lein/profiles.clj ;; ~/.lein/profiles.clj {:user {:plugins [[lein-localrepo "0.5.2"] …
WorldsEndless
  • 1,355
  • 1
  • 13
  • 27
3
votes
2 answers

Is there an easier way to use BOTH clj + cljs REPLs at the same time from emacs/cider?

As a beginner Clojurian I may need some help trying to understand if there is any way to solve my pain points of working with Cider REPL. Context: I have a full-stack app(limunius on backend + re-agent/figwheel on frontend). I start the server from…
Nikita Fedyashev
  • 15,938
  • 11
  • 41
  • 69
3
votes
2 answers

Reagent configuration for multi-page applications

My project.clj has, :cljsbuild {:builds {:app {:source-paths ["src/cljs" "src/cljc"] :compiler {:output-to "target/cljsbuild/public/js/app.js" :output-dir…
Adeel Ansari
  • 38,068
  • 12
  • 89
  • 127
3
votes
1 answer

REPL - Figwheel won't connect to re-natal app

I'm starting an app from Re-Natal template (didn't change it; project.clj from https://github.com/drapanjanas/re-natal/blob/master/resources/project.clj). Then I ran react-native start re-natal use-android-device avd re-natal use-figwheel lein…
alepeino
  • 8,766
  • 3
  • 26
  • 44
3
votes
0 answers

How to set up lein cooper on Windows?

I've followed the Leinigen install instructions on Windows (with c:\leinigen\ in my path, which is where lein.bat is). I'm now trying to use lein-cooper but this is giving me the following error: java.io.IOException: Cannot run program "lein":…
Jeroen
  • 53,290
  • 30
  • 172
  • 279
3
votes
1 answer

ClojureScript Eval. How to use libraries included in the calling code

I have a Clojurescript program running in the browser. It imports a number of libraries, and then I want to allow the user to enter some small clojurescript "glue-code" that calls those libraries. I can see (from…
interstar
  • 22,620
  • 31
  • 101
  • 161
3
votes
2 answers

Figwheel doesn't detect most changes in my code

Figwheel displays the code bellow just fine. But I have to refresh the page to see any changes. What has to change for Figwheel to show changes? Is there a command to force redraw, without losing the application state? BTW: Chrome has Disable Cache…
dilvan
  • 1,730
  • 1
  • 15
  • 26
3
votes
2 answers

Invalidate all cache with lein figwheel

I've run into several problems with Fighweel's hot code reloading when it doesn't reload everything it has to reload and old state/code persists even if it's no longer in the source code and even if I re-run lein figwheel. What is the easiest way to…
0x60
  • 2,628
  • 1
  • 13
  • 16
3
votes
1 answer

How to set up atom editor for clojurescript development with figwheel?

It looks like the atom editor has a reasonable degree of clojure and clojurescript support through various packages. Does anyone have a recommended way to configure it to use figwheel? Clearly this is possible using a separate terminal, but I'm…
grumplet
  • 285
  • 2
  • 14
1
2 3 4 5 6