Fork me on GitHub
#boot
<
2016-02-18
>
laforge4900:02:31

This looks much better now. Thanks micha! C:\Users\Bill\Documents\aatree\durable-cells>boot dev Compiling ClojureScript... ò dcells.js Sifting output files... ??? dcells.cljs.edn ??? durable_cells ? ??? core.cljs ? ??? dc_api.cljs ??? resources ? ??? dcells.js ??? dcells.out ??? aaworker ? ??? api.cljs ? ??? api.js ??? boot ? ??? cljs ? ??? main682.js ??? cljs ? ??? core.cljs ? ??? core.js ? ??? reader.cljs ? ??? reader.js ??? durable_cells ??? dc_api.js Writing pom.xml and pom.properties... Writing durable-cells-0.1.0.jar... Installing durable-cells-0.1.0.jar... Writing target dir(s)... C:\Users\Bill\Documents\aatree\durable-cells>

flyboarder00:02:40

@laforge49: ah sorry, missed the notification 😜 glad it’s sorted

laforge4900:02:30

Well, the jar file is looking like I want it. Progress at least, but isn't that all we can ask for? simple_smile

laforge4900:02:31

This is known to fail silently: (js/Worker. file-name)

laforge4900:02:56

Next step I figure is to show -f in the application

laforge4900:02:29

OK, so dcells.js is NOT listed by show -f in the application.

laforge4900:02:22

I thought the resources directory of a library jar would be on the classpath of the application. Obviously wrong.

laforge4900:02:35

Any idea how to fix this?

flyboarder00:02:17

you probably only have :move

micha00:02:19

the contents of the jar will be on the classpath of any clasloader that jar is added to

micha00:02:04

there are no special directory names or anything

micha00:02:13

jar files don't even raelly have directories

laforge4900:02:24

Oh. Then I did not need to move dcells.js into resources.

flyboarder00:02:09

@laforge49: are you trying to serve the js file?

laforge4900:02:15

In both cases it does not work.

laforge4900:02:53

when I had a dcells.cljs.edn in the application, the Worker constructor could find it, no problemo.

flyboarder00:02:14

I would make sure your app can serve the static files as well as resources

flyboarder00:02:30

this might avoid the issue

laforge4900:02:22

I'm using (serve :port 8000 :init-params {"org.eclipse.jetty.servlet.Default.useFileMappedBuffer" "false"}))

laforge4900:02:41

So do I put compojure in the options?

flyboarder00:02:05

should be part of your handler def

laforge4900:02:43

got me no handler. Not using castra

laforge4900:02:28

and serve task

laforge4900:02:42

(deftask dev "Build for local development." [] (comp (watch) (speak) (hoplon) (cljs :optimizations :simple) (target) (show :fileset true) (serve :port 8000 :init-params {"org.eclipse.jetty.servlet.Default.useFileMappedBuffer" "false"})))

flyboarder00:02:05

@laforge49: i believe the serve task creates a default handler when you do not pass one in

laforge4900:02:28

when I put the dcells.cljs.edn file back in the application, the dcells.js shows like this: ??? dcells.cljs.edn ??? index.html.js ??? dcells.js

laforge4900:02:30

OK, so the problem with getting a defauld is that you need an example for how to override it, y?

flyboarder00:02:48

so you should be able to add resource-root

laforge4900:02:14

set it to ""?

flyboarder00:02:20

i believe so, micha’s suggestion should work if you used the actual compiled jar

laforge4900:02:03

Oh! :resource-root true!

laforge4900:02:41

er, not. Likely then just resource

laforge4900:02:12

Anyway, I can experiment. simple_smile So thanks @flyboarder

flyboarder00:02:03

@laforge49: I would suggest moving to an actual ring handler, you dont need to use castra, compojure will return a handler for routes, which you pass though your middleware setting resource and file defaults

laforge4900:02:06

I'll try the simpler for now. no idea how to employ your snippets.

laforge4900:02:35

I did enjoy reading about boot today. Obviously I need to do more of that.

laforge4901:02:56

Specifically, r resource-root ROOT str "The root prefix when serving resources from classpath"

laforge4901:02:03

but boot does not like it.

laforge4901:02:35

>boot dev serve: unknown option(s): :resource-root

laforge4901:02:11

Here's my dev tase: (deftask dev "Build for local development." [] (comp (watch) (speak) (hoplon) (cljs :optimizations :simple) (show :fileset true) (serve :port 8000 :init-params {"org.eclipse.jetty.servlet.Default.useFileMappedBuffer" "false"} :resource-root "/resource")))

laforge4901:02:58

I'll note that I am using init-params, not init as specified for the serve task of boot-http.

laforge4901:02:10

So it must be a different serve task.

laforge4901:02:38

So perhaps what you were saying @flyboarder is that I should be using boot-http in place of boot-jetty?

laforge4901:02:52

I'm again in way over my head.

flyboarder01:02:17

@laforge49: yes sorry, I thought you were using a different task, not sure how micha has his serve task working

laforge4901:02:29

(require '[adzerk.boot-cljs :refer [cljs]] '[hoplon.boot-hoplon :refer [hoplon prerender]] '[tailrecursion.boot-jetty :refer [serve]])

laforge4901:02:06

Guess I should look at boot-jetty first.

laforge4901:02:13

Yeah, boot-jetty only has limited options. My next step will be to work on getting boot-http to work in place of boot-jetty. And I see now how I can add a handler.

laforge4901:02:48

OTOH I am thinking this project is dead. The whole point was to ask less of app devs, not more.

laforge4901:02:51

So if there is no easy way to get boot-jetty to serve files from a library jar, then I might as well ask the app dev to include a .cljs.end file in their build task.

laforge4901:02:01

Not a biggie really.

flyboarder02:02:51

@laforge49: you can easily serve files from jar, remember boot serve tasks are for dev mostly, is your project an app or lib?

laforge4902:02:38

I am writing a lib. Trying to make the existence of the worker .js file transparent to the app.

laforge4902:02:20

Right now, they just need to add a .cljs.edn file to their app.

laforge4902:02:57

--that compiles the worker .js file and serves it when needed.

flyboarder02:02:59

That seems simple enough for devs

laforge4902:02:51

true. but as the worker is not shared, the .js file could be compiled ahead of time. But it looks like it is not worth it, as it creates more work for the app dev.

flyboarder02:02:23

If the file is in an uberjar then the app dev just needs to serve files from class path

flyboarder02:02:40

And the app server should be able to handle it

laforge4902:02:03

The other advantage of separate compile is that you can use separate compiler options. Turns out worker .js files will not run when optimization is none. simple_smile

laforge4902:02:29

Which means, if you compile it all together, the app dev can not specify none.

laforge4902:02:54

Appreciate the advice. 👍

laforge4902:02:16

So perhaps that is reason enough to look into this.

laforge4902:02:47

When optimization is none, there is a reference in the .js file to Window, which does not exist in a web worker.

laforge4902:02:07

js/window I should say.

flyboarder02:02:00

Could you write a shim?

flyboarder02:02:12

Like fake it

laforge4902:02:35

fake optimization none? Oh, fake a web worker.

flyboarder02:02:46

Fake the reference

laforge4902:02:53

The faking would need to be done in a js file. If I could get that file to load in the worker, then why not load the file I actually want? One that is compiled independently like the shim would need to be.

micha02:02:45

so you're going to put the js file in a jar, right?

micha02:02:22

if it's just javascript you should use cljsjs to package it

laforge4902:02:27

I'm close to giving up, though the advantage of allowing an app to be compiled with optimization none gives me a renewed sense of purpose. 😄

micha02:02:17

cljsjs is how you can package 3rd party javascript

micha02:02:32

such that it can participate in the cljs dependency mechanims

laforge4902:02:42

I don't need any packaging as the worker runs in separate memory space.

laforge4902:02:45

Just need to be able to load it. Perhaps by using an uberjar or perhaps by switching the app to http-boot.

laforge4902:02:23

boot-jetty lacks the configuration options I need to be able to load a file from a lib jar.

laforge4902:02:37

--like setting the resource route.

micha02:02:46

what is the purpose of the resource route

laforge4902:02:05

to be able to load the .js file needed to construct the worker.

micha02:02:23

why do you need the resource route business though

micha02:02:34

why not just serve the js file like any other js file

laforge4902:02:41

--the constructor is notorious for failing silently.

laforge4902:02:56

Sure! How do I do that?

laforge4902:02:26

I pass the name of the js file to the worker constructor.

micha02:02:30

you need to serve resources from the classpath

laforge4902:02:40

and how do Ido that?

micha02:02:45

ring middleware

micha02:02:05

there is a wrap-resource thing

laforge4902:02:44

I was originally thinking that I would not require the app dev to change their ways. Indeed, there is no point if I am just trying to hide the .cljs.edn file.

laforge4902:02:08

But if I am trying to give the app dev the option of compiling with optimization none, it becomes worth it.

micha02:02:10

you want a task that generates the cljs.edn file i think

micha02:02:17

and not put it in the jar

laforge4902:02:17

Then I can as the app dev to use something like boot-http perhaps.

laforge4902:02:44

The cljs.edn file is no longer the issue.

laforge4902:02:04

The advantage being sought now is compiling with different optimizations.

richiardiandrea02:02:33

Has anyone ever had the following exception with boot cider dev ?

ERROR: Unhandled REPL handler exception processing message {:op init-debugger, :print-level 10, :print-length 10, :session d878999b-80cb-4b9c-9ca8-df58d53de495, :id 7}
java.lang.IllegalStateException: Can't set!: *data-readers* from non-binding thread
	at clojure.lang.Var.set(Var.java:218)
	at boot.core$load_data_readers_BANG_.invoke(core.clj:185)
	at cider.nrepl.middleware.debug$initialize.invoke(debug.clj:432)
	at cider.nrepl.middleware.debug$wrap_debug$fn__24143.invoke(debug.clj:462)
	at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__3093.invoke(middleware.clj:22)

laforge4902:02:37

--I suspect being able to compile with optimizations none might be a biggy.

micha02:02:31

the cide nrepl middleware looks like it's calling the function that sets data readers

micha02:02:39

from a thread in which that var isn't bound

richiardiandrea02:02:10

yeah...but can this be possible? I have the classic:

let [options (options :dev)]
    (apply set-env! (reduce #(into %2 %1) [] (:env options)))
    (comp (serve)
          (watch)
          (cljs-repl)
          (version-file)
          (apply cljs (reduce #(into %2 %1) [] (:cljs :dev)))
          (reload :on-jsload 'cljs-repl-web.core/main))

richiardiandrea02:02:29

apart from the reduces everything is standard no?

richiardiandrea02:02:49

actually maybe reload should go before

richiardiandrea03:02:37

very weird in another project of mine, same version of boot related stuff, everything works

richiardiandrea03:02:01

without cider does not work as well, start-repl hangs

mobileink12:02:48

What are the rules for task definition? I'm seeing strange behavior when I write one like I write a function. For example, (if something (core/with-pre-wrap ...) (core/with-pre-wrap ...)). Of course the obvious thing to do is move the if-then inside of the pre-wrap, but then other problems arise. Sometimes println statements stop printing for no apparent reason. I'm looking for general rules, like "with-pre-wrap may only occur once in a task" or whaterer.

mobileink12:02:25

should i ask such questions here or on the Discourse site?

jethroksy12:02:30

tasks are middleware factories

jethroksy12:02:35

they return functions

micha13:02:37

@mobileink: if the jvm exits before the thread your println is in flushes its buffers, you won't see output

micha13:02:17

that can cause the situation where printing mysteriously stops working

micha13:02:39

putting a wait at the end of the pipeline will fix that for debugging

mobileink13:02:18

@jethroksy: right, I understand the pattern, but there be macros involved - deftask does not behave exactly like defn, there are evidently some things you should not do in deftask

micha13:02:22

(if something (with-pre-wrap ...) (with-pre-wrap ...)) should work

mobileink13:02:06

@micha: hmm, so if there's a pod involved maybe something like that is happening.

micha13:02:10

(deftask foo
  []
  (let [...]
    (if something
      (with-pre-wrap ...)
      (with-pre-wrap ...))))

micha13:02:04

deftask is like defn, but with macrologies to parse the command line args

mobileink13:02:08

yep, wouldn't work for me - I had to move the if-then stuff inside the wrapper. also had to have only one "pod/with-eval-in". I'll see if I can recreate what didn't work

micha13:02:40

that if expression will only be evaluated once

micha13:02:51

when you construct the pipeline

micha13:02:18

the middleware factory returns the middleware that will be composed to form the pipeline

micha13:02:26

so that could be the issue

mobileink13:02:28

here's some sample wierdness:

mobileink13:02:33

(core/deftask bar [c component VAR str "component to extract. Must be namespace qualified." n ns-str NS str "namespace from which to extract commponents"] (let [pod (-> (core/get-env) pod/make-pod future)] (if ns-str (let [ns-sym (symbol ns-str)] (core/with-pre-wrap [fileset] (pod/with-eval-in @pod (println "FOO")) fileset))) (if component (core/with-pre-wrap [fileset] (pod/with-eval-in @pod (println "BAR")) fileset))))

mobileink13:02:54

then: boot mrj/bar -c foo.bar/baz => BAR

mobileink13:02:10

but: boot mrj/bar -n foo.bar => no output

mobileink13:02:20

let bindings seem to interact in some strange way with some of the boot stuff

micha13:02:49

there is nothing magical there

micha13:02:01

it's just a function

micha13:02:16

lexical bindings work the same in there as anywhere elese

micha13:02:39

i don't see anything that waits for the pod to flush output buffers before exiting

micha13:02:55

boot mrj/bar -n foo.bar  wait -t 1000

micha13:02:04

that will show "BAR" i expect

micha13:02:46

or adding a (flush) in there might work too

micha13:02:46

but anyway deftask is just defining a normal function. the only thing it does is set up the command line arguments and add some metadata to the var so that boot can know about which functions are tasks

micha13:02:14

that way boot can do things like give you a list of available tasks

micha13:02:16

things like that

micha13:02:12

@mobileink: i have a recommendatation for the boot-gae task

micha13:02:29

you should use a file in tehe fileset with a distinct extension as the place to hold the configuration, like myproject.gae.edn for example

micha13:02:36

instead of defining a var

micha13:02:59

this will provide an extension point for other tasks to generate the config

micha13:02:07

and modify it

alandipert13:02:15

or put it in a library

micha13:02:38

if you use a var then you are making it basically unmanaged shared mutable state

micha13:02:44

the fileset is managed, in that when the pipeline restarts, like if the watch task is used, for example, any changes to files in the fileset by subsequent tasks in the pipeline are not visible to tasks that come before them in the pipeline

micha13:02:04

which is not so for a var, because vars don't "rewind" their state each time the pipeline runs

micha13:02:10

also did you see the web task that creates the web.xml?

mobileink14:02:47

@micha: boot mrj/bar -n foo.bar wait -t 2000 - still no output. Adding (flush) didn't work either. But I think the problem is I need to study pods a bit more.

mobileink14:02:38

@micha: @alandipert re: boot-gae config file, thanks, I will do that.

mobileink14:02:00

I did look at web. it's a good candidate for extending boot-gae. when i get the time i'll figure out how to integrate it - maybe it works is, just haven't tested it yet.

mobileink14:02:21

correction: maybe it works as-is

micha14:02:24

i would like to extend the web task to accomodate filters etc

micha14:02:52

but also perhaps gae could operate on an existing web.xml created by the web task if one exists

mobileink14:02:55

I'd be glad to share whatever I've learned working on boot-gae and migae

micha14:02:14

that way the user could compose gae with other tasks that manipulate the web.xml

micha14:02:02

the general pattern with boot tasks is to factor into separate tasks

micha14:02:18

that's why none of the tasks you see have big configuration maps

mobileink14:02:30

excellent idea. I'd better add a "roadmap" section to the readme with planned enhancements. Or if you feel like it feel free to create an issue. maybe that's what I'll do instead of a roadmap.

micha14:02:36

instead, configuration is done in multiple separate tasks

micha14:02:40

each doing only one thing

micha14:02:54

so you can swap out any part of it with a different thing

micha14:02:22

when you have a big config map you need to add more keys to the map with branching logic in the one monolothic task

micha14:02:35

if you want to have different things

micha14:02:48

that's like how lein tasks end up being

micha14:02:58

with keys for every permutation of thing you could want

mobileink14:02:58

actually i have given some thought to breaking up the config map. most of it is only needed for the config task, but some of it must be shared with the servlets task as well

micha14:02:20

i think there are different orthogonal concerns in there

micha14:02:25

that can be factored out

micha14:02:31

into separate tasks

micha14:02:45

you would need to have a sort of model for what a gae application is

micha14:02:49

at the highest level

micha14:02:57

sort of like the .cljs.edn thing for cljs apps

micha14:02:09

like compare the boot cljs stuff to figwheel

micha14:02:35

in boot there are separate, orthogonal tasks for compilation, live reload, repl, and incremental compilation

micha14:02:51

so each one has only a shallow small map of options

mobileink14:02:00

those are great suggestions. now that I've got something working (I actually need it for another project), I can make such refactoring etc. a goal for the next version.

micha14:02:11

but they all coordinate around the application spec, which is the .cljs.edn file

micha14:02:34

but the cool part is that the cljs.edn file is actually created by the tasks, too

micha14:02:39

like you create a minimal one

micha14:02:57

if you use the reload task, it actually modifies the .cljs.edn file, adding the reload client etc

micha14:02:01

to your application

micha14:02:17

so at the end of the day the .cljs.edn file may have lots of things in it

micha14:02:31

but they're mostly generated automatically from simple options passed to tasks

mobileink14:02:46

part of the problem is that i think i still have not completely grokked the fileset model. i had several smaller tasks but could not figure out how to pipeline them - e.g. one task would end up removing something needed by the next task.

mobileink14:02:15

I will definitely look more closely at the strategy used by boot-cljs. looked at it briefly but didn't really understand .cljs.edn. next task is to add some Clojurescript to the sample gae webapp using boot-cljs, so I'll be studying that.

micha14:02:02

yeah the main concept there is to devise a high level model for what a gae application is

mobileink14:02:23

I'm glad I asked you folks to take a look before announcing it - now I'm thinking I'll make some of the mods you've suggested before doing so.

micha14:02:23

examples of such models are like the .cljs.edn spec, the pom.xml, the web.xml, etc

micha14:02:41

these files allow you to express the structure of a thing

mobileink14:02:57

@micha: @alandipert Thanks so much for your help!

micha14:02:00

then you can have different tasks that do one small part of the process

micha14:02:12

if they can look at the spec they can understand the user's intent

micha14:02:28

becaue the spec is a specification of the high level structure of the thing

micha14:02:49

so like the jar task can find your pom.xml, and it can then know how to make a friendly name for the jar

micha14:02:57

like project-version.jar

micha14:02:13

because the pom is a universal project specification

micha14:02:53

i think that's the key to hoisting out of the config map tarpit

micha14:02:47

once you've devised a really good spec, you can then autogenerate the config in most cases

micha14:02:57

given just a few key pieces of information

micha14:02:03

@mobileink: i hope i didn't come off as sounding critical, i didn't mean it that way

micha14:02:16

i get carried away lol

micha14:02:32

the existing implementation is A+ too

mobileink14:02:43

I like critical!

mobileink14:02:09

You can't learn anything if you can't take constructive criticism.

micha14:02:48

ok cool, i talk out my butt a lot simple_smile

mobileink15:02:20

btw, do you know if there is any way to bookmark slack? I want to keep track of your suggestions - is copying the only way?

micha15:02:19

i think so, slack deletes history pretty aggressively for free accounts

micha15:02:47

we have an irc channel on freenode, #bootclj

micha15:02:17

but then you need an irc client that supports history, or a bnc like irccloud

mobileink15:02:30

oops, just notice the little link icon you get on the right when you hover over slack

micha15:02:53

yeah i'm not sure those links will work when they delete history though

micha15:02:57

maybe they save links?

mobileink15:02:02

i'm gonna play it safe, i just copied it to my notes file.

Petrus Theron15:02:35

Seeing some strange behaviour working on Cljs file that could either be Cursive or Boot - probably Cursive, but not sure. When I call "Load file in REPL” from IntelliJ, I get errors from an older version of my file that lives in the out folder. I can eval forms directly and they work, but “Load file in REPL” seems to load the corresponding file in the out folder, that is old. Now, that could be that the file isn’t being updated, or that it’s loading the wrong file.

raywillig15:02:34

i don't know who's responsible for this team, but my company would be happy to make a small contribution to us having an account with unlimited history. we lose a lot of good info this way

juhoteperi15:02:19

Well, the thing is that Slack costs $6.67/user/month (so $33 000/month for Clojurians) so a small contribution doesn't help

micha15:02:38

@raywillig: there is the #C0CB40N8K channel where i think conversations are underway for various options

micha15:02:22

is there a slack logbot?

micha15:02:29

maybe that's an option

juhoteperi15:02:38

Wasn't it pinned here

richiardiandrea15:02:53

That's why we will be kicked out soon :)

micha15:02:55

ah, so that seems like the ideal solution

raywillig15:02:57

wow 33k a month?

juhoteperi15:02:00

Yeah the first pinned item should link to log

micha15:02:20

yeah i can totally understand why they don't want to deal with logs for free accounts

juhoteperi15:02:06

@raywillig: Large opensource communities are not the target segment of Slack (apparently)

micha15:02:03

dealing with the data pipeline to enable search on such a large team would cost them real money

raywillig15:02:08

seems a little short sighted, i think those are the kinds of people that will get their companies to adopt

richiardiandrea15:02:34

A guy I met a couple of days ago was preaching that Slack will integrate every payment option we know of

richiardiandrea15:02:51

He maintained that people don't want to install apps

richiardiandrea15:02:15

And showed me that chats are in the tip ten installed by most of the people

laforge4916:02:01

@flyboarder How do I write the init function for boot-http to set the jetty parameter useFileMappedBuffer to false? See https://github.com/pandeiro/boot-http/issues/41

pandeiro16:02:21

@laforge49 Maybe try doing so in a function that you specify as the :init param?

laforge4916:02:59

yes, exactly. but the specifics elude me.

pandeiro16:02:51

I'm not sure the exact Java interop code to do such a thing, but you could probably copy it out of wherever boot-jetty implements the handling of that :init-params?

laforge4916:02:20

I looked at that code. 😞

laforge4916:02:09

(def server (impl/serve (.getPath webapp) port ~init-params)))

pandeiro16:02:54

See the silence-jetty! fn?

laforge4916:02:44

Interesting! simple_smile

pandeiro16:02:56

I think if you wrote a fn like that, but with your property, and passed it to :init (`boot serve -h`)...

flyboarder17:02:26

Yeah sorry I don't run web servers on Windows :/ I think @pandeiro is in the correct track

laforge4917:02:09

Thanks guys. @pandeiro please close the issue! 😄

pandeiro17:02:49

Feel free to close if the solution works @laforge49 , otherwise let's keep it open, someone might know more

mobileink17:02:21

hi again. mystified again. why is this giving me ClassNotFound for miraj.markup? doesn't make-pod put it on the cp?

mobileink17:02:23

(let [pod (-> (core/get-env) (update-in [:dependencies] conj '[miraj/markup "0.1.0-SNAPSHOT"]) pod/make-pod future)] (core/with-pre-wrap fileset (pod/with-eval-in @pod (if ~ns-str (let [ns-sym (symbol ~ns-str)] (require 'miraj.markup ns-sym) (miraj.markup/foo) ...

micha17:02:26

the issue is that you need to use resolve there

micha17:02:20

it's an issue with the clojure compiler not being able to resolve the name when it compiles the expression

micha17:02:54

if you put the (require 'miraj.markup) at the top level of your pod expression it should work

micha17:02:19

because the compiler compiles top level expressions separately

micha17:02:54

(with-eval-in p
  (require 'foo)
  (if something
    (foo/bar :ok)
    ...

micha17:02:00

that should work

micha17:02:24

if the require is not top level, eg, it's inside the if, then you need to call resolve

micha17:02:56

this is just how clojure works, it's not related to boot really

mobileink17:02:03

aha. my original code did it that way. inserting (if .. broke it.

mobileink17:02:44

oy, now I'm dimmly recalling that require is supposed to be top level.

micha17:02:10

you can still do what you are doing there, but you need to do resolve

mobileink17:02:49

ok, now i know what to do, i've used resolve in that way before. thanks again. i'll add something to the Troubleshooting section. 😉

laforge4917:02:10

I'm stuck at clojure.lang.ExceptionInfo: Could not locate boot_http__init.class or boot_http.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

laforge4917:02:41

here's a bit of my build.boot:

laforge4917:02:42

(set-env! :dependencies '[[adzerk/boot-cljs "1.7.228-1"] [hoplon/boot-hoplon "0.1.13"] [hoplon/hoplon "6.0.0-alpha13"] [org.clojure/clojure "1.8.0"] [org.clojure/clojurescript "1.7.228"] [pandeiro/boot-http "0.7.2"] ; [tailrecursion/boot-jetty "0.1.3"] [aatree/durable-cells "0.1.0"]] :source-paths #{"src/client" "src/worker"}) (require '[adzerk.boot-cljs :refer [cljs]] '[hoplon.boot-hoplon :refer [hoplon prerender]] '[pandeiro/boot-http :refer [serve]] ; '[tailrecursion.boot-jetty :refer [serve]] )

micha17:02:44

the double underscore there looks suspicious

micha17:02:54

you have a slash in the require

micha17:02:01

namespace names can't have slashes in them

micha17:02:06

you want a dot there

laforge4917:02:41

--knew it was something DUMB

laforge4917:02:48

Took me a while to get a clean boot.build compile, but I ended up with this:

laforge4917:02:03

(defn jetty-init [] (.put (System/getProperties) "org.eclipse.jetty.servlet.Default.useFileMappedBuffer" "false")) (deftask dev "Build for local development." [] (comp (serve :port 8000 :init 'jetty-init) (watch) (speak) (hoplon) (cljs :optimizations :simple) ; (show :fileset true) #_ (serve :port 8000 :init-params {"org.eclipse.jetty.servlet.Default.useFileMappedBuffer" "false"} :resource-root "/resource") ))

laforge4917:02:16

But now I get clojure.lang.ExceptionInfo: java.lang.NullPointerException data: {:file "C:\\Users\\Bill\\AppData\\Local\\Temp\\boot.user3533130444786227273.clj", :line 25} java.util.concurrent.ExecutionException: java.lang.NullPointerException

flyboarder17:02:47

NPE so is there a symbol not being referenced correctly? One sec let me switch to my laptop

flyboarder17:02:04

oh you dont need to quote the symbol if it’s defined in build.boot i think

flyboarder17:02:18

:init jetty-init

laforge4917:02:08

I'll try that again.

laforge4917:02:58

If I don't quote it, I get clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: option :init must be of type sym

flyboarder17:02:35

im going to test with my project

laforge4917:02:49

I replaced the .put with a println, so it isn't the function itself.

alandipert17:02:00

@laforge49: you want that to be a fully qualified symbol i think

alandipert17:02:16

e.g. 'your.ns/jetty-init

alandipert17:02:25

and then the serve task will require and resolve

laforge4917:02:24

(u/resolve-and-invoke '~init) resolves it.

laforge4917:02:39

so, in build.boot, the ns is boot.user?

alandipert17:02:43

(symbol (str *ns*) "jetty-init") another cool way

alandipert17:02:10

i guess that's only useful if the things are in the same ns

laforge4917:02:44

(serve :port 8000 :init boot.user/jetty-init) now gives me clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: option :init must be of type sym

laforge4917:02:07

Perhaps I need to quote it. trying...

flyboarder17:02:09

you still have to quote it

flyboarder17:02:18

but that will still fail

flyboarder17:02:59

try moving jetty-init to a different ns one in your project

laforge4917:02:03

Yes, with this clojure.lang.ExceptionInfo: java.io.FileNotFoundException: Could not locate boot/user__init.class or boot/user.clj on classpath.

pandeiro17:02:09

Huh, wonder why that fails

alandipert17:02:14

oh, because build.boot isn't in the pod that the serve task runs in

alandipert17:02:29

or rather, boot.user isn't

alandipert17:02:49

+1 for moving it to a namespace in sources

laforge4918:02:36

Thanks @flyboarder @pandeiro and @alandipert --everything is now running.

laforge4918:02:13

So I'll clean up that issue and then I can try working on the route. simple_smile

pandeiro18:02:46

Take that, Ballmer!

mobileink18:02:42

FYI added a Troubleshooting item on use of require in a pod with a detailed explanation of what happens if it isn't top level. I hope I got it right 😉 - anybody concerned is encouraged to check it for accuracy.

pandeiro18:02:36

Thanks for adding that @laforge49, nice

laforge4918:02:52

It is the least I can do. Thanks for all the great code!

laforge4921:02:19

Veddy interesting, @flyboarder @micha All I did was switch to boot-http from boot-jetty, and configured it for windows, and now the dcells.js is being served. No sift, no routing. simple_smile

laforge4921:02:30

It just works.

laforge4921:02:08

@pandeiro I love boot-http. I just works. ^^

laforge4921:02:18

And now, wonder of wonder, the app can now be compiled with optimization :none, since the worker .js file is compiled separately. simple_smile

laforge4922:02:55

You guys did all the work. But yeah, there is a smile on my face. simple_smile