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)