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]

89 questions
1
vote
0 answers

clojurescript unit testing recommendations

Trying to setup basic unit testing with clojurescript. Looked at: https://github.com/clojure/clojurescript/wiki/Testing In my project.clj file I have: :cljsbuild { :builds [{:id "dev" :source-paths ["src" "test"] …
ftravers
  • 3,809
  • 3
  • 37
  • 38
1
vote
2 answers

ClojureScript cljsbuild doesn't load dependencies without optimisations

I am trying to use figwheel in my ClojureScript build. It works with lein cljsbuild auto already, but I have to put :optimisations :whitespace. Otherwise I get a message in the browser : Uncaught ReferenceError: goog is not defined However figwheel…
nha
  • 17,623
  • 13
  • 87
  • 133
1
vote
1 answer

electron+figwheel on Mac causes websocket connection error

Background I am trying to integrate figwheel with electron(atom-shell). I use lein new figwheel hello-world -- --reagent to generate figwheel part, and copied the electron part from electron quick start. The resulting project is here. Question Run…
LotAbout
  • 707
  • 5
  • 18
0
votes
1 answer

Clojurescript compiler options in leiningen

An error message in my browser has informed me that: ClojureScript could not load :main, did you forget to specify :asset-path? According to the documentation, :asset-path is a compiler option. What is the correct place in my leiningen…
BnMcGn
  • 1,440
  • 8
  • 22
0
votes
0 answers

How to create a multi-page application with Figwheel and Leiningen?

I have a simple Figwheel application which is built with Leiningen. I want to have multiple pages in it: index.html should use the code from hello-figwheel.core. page2.html should use the code from hello-figwheel.page2 I assume I have to somehow…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
0
votes
0 answers

CLJS Uncaught TypeError: Cannot read property 'call' of undefined

I am writing a cljs library from scratch (i.e. without a leiningen template). Using lein figwheel, Figwheel successfully compiles my cljs into JS, but doesn't fully connect to my application because of the following three errors that show up in the…
duplic8
  • 109
  • 1
  • 9
0
votes
1 answer

Figwheel reloadable code with atom as local (lexical) state?

I'm evolving my way towards a suitable design for state with reagent given my project, and while still using distinct atoms (i'll probably switch to a single atom, but trying to explore the space of possibilities at present), I've tried to set up…
mwal
  • 2,803
  • 26
  • 34
0
votes
0 answers

Failed to compile in a 'lein new figwheel foo -- --reagent'

I want to start a project with reagent and figwheel and I have done it before with that command and it has worked, in fact they still work. But with a new one some of the configurations and versions of dependencies changed and it no longer starts…
0
votes
1 answer

Including JS files compiled using Figwheel to Uberjar built

Here is Figwheel config, app.cljs.edn ^{:watch-dirs ["src/cljs" "src/cljc"]} {:modules {:aff {:entries #{asaas.aff.aff} :output-to "target/public/js/aff.js"} :loc {:entries #{asaas.aff.loc} :output-to "target/public/js/loc.js"} …
Adeel Ansari
  • 39,541
  • 12
  • 93
  • 133
0
votes
1 answer

How to get updated app on reload in Figwheel?

Using Figwheel with cljs projects gives me unreliable caching. Sometimes saving the project doesn't load Figwheel, and then if I refresh the page, instead of loading the latest version of the app, it takes me to an earlier cached version of the app.…
zengod
  • 1,114
  • 13
  • 26
0
votes
1 answer

How do I tell figwheel to start and connect to Google Chrome instead of Firefox?

I'm taking some baby steps with figwheel. When I fire up the tutorial application, it starts firefox, which then connects back to the figwheel process to get code to run on its JavaScript engine. If firefox is already running, a new tab is opened…
David Tonhofer
  • 14,559
  • 5
  • 55
  • 51
0
votes
1 answer

How to set nREPL with Clojure CLI (tools.deps) & figwheel-main

I want to use an nREPL server to connect from Emacs Cider with Clojure CLI (tools.deps, not Leiningen) & figwheel-main. How do I set up my deps.edn or else? I know there're nice examples for setups with Leingen&figwheel-main and…
yokoiwa
  • 97
  • 1
  • 5
0
votes
1 answer

is there an example repo to try Calva with Figwheel-Main?

could you please point me in the right direction: i've been successfully using calva with old figwheel, but cannot connect to figwheel-main.. (have no problems connecting to shadow-cljs ). i've been failing for a while now. what i do: select…
0
votes
1 answer

ClojureScript Figwheel - REPL fails to recover prompt after error

I'm wondering how to get figwheel to recover after an error is thrown in the REPL. I'm starting figwheel from a cli tools set up (no lein). => clojure -m figwheel.main --build somebuild --repl Once an error is thrown (this doesn't happen with every…
MFave
  • 1,044
  • 2
  • 8
  • 19
0
votes
2 answers

How to setup figwheel-main to reload code served by clojure backend

I have looked for an answer to this online, google etc..but I can't find anything to help me do what I'm trying : Here's the scenario - I've clojure code running a jetty server instance and serving content including html generated by hiccup. I've…