cuttle icon indicating copy to clipboard operation
cuttle copied to clipboard

Figwheel integration

Open shaunlebron opened this issue 10 years ago • 11 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"

shaunlebron avatar Jan 15 '15 22:01 shaunlebron

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?

CASandmann avatar Jan 17 '15 05:01 CASandmann

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.

shaunlebron avatar Jan 17 '15 06:01 shaunlebron

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

atroche avatar Feb 24 '15 06:02 atroche

I should be able to knock this out.

comamitc avatar Feb 25 '15 21:02 comamitc

godspeed!

atroche avatar Feb 26 '15 00:02 atroche

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.

shaunlebron avatar Feb 26 '15 04:02 shaunlebron

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?

CASandmann avatar Feb 26 '15 07:02 CASandmann

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.

comamitc avatar Mar 04 '15 04:03 comamitc

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

ivanreese avatar May 03 '15 20:05 ivanreese

@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 ;)

madbonkey avatar Feb 26 '17 11:02 madbonkey

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

shaunlebron avatar Feb 27 '17 00:02 shaunlebron