oakmac / cuttle

User Interface for the ClojureScript Compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Figwheel integration

shaunlebron opened this issue · comments

Figwheel is a big deal in cljs right now, which hot-loads compiled code into the running app when files change. I don't think it would be difficult to add a button to start figwheel. Figwheel already broadcasts warnings (and errors?) to the browser window, so I think having this as an option would complement the tool well.

To simplify integration, we could blank out the build statuses in the UI while fighweel is running. Something like "see figwheel window in your running app for build results"

I the app should probably only come with necessary features by default. People probably don't want to download more stuff than they have to (especially since we already require multiple dependencies). Maybe the installer could have an optional checkbox to include this functionality? Or maybe it could be accessible as a "plugin" downloadable from somewhere?

Figwheel is just a lein dependency downloaded automatically for projects that include it in project.clj. So there won't be any extra download incurred if we want to support it. Meaning, I'm only proposing to show a button that will launch lein figwheel command if it is detected in the project.clj. Good points about maintaining a minimal set of features though.

People I talked to at the conj were using it, and I think its workflow is what developers are wanting to move towards. It is the LiveReload of cljs, and is especially useful for Om apps. I think that's worth adding a button.

This is the only thing stopping me from using Cuttle right now =)

I should be able to knock this out.

godspeed!

commented

There are some design decisions to make here. Some ideas:

  • Detect if figwheel is configured in project.clj
  • If it is, add a secondary button by the compile button that either reads "switch to figwheel" or "switch to cljsbuild". This changes the function of the compile/stop button to be more of a launch/stop button, while maintaining the drop-down for selecting a build target.
  • Launch figwheel when clicking "launch" button:
    • Launch a terminal window so we can interact with the REPL
    • Launch default web browser at figwheel endpoint
  • Kill figwheel instance when clicking the "stop" button.

Nice ideas Shaun, though I think it would look and feel better if we could interact with the REPL directly through Cuttle (all cljs-related stuff in one place rather than windows all over the place). I guess it probably wouldn't be worth it if Atom/Node doesn't already have some kind of text interaction pane... there's gotta be one of those, right?

Would be easy if we could find some way to pipe stdin/stdout to the console... as a first step. I'm gonna remove myself from this one until we have some consensus around implementation.

+1 I would love to see these two projects come together.

@shaunlebron Regarding the design decisions above:

  • launching a default web browser on start is what for example create-react-app does (iirc) – personally, I find it to be somewhat annoying most of the time
  • having a REPL in Cuttle would be cool, but as we all spend probably too much time fiddling with our terminals already, I don't really want to have another one to configure/get accustomed to. Maybe an option for external terminal/"inline"?

Just my two cents ✌️

Edit: Just saw that all the comments are from 2015 – if this is not an active project any more, ignore my comment ;)

commented

@madbonkey cljs/tool is my latest attempt at a compiler tool that will be a lot easier to maintain than Cuttle. The cljs figwheel command works well. Still early stuff.