Fork me on GitHub
#boot
<
2016-05-03
>
domkm00:05:34

I'm having an issue with boot-reload where it says it reloaded the CSS file but the loaded styles don't change and the network tab doesn't show any requests. Has anyone else experienced this?

seancorfield00:05:14

@therabidbanana: I blogged about how to add @Trace metadata in Clojure — and we also have pure Clojure projects running with New Relic’s javaagent...

seancorfield00:05:34

As for adding the javaagent stuff in Leiningen, it’ll just go in your :jvm-opts entry. We use Boot, so we use environment variables instead but it’s the same principle.

seancorfield00:05:38

You’ll have something like :jvm-opts ["-javaagent:/path/to/newrelic-agent.jar -Dnewrelic.config.file=/path/to/newrelic.yml -Dnewrelic.environment=whatever"] (assuming you’re using a single config file with all your environments in)

seancorfield00:05:37

You can have Leiningen compute :jvm-opts dynamically if you need to, and include environment variables (for the newrelic.environment value).

seancorfield00:05:55

Frankly, this is just easier with Boot, using environment variables tho’...

therabidbanana00:05:07

@seancorfield: Was hoping for the boot equivalent of leiningen's :java-agents config option. Not seeing one here in boot

seancorfield00:05:56

Oh, I misunderstood your question then...

seancorfield00:05:08

Just use the BOOT_JVM_OPTIONS environment variable. Far simpler.

seancorfield00:05:19

And it can be dynamically controlled by your environment.

seancorfield00:05:04

But, yeah, we start Boot processes with New Relic agents defined...

seancorfield00:05:19

If you’re building an app to run with New Relic, I’d recommend creating an uberjar anyway and running it from the command line as a regular Java program: java -jar app.jar -javaagent:/path/to/newrelic-agent.jar …etc…

therabidbanana00:05:28

Is it possible to pull it down and make it show up on the classpath easily, or do you just have that agent sitting there in the directory?

therabidbanana00:05:38

We do plan on building an uberjar for everything

seancorfield00:05:27

Well, we have it as a project dependency and have a task to "install" it somewhere specific since we use the agent with other apps as well.

seancorfield00:05:08

Here’s the task we use for dealing with high-level dependencies https://www.refheap.com/118571

seancorfield00:05:14

(tomcat-deps) produces a list of dependencies that we need to manage across our Tomcat apps and our Clojure apps

seancorfield00:05:34

(ws-root) is just our World Singles project root (computed from an environment variable).

seancorfield00:05:15

those managed dependencies include both New Relic libs

[com.newrelic.agent.java/newrelic-api "x.y.z"]
 [com.newrelic.agent.java/newrelic-agent "x.y.z"]

seancorfield00:05:50

with the appropriate x.y.z values coming from a configuration file (we have everything controlled outside the build.boot file).

therabidbanana00:05:11

Hmm... I think this is enough to get me started - I'll see if I can work out how to build the project uberjar with the agent jar on the side.

danielsz14:05:40

system is redesigning one of its core features, code reloading. This is a very exciting time to contribute. We currently have a challenging issue open on github. Everybody is welcome, although I have to admit that this is probably most suited for experienced Clojure developers with a firm grasp of the runtime internals. https://github.com/danielsz/system/issues/79

gamecubate14:05:11

Having a frustrating problem with boot. Here's my boot.build file:

gamecubate14:05:49

Woops. How does one create multi-line posts in (OSX) Slack.app? BRB

micha14:05:04

you can also just upload a text file as a "snippet" with the plus sign on the left of the input box

micha14:05:25

💥 like that simple_smile

gamecubate14:05:31

Thanks I just saw. simple_smile

gamecubate14:05:42

So, snippet seems simple (even to me... noob)

gamecubate14:05:01

Calling boot rerelease works wonkedly.

gamecubate14:05:03

By that I mean:

gamecubate14:05:39

1. it creates a directory named "target/js" and saves compiled js output to it. Great. Except I had specified "release/" for my target task.

gamecubate14:05:17

Oh boy. I think I just got it.

micha14:05:43

you want to set BOOT_EMIT_TARGET=no in the boot.properties file or in your shell environment

micha14:05:56

to disable that deprecated behavior

gamecubate14:05:57

If a directory does not exist, boot complains thus:

Implicit target dir is deprecated, please use the target task instead.
Set BOOT_EMIT_TARGET=no to disable implicit target dir.
which had thrown me on a wild goose chase. Would have better to say "release/" not found.

micha14:05:10

it should create the target directory for you

gamecubate14:05:10

OK will try.

micha14:05:18

so you don't need to create the release dir

gamecubate14:05:21

It did but sent nothing to it.

micha14:05:26

but maybe the trailling slash is messing it up?

micha14:05:38

try without the trailing slash perhaps?

gamecubate14:05:38

Let me run more tests, with boot.properties BOOT_EMIT_TARGET=no.

micha14:05:46

the two are separate

micha14:05:05

the BOOT_EMIT_TARGET thing just disables the automatic dumping to target/ dir

micha14:05:14

but doesn't affect the target task in any way

micha14:05:30

confusing, i know simple_smile

micha14:05:55

but we wanted to avoid a breaking change there in case people were depending on that

micha14:05:09

so you need to opt out of the automatic target thing

gamecubate15:05:16

Okay. Will run more tests. Thanks again.

seancorfield19:05:01

[:ann] boot-new 0.4.3 available — supports leiningen.core.main/leiningen-version via a hack which means you can use boot-new to generate Luminus projects now!

seancorfield19:05:35

(! 593)-> boot -d seancorfield/boot-new new -t luminus -n lum2
Retrieving boot-new-0.4.3.jar from 
Generating a Luminus project.

gamecubate20:05:45

@micha thanks. It worked beautifully.

micha20:05:27

weird that the slash should make a difference

gamecubate20:05:36

2 things changed between then and now (although you do say that one of them is unrelated): "release"+"/", and my boot.properties:BOOT_EMIT_TARGET=no

gamecubate20:05:03

Will try right away with a slash. Result is...

gamecubate20:05:58

Works as well.

gamecubate20:05:07

<fingers drumming>

gamecubate20:05:14

Will try another thing...

micha20:05:53

oh cool, i thought the slash might be a bug to fix

gamecubate20:05:43

Indeed boot.properties:BOOT_EMIT_TARGET=no has nothing to do with what I saw.

gamecubate20:05:53

One more test before I throw in the towel...

micha20:05:49

your build is currently working correctly, right?

gamecubate20:05:10

Unable to reproduce this morning's problem.

gamecubate20:05:19

So, ahem, phew. And thanks again.

gamecubate20:05:40

Can now proceed with d3 + reagent + boot test.

micha20:05:47

haha excellent

micha20:05:00

if you run into the issue later we can debug

gamecubate20:05:31

Will do, and will try and be more thorough in documenting the problem.

gamecubate20:05:42

(if and when)

gamecubate20:05:59

Oh. One last question: I see that cljs generates a release/js/app.out/ directory containing lots of (am assuming unneeded) files. I assume that's pure cljs side effect and nothing to do with boot, correct?

gamecubate20:05:27

When I say

cljs generates
I mean,
in addition to release/js/app.js, cljs _also_ generates...

micha20:05:52

right, those are files you'll need if you want source maps, or if you're compiling with optimizations :none

micha20:05:15

if you're compiling for production and you don't care about source maps you can use the sift task to get rid of them

micha20:05:53

but you'll definitely need those files if you're compiling cljs without optimizations

micha20:05:51

nothing to do with boot per se, but the boot cljs task does manage that for you, it figures out how to configure that in the cljs compiler so your app will work

gamecubate20:05:01

understood. Is sift run downstream of cljs and upstream of target? As in `(comp (cljs) (sift <some pattern>) (target :dir #{"release"})) ?

gamecubate20:05:19

Woops.

(comp (cljs) (sift <some pattern>) (target :dir #{"release"}))

gamecubate20:05:57

Excellent. Thanks again.