Fork me on GitHub
#boot
<
2017-11-23
>
borkdude14:11:34

@yannvahalewyn Are you using figwheel for hot reloading js in the browser?

borkdude14:11:39

or also node

yannvahalewyn14:11:27

I use figwheel-sidecar (as a system)

yannvahalewyn14:11:46

I managed to figure out what was wrong in my case and offered a PR: https://github.com/boot-clj/boot/pull/663

yannvahalewyn14:11:36

tldr: I need figwheel build stuff (lots of files) in a resource dir to be available by my dev server, and boot watches and syncs of all those files to the tempdirs.

borkdude14:11:38

@yannvahalewyn Ah, a fellow Dutchman. Feel welcome to join #clojure-nl as well.

yannvahalewyn14:11:08

Actually Belgian living in NL now 🙂. thanks for the welcome!

borkdude14:11:24

That’s fine too 🙂

borkdude14:11:15

@yannvahalewyn Might be worth sharing your setup, as this seems very similar to the problems that these people had: https://clojureverse.org/t/migrating-from-boot-back-to-leiningen/837

yannvahalewyn14:11:39

I read that during my research 🙂

yannvahalewyn14:11:44

What part of the setup would be interesting?

yannvahalewyn14:11:56

I’m currently migrating from lein to boot, it’s all open here: https://github.com/yannvanhalewyn/sheet-bucket/tree/boot

borkdude14:11:30

I think the part where you sync dirs written by figwheel into boot

yannvahalewyn14:11:01

I don’t do that 🙂

borkdude14:11:29

then I misunderstood

yannvahalewyn14:11:53

But basically I have a dev system https://github.com/stuartsierra/component which has a figwheel component. Flow is like this: - start repl - run a command to build and start the dev system (eg (go)) - The database starts, web server, sockets etc.. and figwheel component starts building the cljs https://github.com/yannvanhalewyn/sheet-bucket/blob/boot/env/dev/clj/dev.clj - cljs files end up in a resource dir because they are served up by the web component - boot’s watchers watch those and syncs them over to tempdirs (which I have no need for)

yannvahalewyn14:11:04

btw: solved for now by using boot --disable-watchers dev repl

borkdude14:11:55

> boot’s watchers watch those and syncs them over to tempdirs (which I have no need for) that’s the part I meant

yannvahalewyn14:11:42

allright 🙂. Well I don’t have any setup for that, it just happens. Hence the bootignore PR

borkdude14:11:20

It happens because you put it in resources, which are picked up automatically?

borkdude14:11:44

Isn’t it more idiomatic to stream it to target btw, instead of resources? I consider resources immutable, but maybe that’s something I imagined on my own

yannvahalewyn14:11:02

I get that indeed, those are not app resources but dev resources

yannvahalewyn14:11:50

the thing is in figwheel world that those need to be served up, so I need them on the resource path for the webserver. Is there another way?

borkdude14:11:07

I think dev resources is reserved for assets you use in tests etc, not something to write into, but again, I might have made this up myself at some point 🙂

borkdude14:11:18

I think target is also on the classpath?

yannvahalewyn14:11:59

hmm, not sure. Pretty new to all this must admit. I’ll try that real quick

borkdude14:11:46

In my view, target is a directory you can always throw away and rebuild, where resources/dev-resources contain html etc.

borkdude14:11:56

Also target is something you gitignore

yannvahalewyn14:11:10

I share that view

yannvahalewyn14:11:12

wow, you might be right that you can access resources from the target path..

borkdude14:11:20

I’m not sure if boot supports writing into target and then picking it up as input, because that’s a two way view of target, I never tested it myself

borkdude14:11:57

but you can use another directory for that of course.

yannvahalewyn14:11:20

oh wait, those where left over resources from my lein build. Trying again 🙂

yannvahalewyn14:11:05

what do you mean by that last part?

yannvahalewyn14:11:20

Turns out you can’t read files from the target path as a resource

borkdude14:11:27

usually you write to target as the last step in a build task in boot

yannvahalewyn14:11:39

So I couldn’t serve build cljs files from there in development

borkdude14:11:43

this flushes the immutable file set into the “real” target directory

borkdude14:11:20

but I guess you can make a directory “fig-target”, write there from figwheel and at this to the resources-path

yannvahalewyn14:11:22

in my case however there is no last step, as in: figwheel builds at runtime after the repl started (end of the line for boot)

yannvahalewyn14:11:39

That would result in the same problem

borkdude14:11:43

so you can always throw that away

yannvahalewyn14:11:46

That’s actually what I do btw

yannvahalewyn14:11:03

I write to target/public/js/compiled/**/*.js

yannvahalewyn14:11:10

And serve that public directory

yannvahalewyn14:11:32

But it’s circular, since boot will watch that resource path I’m back to the FSEvent dropouts halas.

borkdude14:11:35

yeah, this wasn’t a solution to your github issue, just wondering if you wrote to /resources/…, anyway I’m blathering

yannvahalewyn14:11:35

and :resource-paths #{"target" "resources"}

yannvahalewyn14:11:59

that’s the details, but indeed I don’t want to merge my app resources and “target resources” 🙂

yannvahalewyn14:11:10

I completely agree on that part 😉

yannvahalewyn15:11:15

did we meet actually two years ago? On a JS meetup where you did a talk on React ❤️ cljs?

borkdude15:11:16

The other way around, I’m not sure 🙂

yannvahalewyn15:11:24

Makes sense, haha

borkdude15:11:37

Now you’re saying this, I think I do recognize your face now

yannvahalewyn15:11:04

I was the “new guy”, just started learning programming few months earlier. Didn’t know anything about react and clojure, but you got me into it 🙂

borkdude15:11:24

Really? That’s so nice to hear 🙂

yannvahalewyn15:11:45

yeah, so thanks for that!

borkdude15:11:27

(sorry for polluting this channel with off topic remarks, next time we should use a thread)