Fork me on GitHub
#vim
<
2017-08-15
>
dominicm07:08:53

It works reliably for me :) maybe I should do a screencast or something

dominicm07:08:22

Vim-figwheel helps

tungsten15:08:12

The frustrating thing is that it only works with the figwheel template... any other template/project and things seem to go south

tungsten15:08:03

vim-figwheel also seems to require that it is loaded after vim-fireplace... which pathogen does not accomplish:disappointed:

dominicm15:08:48

into autoload or something.

tungsten15:08:38

I appreciate your help here... I am trying to track down the root cause here so I can submit PRs to other templates like chestnut and luminus so I don't have to deal with this as much anymore

dominicm15:08:41

I've used it with chestnut. Let me grab chestnut and give it a spin 🙂

dominicm15:08:46

will log everything down

dominicm15:08:30

actually, good excuse to play with asciinema

tungsten15:08:12

Thanks @dominicm ... the JS-Workshop project I linked too is another puzzler -- especially since it is buy yogthos who is normally great at making stuff just work

dominicm15:08:50

oh jesus, when did chestnut change this 😧

dominicm15:08:57

@bfast Piggieback (figwheel-sidecar.system/repl-env (:figwheel-system reloaded.repl/system) nil)

dominicm15:08:40

Explanation: chestnut reached into the (internal?) api of figwheel, and moved the system. So the repl-env function no longer works. So this pulls it out of where they moved the figwheel system.

dominicm15:08:51

Lemme know if that fixes things for you

dominicm15:08:04

Gonna try load up the JS Workshop now

dominicm15:08:33

@bfast > lein new reagent-frontend reddit-viewer > cd reddit-viewer > lein figwheel This how I do the js workshop?

tungsten15:08:43

@dominicm I think you need to clone the whole project

tungsten15:08:12

then just attempt to run it in the cloned directory

tungsten15:08:29

I tried your piggieback command with chestnut... I got a NPE... When you launch "lein repl" in a chestnut project figwheel auto starts... so the timing may be off

tungsten15:08:37

I'll look into this later... have to go to work now 😞

dominicm15:08:15

@bfast Sorry, I should have been more precise.

lein repl

user=> (go)
user=> (cljs-repl) ; this may be optional
~> Then do the :Piggieback

dominicm15:08:36

@bfast Regarding JS-Workshop: For whatever reason, figwheel doesn't write the .nrepl-port file, so fireplace can't auto-connect. So you have to do: :Connect manually, then scope the connection. From there, the normal figwheel piggieback works: :Piggieback (figwheel-sidecar.repl-api/repl-env)

tungsten16:08:05

Thanks dominicm- much appreciated , I will give this a shot

dominicm16:08:48

No problem. I've been through the pain of understanding all this crap 🙂. So I don't mind sharing

tungsten16:08:58

@dominicm what did you scope the connection to?

dominicm16:08:27

@bfast directory I had cloned project into

dominicm16:08:44

not sure what the scoping is for tbh, makes gf work maybe?

tungsten16:08:25

Ok -- I guess I am having problems once I connect to the figwheel repl... when I try cpp on an expression I get E605: Exception not caught: Fireplace: class java.lang.IllegalStateException... so I will keep investigating

dominicm17:08:51

@bfast On the JS workshop? In a .clj or .cljs file?

tungsten18:08:33

@dominicm yes JS workshop on core.cljs

dominicm18:08:31

Hmm, definitely working for me.

dominicm18:08:47

My lightweight test is :Eval (js/alert "hi") can you do that from core.cljs?

tungsten18:08:26

No I get java.lang.IllegalStateException

tungsten18:08:41

I am also not connected with Piggieback at this point

dominicm18:08:13

Piggieback from a .clj file before doing the :Eval

dominicm18:08:01

Recording my process now 🙂

tungsten18:08:25

I think the problem is something with my environment... I don't need to do the .clj piggieback with the figwheel-template

dominicm18:08:59

That might just be because vim-fireplace is doing something with rhino on your behalf, but I'm not certain. You should always need to do the Piggieback

tungsten18:08:32

I need to do piggieback, but I can successfully do it in a cljs file in figwheel-template

dominicm18:08:04

oh interesting. Maybe Piggieback does work in a .cljs file, maybe it's something else... so now I am over-cautious and always do it in the .clj file 😛

dominicm18:08:39

Does my asciinema help at all?

tungsten18:08:45

I greatly appreciate your help... but i need to get back to work... I'll be online trying to debug this after work this week... this is driving me bonkers

tungsten18:08:55

I will check it out after work 😕

tungsten18:08:19

oh its not that long... ill take a look

dominicm18:08:22

nope, just trying to show order & stuff

tungsten18:08:29

Ok -- I don't have the ":Lein" command ... but I tried just running lein figwheel like you did and I was able to piggieback in and send an alert

tungsten18:08:41

my previous approach was to do "lein repl" and then start figwheel from the repl

tungsten18:08:48

for some reason that did not work...

dominicm18:08:20

sorry, my :Lein command just does lein figwheel in the background.

tungsten18:08:31

@dominicm Ok I think the root cause of this issue is that when invoking (start-figwheel!) from the repl you need to have ":repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}" set in your dev profile

tungsten18:08:50

Adding that fixed this issue with my startup method

dominicm18:08:04

perhaps, yes. Makes sense. I suppose 🙂

dominicm18:08:12

I've found the boot method is far more sane, fwiw

tungsten18:08:22

boot instead of leiningen?

dominicm18:08:40

yeah. I know you're using pre-existing tooling.