This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-27
Channels
- # admin-announcements (42)
- # aws (15)
- # beginners (8)
- # boot (102)
- # cider (7)
- # clojure (141)
- # clojure-italy (10)
- # clojure-japan (4)
- # clojure-russia (26)
- # clojure-seattle (1)
- # clojurescript (239)
- # core-matrix (13)
- # cursive (19)
- # datascript (54)
- # datomic (21)
- # editors (2)
- # events (1)
- # hoplon (125)
- # instaparse (10)
- # jobs (3)
- # ldnclj (13)
- # ldnproclodo (1)
- # om (1)
- # onyx (2)
- # rdf (206)
- # re-frame (30)
- # reagent (7)
- # yada (4)
@xifi: re: windows, there was this https://github.com/boot-clj/boot/issues/93
@alandipert: thanks for the link. I still think the README
should be changed. The wiki page for Windows describes how to setup an environment where you can build and install boot, but you already provide a pre-built executable. My issue is - if you just link to an executable people expect it to just work. This isn't true due to what we discussed with @micha and the user ends up installing boot, running it and getting huge stacktraces. That is not a good start. If the temp file deletions don't work and they are critical to do then the tool is broken on the platform.
Something like "We're looking for a Windows developer to help us fix some issues we have on the platform. In the meantime you can use docker with our container." would set up the expectations and call for some help
@martinklepsch: @juhoteperi @micha we see there is some dependency order carried within the boot fileset for cljs files
https://github.com/cljsjs/boot-cljsjs/commit/35458dc31793782343953a405dcfb5cfab730c6e#diff-20583ae277bacc57514e87233552c403R37
since we have an issue with ordering, we were thinking if there is any docs about this somewhere?
we would like to write an initialization script in CLJS and let a :foreign-lib
:require it.
but the CLJS code is located after the foreign-lib code in the :simple or :advanced optimized source,
the foreign-lib can not see the effects of CLJS init code.
can we use this :dependency-order
somehow to control this ordering?
The dependency order set by boot-cljs doesn’t include foreign-libs
E.g it only works with cljs namespaces
though this doesn’t affect simple or advanced builds at all
But the dependency order is build from cljs namespaces and not closure modules currently
Other than by provide and require, no
I would think it should work
If it doesn’t, it should be fixed upstream
I’m not sure if the problem is in Cljs or Closure
@micha: you said the issue might be with non-closed handles on the files. Does this come from clojure's core? Can't that be fixed? However reading through the web I found that java might not be the only culprit - it is common for other programs to look through newly created files - search indexers, antivirus software etc. If these are using the file at the moment of deletion then it will fail.
I'm quite surprised this cannot be fixed, damn windows Couldn't there be some safety code that e.g. tries to delete the file several times with some small delay, up till a fixed amount of retries?
@onetom: Did it work with no optimization? I’m seeing there might be a problem with changing contents of foreign-lib js
reading through issues on JIRA for clj and cljs there are fixes on the file handle leaks but they'll only get into the next versions
oh boy, it works with clojure 1.8.0-alpha4 and clojurescript 1.7.58 (107 died with some horrible error), which is strange because 1.7.58 doesn't include the fix on the leak yet
@micha: this ^ means that going forward the new versions might fix these issues on windows. Mind you it still might fail randomly if any other program gets its hand on the file(s)
@onetom: Foreign-dep source is concatenated to start of output file in optimization mode by Cljs compiler
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L1714
Few lines up, optimize
is called with js sources, including compiled cljs files but excluding foreign-dep files and that creates the optimized source
I’m thinking that if you write the JS code as Closure module, it should work
But I couldn’t that to work either
@juhoteperi: are you talking about foreign libs reloading? Seems like fig wheel recently added such feature, maybe worth drawing inspiration from there
@martinklepsch: Problem is not with reloading but with Cljs compiler, it doesn’t copy changed foreign-dep files to output-dir, not much we can or should do
@juhoteperi: in non optimised mode the execution order was correct IF we only required the foreign lib from the main namespace and let it trasitively require the cljs init code
But since there is no explicit reference to the cljs init code from the foreign lib, it gets dead code eliminated in adv mode and combined in the wrong order in simple mode
I’m thinking the reason is different
Foreign-dep code is always prepended to optimized output
Foreign-dep files are not closure modules, they are not sorted with other files
I did already test this
Not really
In dev mode the files are copied to output folder and they have dependency data mocked
They still aren’t Closure modules though their dependency info is added to dependency index
In dev mode Closure compiler is not used at all (Closure lib is used)
In optimized mode Closure compiler takes care of concatenating the files to correct order but it doesn’t handle foreign-deps at all
> In dev mode Closure compiler is not used at all (Closure lib is used) ^^^ this was unclear to me until now! so the cloSure compiler is not consuming the "mocked dependency data"?
That’s how I understand the code
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L1702-L1716 this is the relevant part and it does filter foreign-deps out of optimize
call
They should not be munged
if i would ask: "can a foreign-lib depend on cljs code and expect the side-effects of the cljs code accessible to visible to the foreign-lib?" would that precisely summarize the issue im facing now?
@onetom: I’m not sure if side-effects are necessary?
what do u mean by necessary? foreign-libs are stupid to expect global state before they start
Hmm, I guess defining vars is also a side-effecty
dnolen wont look into examples using something else than Cljs compiler
Also check his message on #C03S1L9DN
@onetom you can make a foreign lib into a real google closure lib if you want. then it would behave exactly the way any lib in the goog.* namespaces do with respect to dependency ordering and cljs compiler will not treat it specially
goog.provide('my');
goog.require('some.cljs.namespace');
eval("...the my.js javascript contents...");
then it's a bona fide closure library and can be passed through the closure compiler etc
hmm... all these things are relevant when im acquiring the foreign-lib during build time, not runtime. i just realized i forgot to think about the runtime case totally...
if i acquire the foreign lib at runtime (let the browser of the client download it) then the lib dev can seamlessly distribute minor version upgrades and im not forced to redeploy my app which depends on that lib
when you package it as a :lib
i think you short circuit some of the cljs compiler stuff that might be messing you up
but if i get the foreign lib at compile time, then i wont "benefit" from their minor version upgrades automatically
i've never messed with that, because i want to lock down the versions of code that's running in my application to protect me from upstream regressions
also i personally feel like it's somewhat rude to load foreign code that i haven't seen into my page that has my SSL cert showing in the address bar in the green padlock
yeah... there was a great article on this years back. something like this: http://tonyarcieri.com/whats-wrong-with-webcrypto or https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/august/javascript-cryptography-considered-harmful/
you can't trust the browser, but i'd like you to be able to trust adzerk, inc. when you see the green padlock in the address bar
so i guess my issues also boil down to another question then: do i want to load some of the functionality async into my page? * google analytics * hubspot analytics * hubspot form API * inspectlet these are all quite big libraries and i wouldn't want to delay my prerendered page coming alive by loading all these on top of the ~2MB javascript generated by CLJS
if i were to load these async, then i would need to be able to have a callback on them, so i can kickstart them after they loaded
@xifi: that's fair, thanks for the feedback re: windows. btw would you happen to have access to windows 10?
@alandipert: hi. No I don't. I'm only running win7 because I have to at work. Otherwise I'd wipe that virus out
i had win on my home laptop and wanted to try a linux distro one day. So I made a separate partition and installed it. Then I found out I chose the wrong partition. And I never looked back.
@xifi: alandipert http://dev.modern.ie/tools/vms/ for testing (i havent tried them though)
btw i made an #C09N0H1RB channel where those of us on amazon can compare notes, if anyone is interested
@juhoteperi: this is failing again with -3
: https://github.com/martinklepsch/boot-cljs-multiple-builds
looking at the changelog I don’t get it
app.out.cljs.core, could not locate app/out/cljs/core.cljs, app/out/cljs/core.cljc, or Closure namespace “app.out.cljs.core"
also fails with -2
also with -1
but different error
@martinklepsch: Did you try with -3
?
... had some beers and didn't read the first line