Fork me on GitHub
#figwheel-main
<
2018-10-15
>
bhauman12:10:24

@neupsh no figwheel.main it doesn’t have this

bhauman12:10:51

@kwladyka I have verified that figwheel does indeed watch directories outside of the local project directory. This is on OSX, and all I’m doing is adding directories to watch-dirs:

bhauman12:10:45

@kwladyka if this isn’t happening for you please file a detailed issue, because I do want to support this

kwladyka12:10:05

I remember I had an error path can’t be outside project directory about 2 months ago

kwladyka12:10:17

I will check it soon again, thx

bhauman12:10:28

@dimovich I have not been able to reproduce this behavior, I am able to have multiple clients locally and non locally all receive reload broadcasts at the same time

dimovich12:10:14

@bhauman, thanks for trying it out again! I guess we have some magical combination of libraries or sth 🙂. Btw, where is located the code that broadcasts these messages?

bhauman12:10:22

@richiardiandrea you can have command line testing if you run run tests from the command line see “Custom testing with :extra-main-files”

bhauman12:10:31

on that testing docs page

bhauman12:10:58

if you run that from the command line you will see the test output on the command line whenever the code reloads

👍 4
orestis12:10:50

Is there a way to add my own CSS pre-processor but still tie in to Figwheel path watching?

orestis12:10:31

That is, telling Figwheel to watch my SCSS files and when they change run my custom function, then push the new generated CSS files to the browser

pesterhazy14:10:50

You could have a separate process process watching scss files and writing to resources/public/css/style.css. When the scss files, the style compiler creates a new output css, which figwheel sees @orestis

orestis14:10:39

Yeah, it’s just too .. many … watchers 🙂

dominicm19:10:00

@bhauman I was just adding support for figwheel main to JUXT's build tool (meaning edge will soon be upgrading too). I notice that cljsjs support was added ❤️.

dominicm20:10:42

@orestis with sidecar, I sovled this by using my own filewatcher. I think a potential solution here is a more "a la carte" figwheel, where there's a notify callback you can call on a whim, this should make it easier to integrate figwheel into other build tools.

orestis20:10:56

How do you mean? The scripting API is not quite as full featured yet as the “main” command line functionality, if I understand correctly.

orestis20:10:11

Perhaps I’m missing something :)

dominicm20:10:48

I mean, one option is to have a figwheel without the filewatcher, where you call a function to notify the browser.

dominicm20:10:03

then you use your own file watcher for everything.

dominicm20:10:45

fwiw, within 15m I expect kick will support doing this for you, at least partially. (Both file watchers will be on).

dominicm20:10:05

@bhauman Am I setting myself up for bad things™ by having :watch-dirs point at directories which don't contain cljs? Or is that more of a "warning" than an "error"? Things seem to work okay.

dominicm20:10:37

They're all on the classpath (in fact, it's a list of directories on the classpath)

bhauman20:10:02

that is more of a warning

bhauman20:10:23

cljs will completely fail when you give it an empty src directory

bhauman21:10:19

to compile

bhauman21:10:30

unless that’s changed

dominicm21:10:09

@bhauman You mean in cljs.main, or cljs.build?

bhauman21:10:28

cljs.build.api/build

dominicm21:10:49

We've been passing that (mapv str classpath-dirs) up until now also, so I guess it's the same failure cases (that we haven't seen).

bhauman21:10:11

i’d have to look at the specific case again to get a handle on it

bhauman21:10:40

I just remember it was super ugly and there was no indication of what was wrong

dominicm21:10:56

🙈 I'm filling in defaults for people. It's probably okay, I always put stuff in "src".

dominicm21:10:36

Although, I have just noticed that this now causes figwheel to try and build all cljs on the classpath, which means that the injector I wrote which only works with sidecar is being compiled, which is failing the compile…

bhauman21:10:24

(mapv str classpath-dirs) is pretty intense

dominicm21:10:48

@bhauman it's pretty much my way of stopping a user from having to do anything.

Toby21:10:22

I’m having an issue where, nearly as soon as it connects, the repl host page throws [goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined. The command-line repl then exits without error. Can anybody give me a hint on how to start troubleshooting this?

bhauman21:10:34

@toby962 do you have an alert blocking the page load?

dominicm21:10:06

@bhauman for deps.edn I can probably filter out a lot of things by parsing the clojure.libfile system property...

dominicm21:10:55

Of course, this then makes it harder to have a mono-repo, where cljs lives in adjacent :local/repo, as those directories won't get watched for cljs changes. Bah.

bhauman21:10:41

yeah folks have to say what they want to compile

dominicm21:10:44

Ah, build-inputs allows me to separate them!

dominicm21:10:40

[:main] seems like it would solve my immediate problem :thinking_face: but would then force users to provide extra inputs for their test namespaces...

dominicm21:10:46

Needs some thinking. Best solution is probably to just have kick split into multiple projects, each with their own deps. Then all cljs on the classpath always compiles, presumably that's true for most clojurescript. Maybe not.

dominicm06:10:51

I have "solved" the problem by doing: [:main] + looking at a system property that clojure sets called "libfile" which allows me to find all the libraries used to start the classpath. Using that, I filter those directories out of the classpath, so you end up with src/test/blah. You're out of luck if you use kick with boot/lein, but I doubt anyone does. I also don't think they'll run into any issues as they probably aren't using gitlibs/local deps anyway, and if they are, I expect libfile to be set.

Toby21:10:19

I started an empty project. Contains only the code from the tutorial and it still occurs.

bhauman21:10:17

are you using chrome, firefox?

Toby21:10:26

I’ve tried both

bhauman21:10:44

are you on OSX?

Toby21:10:55

I once saw Exception in thread "main" clojure.lang.ExceptionInfo: Eval timed out! fly by but just once.

Toby21:10:06

OSX host, clojure docker container

bhauman21:10:29

its probably just not connecting in the first place

Toby21:10:47

I see the green banner for several seconds, if that counts.

dominicm21:10:55

Of course, this then makes it harder to have a mono-repo, where cljs lives in adjacent :local/repo, as those directories won't get watched for cljs changes. Bah.

Toby21:10:00

…and a registered Figwheel session id

bhauman21:10:35

@toby962 it sounds like connectivity to the docker container

bhauman21:10:56

I’m assuming you are using a browser and that is connecting to the docker container

Toby21:10:02

Possible. How do I prove it?

Toby21:10:11

Correct assumption.

bhauman21:10:50

I’m not able to help you with that right now, unfortunately

Toby21:10:08

fair enough

Toby21:10:35

I take it a Figwheel session ID is given to the client before the websocket has finished connecting, then?

bhauman21:10:49

the client generates the session id

Toby21:10:00

So, I’m correct that those messages are independent from the websocket negotiation going on?

Toby21:10:43

…one thing that confuses me: why would the repl exit if the connection fails? shouldn’t it wait for another browser?