Fork me on GitHub
#boot
<
2015-08-09
>
micha01:08:15

@juhoteperi: oh man, i totally didn't see that

onetom05:08:29

oh, shit... simple_smile

onetom05:08:42

it looks a lot cleaner than the previous version...

onetom05:08:52

we should have involved the expert here simple_smile but then again, we started out with looking into hoplon first...

onetom06:08:16

Any idea why is this happening? Im in the https://github.com/exicon/hoplon-multipage-example repo and trying [adzerk/boot-cljs "1.0-SNAPSHOT"]

onetom@retinatom ~/e/hoplon-multipage-example> boot -u
Retrieving boot-2.2.0.jar from 
#
#Sun Aug 09 13:59:55 HKT 2015
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.2.0
#App version: 2.2.0
WARNING: update already refers to: #'clojure.core/update in namespace: clj-http.client, being replaced by: #'clj-http.client/update
onetom@retinatom ~/e/hoplon-multipage-example>

onetom06:08:46

If I got a directory which doesn't have a build boot, I still get the warning, but it downloads more files:

onetom@retinatom ~/exicon> boot -u
#
#Sun Aug 09 14:07:19 HKT 2015
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.2.0
#App version: 2.2.0
Retrieving worker-2.2.0.jar from 
Retrieving tools.namespace-0.2.11.jar from 
Retrieving aether-2.2.0.jar from 
WARNING: update already refers to: #'clojure.core/update in namespace: clj-http.client, being replaced by: #'clj-http.client/update

onetom06:08:30

@juhoteperi, im trying the examples from the boot-cljs/next/README:

onetom@retinatom /t/x> mkdir src
onetom@retinatom /t/x> echo -e '(ns foop)\n(.log js/console "hello world")' > src/foop.cljs

onetom@retinatom /t/x> boot -s src -d adzerk/boot-cljs cljs   # which is understandable
org.sonatype.aether.resolution.DependencyResolutionException: Failed to collect dependencies for [#object[org.sonatype.aether.graph.Dependency 0x6b57696f "adzerk:boot-cljs:jar:RELEASE (compile)"]]
...

onetom@retinatom /t/x> boot -s src -d adzerk/boot-cljs:1.0-SNAPSHOT cljs
ERROR: No ClojureScript dependency.
Writing main.cljs.edn...
             clojure.lang.ExceptionInfo: java.lang.NullPointerException

onetom06:08:18

i was installing the boot-cljs next branch using boot pom jar install maybe it's not the correct way to do so?

juhoteperi06:08:18

@onetom: You'll need to add clojurescript dependency to the project (1.7.28)

onetom06:08:30

running it now:

onetom@retinatom /t/x> boot -s src -d adzerk/boot-cljs:1.0-SNAPSHOT -d org.clojure/clojurescript:1.7.48 cljs
Retrieving google-closure-library-third-party-0.0-20150805-acd8b553.jar from 
Retrieving closure-compiler-externs-v20150729.jar from 
Retrieving clojurescript-1.7.48.jar from 
Retrieving closure-compiler-v20150729.jar from 
Retrieving google-closure-library-0.0-20150805-acd8b553.jar from 
Writing main.cljs.edn...
             clojure.lang.ExceptionInfo: java.lang.NullPointerException
    data: {:file
           "/var/folders/9d/9j3pmgps4y54_dj8bwyngks40000gn/T/boot.user2769719586904406429.clj",
           :line 15}
java.util.concurrent.ExecutionException: java.lang.NullPointerException
         java.lang.NullPointerException:
             io.clj:  404
                         io.clj:  416
                         io.clj:  418
                                ...
   adzerk.boot-cljs.middleware/main  middleware.clj:   44
  adzerk.boot-cljs/eval363/fn/fn/fn   boot_cljs.clj:  107
  adzerk.boot-cljs/eval335/fn/fn/fn   boot_cljs.clj:   61
                boot.core/run-tasks        core.clj:  695
                  boot.core/boot/fn        core.clj:  705
clojure.core/binding-conveyor-fn/fn        core.clj: 1916
                                ...

onetom06:08:56

is it a temporary requirement or shall we incorporate it into the README?

juhoteperi06:08:09

Not sure yet

onetom06:08:16

im getting an error still:

onetom@retinatom /t/x> boot -s src -d adzerk/boot-cljs:1.0-SNAPSHOT -d org.clojure/clojurescript:1.7.48 cljs
Writing main.cljs.edn...
             clojure.lang.ExceptionInfo: java.lang.NullPointerException
    data: {:file
           "/var/folders/9d/9j3pmgps4y54_dj8bwyngks40000gn/T/boot.user2769719586904406429.clj",
           :line 15}
java.util.concurrent.ExecutionException: java.lang.NullPointerException
         java.lang.NullPointerException:
             io.clj:  404
                         io.clj:  416
                         io.clj:  418
                                ...
   adzerk.boot-cljs.middleware/main  middleware.clj:   44
  adzerk.boot-cljs/eval363/fn/fn/fn   boot_cljs.clj:  107
  adzerk.boot-cljs/eval335/fn/fn/fn   boot_cljs.clj:   61
                boot.core/run-tasks        core.clj:  695
                  boot.core/boot/fn        core.clj:  705
clojure.core/binding-conveyor-fn/fn        core.clj: 1916
                                ...

juhoteperi06:08:12

Looks like you don't have main.cljs.edn created, could be something broken in that case

juhoteperi06:08:00

I think I see the problem

onetom06:08:32

i dont, because the examples doesn't tell me to do so...

juhoteperi06:08:44

The problem is in the implementation

onetom06:08:59

ok, "happy to hear" simple_smile

juhoteperi07:08:01

Oh, I had a old Boot binary. Doesn't -u take care of updating the binary?

onetom07:08:54

thats the whole point of the separation between the libs and the bin, so they can evolve independently

juhoteperi07:08:54

@onetom: Pushed fix to next branch

onetom07:08:25

since updating the binary is a lot trickier (from file system permissions point of view)

onetom07:08:44

and it also changes a lot less often, so it makes sense to deploy it independently

juhoteperi07:08:03

I had still binary from rc1 😄

onetom07:08:38

that proves the point

onetom07:08:57

so, is this the right way to install the lib:

onetom@retinatom ~/r/boot-cljs> time boot pom jar install

juhoteperi07:08:24

Should be okay, boot build-jar is the proper way but it does exactly same

onetom07:08:41

it worked; trying my "multipage" repo now

onetom07:08:41

would u mind deploying this snapshot version to clojars, just for the sake of convenience?

juhoteperi07:08:53

Ah, bootlaces doen't like that the branch is not master

onetom07:08:21

the multipage repo compiled, but i got

WARNING: Multiple .cljs.edn files found, you should use `id` option to select one.Elapsed time: 9.478 sec
i suppose hoplon might need some adjustments

juhoteperi07:08:46

Yeah, you need one cljs task per different build

onetom07:08:42

why don't u merge this next branch back to master?

onetom07:08:02

just branch master into a release branch

onetom07:08:15

i usually call it based on the version number and an x in to suggest which part of the version can change on that branch

onetom07:08:29

so it would be v0.0-x in this case

onetom07:08:11

with that i mean u can put it effectively into maintenance mode

onetom07:08:41

and let's use this new implementation which relies on the newer cljs compiler the master

onetom07:08:52

(need to pick up some friends now, bbl)

juhoteperi07:08:26

Hmh, does boot-hoplon create separate cljs edn for each .cljs.hl file?

juhoteperi07:08:13

I think separate envs for multiple builds will make that significantly slower

onetom08:08:04

might make it slower, but it doesnt matter. it should work 1st, then we will optimize

juhoteperi08:08:35

Is there a way to check if a ns is already loaded?

juhoteperi09:08:09

Ohhhhh... Figwheel does just (load changed-clj-file) for changed clj files which contain string (defmacro

juhoteperi09:08:41

That can't work when macro uses something from other ns which changes

juhoteperi09:08:31

Or maybe it's reloading all changed clj files

juhoteperi11:08:09

@micha: Why are we manually dependency ordering the files 😄

juhoteperi11:08:21

Closure could already take care of that

juhoteperi11:08:31

goog.net.jsloader.loadMany(uris, opt_options) Loads and evaluates the JavaScript files at the specified URIs, guaranteeing the order of script loads.

juhoteperi12:08:42

But I'm thinking it should be possible as if cljs_deps.js is loaded first, Closure knows the dependency graph

micha14:08:30

@juhoteperi: if goog can do it that would be awesome

micha14:08:49

i think it's still useful to add analysis info to the files in the fileset though, no?

micha14:08:25

i mean metadata about the relationship between js files and the corresponding cljs namespaces, etc

micha14:08:49

it would make it much easier to make more powerful tooling later in the pipeline after cljs

micha14:08:39

also dude, 💥 macro reloading

micha14:08:46

that's incredible news

micha14:08:14

@juhoteperi, @onetom i was thinking about the multiple build thing

micha14:08:31

i think we can run multiple builds in parallel in separate pods

micha14:08:00

we'd need to make the output-dir unique for each cljs.edn file though

micha14:08:00

we were thinking yesterday like foo/bar.cljs.edn --> foo/bar.out/ (`:output-dir`)

micha14:08:36

perhaps in boot-cljs we loop over cljs.edn files, creating a pod and output-dir for each

micha14:08:43

and compile in parallel

micha14:08:27

!m deraen

juhoteperi15:08:12

@micha: Perhaps the parallel running could be done as a special task

juhoteperi15:08:21

clone input files and merge output files

juhoteperi15:08:29

or well no cloning really required

micha15:08:42

why not just run in a loop with futures in a single cljs task?

juhoteperi15:08:29

It keeps cljs task cleaner when there is separate tmp-dir for each build... though then user needs to sift the files to keep them from colliding... hmph

micha15:08:53

@juhoteperi: i was thinking unique output-dir for each cljs.edn file

juhoteperi15:08:04

separate pods also, I think

micha15:08:06

like foo/bar.cljs.edn --> foo/bar.out/

micha15:08:17

definitely separate pods

micha15:08:16

so they can't collide

juhoteperi15:08:41

Btw. other thing, what do you think about boot-cljs versioning and clojurescript dependency? Even though boot-cljs is now using Cljs API it looks like for a while it will require the latest Cljs version because API changes and fixes

micha15:08:43

and those would all be in the tmp-result tmpdir

juhoteperi15:08:54

So boot-cljs should still follow cljs versioning

micha15:08:18

yeah we should just override their cljs version

juhoteperi15:08:59

@martinklepsch: I'm thinking Weißbier is the best recovery drink after sports

martinklepsch15:08:34

😄 I’m not so much into Weißbier, sometimes really enjoy cold Radler (Sprite + Beer) on hot days & after sports

micha15:08:57

i'm listening to Weezer at the moment

micha15:08:08

if they were a drink i bet it would be great

juhoteperi15:08:08

@martinklepsch: Yeah Radler is definitely nice on hot days

micha16:08:25

@juhoteperi: good work on the macro reloading

micha16:08:45

that's going to be really great to use

juhoteperi16:08:36

I don't like that it must depend on ns-tracker but it's simplest way I can see

juhoteperi16:08:52

new pod would be another but I fear it would be really slow

micha16:08:13

can we persist the compiler env analysis to disk?

martinklepsch16:08:15

you can use a separate pod for ns tracker?

micha16:08:16

i think we can

juhoteperi16:08:26

I don't think

martinklepsch16:08:31

(I probably don’t see the complete picture)

juhoteperi16:08:38

It contains lots of objects

juhoteperi16:08:45

they can't be persisted

micha16:08:47

david told me we could, i think

micha16:08:01

i think we only need one of the keys in there

micha16:08:04

the analysis part

micha16:08:40

i noticed cljs is writing cache files now, too

micha16:08:45

to the output-dir

juhoteperi16:08:46

and the compiler state is not even the part I'm worrying, just loading all namespaces would take some time

micha16:08:13

you could preload a lot of them, like the cljs compiler and such

micha16:08:28

but there is the unfortunate class leaking bug

micha16:08:37

so we need to fix that first

juhoteperi16:08:13

Also it would be hard to see when we have to refresh the pod

juhoteperi16:08:22

we don't want to do that when backend code is changed

martinklepsch16:08:27

btw, in boot-garden there has been an seemingly caused by :init when the task is being used multiple times: https://github.com/martinklepsch/boot-garden/pull/8/files

micha16:08:36

:init was triggering the class leaking?

juhoteperi16:08:18

If only clojure require had :reload-recursively option...

micha16:08:48

(require 'my.namespace :reload :all)

micha16:08:53

is that not what you want?

juhoteperi16:08:01

Is there such thing?

micha16:08:06

i believe so

juhoteperi16:08:24

Oh, :reload-all. I wonder what it does.

micha16:08:49

:reload-all implies :reload and also forces loading of all libs that the
  identified libs directly or indirectly load via require or use

juhoteperi16:08:14

Looks like it would be what I want. Maybe there are some problems with it or why do ns-tracker and c.t.n.refresh exist?

juhoteperi16:08:18

https://github.com/clojure/tools.namespace#reloading-code-motivation but I don't think ns-tracker does take care of those problems either

micha16:08:25

martinklepsch: yeah i'm not sure what the :init fn was trying to do there

micha16:08:48

deraen: i think ns-tracker tries not to reload all

martinklepsch16:08:03

@micha: you mean this? :init (fn [pod] (pod/require-in pod 'garden.core))

micha16:08:03

i think it tries to prune the things that get reloaded to just what's needed

micha16:08:18

martinklepsch: yeah

micha16:08:35

oh i guess it takes a long time to require the namespace

micha16:08:26

that Stream closed exception is really strange

micha16:08:13

@juhoteperi: i may take a stab at the parallel compiler thing, is that cool?

juhoteperi16:08:37

@micha: Sure. What solution are you thinking?

micha16:08:21

i was thinking to first generate the output-dir path from the cljs.edn file path, like foo/bar.cljs.edn --> :output-dir "foo/bar.out"

micha16:08:40

this would ensure that all compiled js have their own output dir in the proper relative path

micha16:08:03

the output dir would be craeted in a single tempdir shared by all js builds

micha16:08:36

then loop through .cljs.edn files and create a separate pod for each one

micha16:08:50

then run the compiler in the pod in a future

juhoteperi16:08:52

Yeah sounds good. Check the new master and create new branch.

micha16:08:08

i see you merged next into master :thumbsup:

juhoteperi16:08:23

I'll probably revert Clojurescript dependency changes sometime

micha16:08:46

i did some TDD with onetom yesterday and i want to see how it goes, so i'll add tests too

juhoteperi16:08:54

Yeah tests are good

juhoteperi16:08:16

I did add some myself... but I think they didn't make it into the current version :d

alandipert16:08:16

@martinklepsch: Radler sounds amazing, i will try it

alandipert16:08:16

as a child i made and drank a lot of spezi

juhoteperi16:08:19

I did test :reload-all vs. ns-tracker

juhoteperi16:08:05

if the macro ns requires e.g. schema.core, compojure.core and other heavy namespaces, :reload-all takes about 3 seconds 😄 with ns-tracker the compilation takes only 0.2 seconds.

martinklepsch16:08:07

Are there any problems with ns-tracker?

juhoteperi16:08:28

Not that I can see

juhoteperi16:08:41

I guess it's fine. I just wanted to be sure if it's necessary.

martinklepsch16:08:41

You can put it in a pod if you want to right?

juhoteperi16:08:27

It's in pod yeah

martinklepsch16:08:11

@juhoteperi: should it be removed from build.boot then?

juhoteperi16:08:35

@martinklepsch: No, it's test scoped there. It's for testing the project.

juhoteperi16:08:42

It's not transitive.

martinklepsch16:08:24

testing the project as in real tests? simple_smile

juhoteperi16:08:05

Helps a lot that I can load the impl ns in repl. For autocompletion etc.

micha17:08:43

anyone have recommendations for fixtures in clojure tests?

micha17:08:50

like useful libraries etc

micha17:08:17

i'm going to be writing files and stuff and compiling them with cljs

micha17:08:41

i guess the built-in boot stuff will be pretty good for that

martinklepsch17:08:46

Excited to see what you come up with regarding tests, Must be awesome with boot/filesets simple_smile

micha17:08:08

going to try htmlunit to render html for testing shims etc

micha17:08:23

not sure how to test source maps though

juhoteperi17:08:54

I'm not sure if it's that useful to test on that level

micha17:08:11

i would like to be able to test for regressions there

micha17:08:27

because the configuration for the shim and source maps is pretty convoluted

juhoteperi17:08:43

Source map configuration is not that bad I think

juhoteperi17:08:57

But yeah, shim configuration is quite complex

micha17:08:04

i remember a lot of workarounds needed to be done with source maps

micha17:08:15

because cljs compiler was not expecting tempdirs

micha17:08:23

so it would compute paths wrong

juhoteperi17:08:40

Nothing special there anymore

juhoteperi17:08:10

I'm thinking shim could be satisfactorily tested just unittests, fileset + params -> should set these options

juhoteperi17:08:26

or well, it shold also write the shim file. But no compilation required, I think.

micha17:08:49

we were using phantomjs with a dump.js script to debug that yesterday, it was pretty good

micha17:08:25

compiling cljs and loading the page is nice because it exercises all the things, like cljs_deps.js, goog/base.js, etc

micha17:08:41

any of which can end up in the wrong place if you touch the configuration code

micha17:08:03

or be overwritten with the wrong thing

micha17:08:13

if the paths are not correct

micha21:08:01

it's alive