boot-clj / boot-figreload

Boot task providing live-reload using Fighweel client
Eclipse Public License 1.0
49 stars 1 forks source link

Repl? figwheel-repl or boot-cljs-repl ? #6

Open azizzaeny opened 7 years ago

azizzaeny commented 7 years ago

consider using repl from boot cljs repl ? or figwheel repl ?

pros fig side:

pros cljs repl side:

arichiardi commented 7 years ago

At the moment the boot-cljs-repl option is the one I found works ootb, but of course it has no interaction with the reloading of the browser web page. Figwheel has very good repl, which does a lot of things and it is probably the most advanced out there as many folks (Cognitect folks included) use.

I haven't had the time to try the figwheel repl with boot-figreload but I can imagine it might even just work, because it is sending events to its own web socket client /listener.

For sure some preliminary work is necessary what is the best option.

arichiardi commented 7 years ago

Note that figwheel uses piggieback if I remember correctly.

azizzaeny commented 7 years ago

@arichiardi what editor did you use..? ya.. imagine we can display parse error message not just in browser but in node.js

(defmethod repl/process-message :eval-js [message]
  (let
    {:op :result
     :value (try
              {:status :success, :value (str ((fn [src] (.runInThisContext vm src)) code))}
              (catch js/Error e
                {:status :exception
                 :value (pr-str e)
                 :stacktrace (if (.hasOwnProperty e "stack")
                               (.-stack e)
                               "No stacktrace available.")})
              (catch :default e
                {:status :exception
                 :value (pr-str e)
                 :stacktrace "No stacktrace available."}))})) 

quick evaling and catch error display it somewhere..? example in electron or in atom editor proto-repl..? and beutify it like figwheel does...

like the book of shader editor.. https://thebookofshaders.com/edit.php#05/smoothstep.frag (note: trying changing color by draging)

or color picker in atom editor https://atom.io/packages/color-picker

analyzing what code changes... and quick evaling tiny fraction code by calling code function that changes and evaluate on-reload function.. not reconstructing... from scracth the build... and re-render

it will be huge win..

arichiardi commented 7 years ago

I use emacs at the moment. Beautify is a good idea, and I think the goal of having this library now is that we can modify the client part of figwheel and we'll have benefits for us "booters" as well.

Figwheel client should be available for Node (I haven't tried it yet), so the test would be really just to add :target :nodejs in your :client-opts.

azizzaeny commented 7 years ago

sorry i just updated the comment to get better sight...

azizzaeny commented 7 years ago

by the way... i just statisfies by using your work.. :-) and hopes we can improve it bit by bit...

arichiardi commented 7 years ago

I think this might already be what the figwheel repl does, there is a :repl-eval event I am not using at the moment from here, but it is there.

At this point we might as well ask @bhauman directly. My goal was exactly to be able to re-use his great work for improving ours :smile: So big thanks to him in the first place!

kommen commented 7 years ago

We're using boot-cljs-repl right now, and we're running into https://github.com/adzerk-oss/boot-cljs-repl/issues/49, so I'm looking to use the figwheel repl now.

arichiardi commented 7 years ago

@kommen it would be great to use the figwheel repl, I am very keen on having a boot task for that in this project.