This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-12
Channels
- # aws (3)
- # beginners (28)
- # boot (3)
- # cider (28)
- # clara (5)
- # cljs-dev (107)
- # cljsrn (1)
- # clojure (40)
- # clojure-austin (2)
- # clojure-brasil (5)
- # clojure-canada (1)
- # clojure-italy (1)
- # clojure-spec (39)
- # clojure-uk (38)
- # clojurescript (33)
- # community-development (11)
- # cursive (11)
- # datomic (43)
- # duct (6)
- # emacs (7)
- # flambo (1)
- # fulcro (68)
- # graphql (11)
- # jobs (1)
- # jobs-discuss (8)
- # leiningen (16)
- # luminus (2)
- # lumo (1)
- # off-topic (38)
- # om (2)
- # onyx (15)
- # parinfer (32)
- # portkey (5)
- # re-frame (50)
- # reagent (50)
- # reitit (1)
- # shadow-cljs (63)
- # spacemacs (10)
- # sql (27)
- # unrepl (6)
- # yada (2)
Bunch of fun things to try with master. All the command line stuff and the Nashorn target. I just confirmed that core.async can be tested via nashorn
By the way, these two changes would be easy to finish: https://dev.clojure.org/jira/browse/CLJS-2376 https://dev.clojure.org/jira/browse/CLJS-2346
I think the require :default
for ES6 modules is desired, but I'm not sure if the implementation in my patch makes sense
For requires with /
, maybe it just makes sense to force everyone to use strings, like now, and just skip the change
I’d appreciate an opinion if my patch https://dev.clojure.org/jira/browse/CLJS-2501 is reasonable
@kommen Looks good to me
@juhoteperi 2346 still doesn’t seem all that desirable to me
@juhoteperi I don’t really like the approach suggested by 2376, I left a comment
(:require ["material-ui/RaisedButton" :refer [RaisedButton]]) what if the module exports both default and RaisedButton property?
:refer [default] already works, or :as alias and alias/default
I don't see how we could decide that :refer [Something] should refer to default property
If some thing exports default and a RaisedButton property how do you distinguish that in JavaScript?
@juhoteperi determining that :refer
should be default doesn’t seem difficult to me.
but actually I really don’t think we should care about the differentiating thing anyway
if you need to get at the other thing (which is less likely) then you can do it normally via the namespace
but we can get that by parsing the modules - I thought we did something like this elsewhere already?
If we have module that does something like foo.js:
function a () {};
export { a as default, a, a as foobar };
in this case these imports would refer to same function:
import a from 'foo'; // default export
import bar from 'foo'; // default export, name here doesn't matter
import {a} from 'foo'; // a property
import {a as bar} from 'foo'; // a property renamed
import {foobar} from 'foo'; // foobar property
If I understand your :refer [RaisedButton]
example, in that case, the module-name would be used to refer to default export?
But if RaisedButton
module exports both default and RaisedButton property (and different values), it wouldn't work:
export {f1 as default, f2 as RaisedButton};
Only one of those could be accessible using :refer [RaisedButton]
And I agree, as you said on the issue, this is only about convenience
@r0man your problem seems a bit strange, if you had something minimal to look at that would be easier to sort out
@dnolen yes, I'll try to come up with a minimal test case for this. do you know if at the point cljs-base is marked as loaded all the files in it should have been evaluated, or could they be loaded later on demand?
@r0man then just a bug, it should work under :none
definitely did a lot of testing around that
another big change from yesterday’s Nashorn work is that we just try to establish printing automatically now for environments with console
and for the Nashorn target.
I don’t think this should affect REPLs or whatever since those things override after cljs.core
loads
@mfikes let me know if you can’t get the command line stuff to work, I tried your specific example and it seem to work
Yes. The only remaining aspcct that didn't work was using cljs.core
instead of clojure.core
(the latter worked for me)
Yeah, right. clojure.main
worked for me, but not cljs.main
. But, on second thought, perhaps I typed cljs.core
.
I may give it a spin today to try to find any corner cases. One would be that -e
that produces nil
shouldn't print, etc.
Yeah, will do. Also, I suspect a better example for the news post would be nice, but that can come later
@dnolen What I'll do is manually run all of the Planck tests surrounding -e
, etc, on ClojureScript proper
Jim Laskey (Nashorn lead) on Project Detroit https://www.youtube.com/watch?v=-JLhwsbMvjQ
@mfikes I can’t remember some of the details of what we talked about, but if you do feel free to add that to the ticket
One thing that occurred since then: We now have the possibility of immutable git deps that might also be amenable to global caching. Dunno.
I think my plan now might be to organize cache by compiler version and artifact id + version, would be easier to debug
I wonder how you would even detect a git dep, if all you end up seeing is the classpath. Perhaps you look for the sha in the path.
why not just include everything when building the sha? (sha {:url source-url :compiler-verison ... :build-opts ...})
and then write cache to .cache/cljs/core.cljs.cache.<sha>
?
could do that, but slightly harder to debug if some reason need to go poke around in there, which I suspect there will be
@dnolen reading the deps.edn file wouldn't inform you about transitive git dependencies, if that matters.
the cache file itself can be {:source source-string :js generated-js :ana analyzer-data :build-opts etc}
Ah, okay. Currently there's not an API which lets you know the dependency type, fwiw. Although I was thinking of proposing that the manifest type gets added to lib-map this morning anyway, and this would be a good use-case for it.
@dominicm ok, I hadn’t looked at the API that closely - in anycase this is some future step 🙂
don't know why I'd never need to hunt for anything. the compiler tells me the sha it used for caching and I look at it. there is no guessing involved in which files where used.
@thheller well this isn’t that important of a decision, the benefit is a small one, a user (not me) can go look in the cache easily when sorting out some issue
@dnolen Not a big deal, but I bet that the fact that -v
takes a Boolean argument will trip up a lot of users that expect it to take no arguments.
@mfikes we’d have to make the command line parsing a bit fancier, I don’t really want to take on a dep for that - the approach was copied over from clojure.main
and duplicates its requirements/limitations
@mfikes feel free to add an enhancement ticket for fixing up -v
--verbose
as a special case, that’s easy enough to do
@dnolen I never wrote a ticket because I failed to figure out what was wrong, but I was unable to get .cljsc_opts
to actually have an effect. (I think I'll dig more into later to see what was going on.)
@mfikes these cljs.main
bug reports are really great 🙂 surprising number of cases to check for
also nice that we really have enough there in prior work to make this all pretty straightforward
@anmonteiro was pretty excited the generating cljs.user.XXXX
namespaces for empty scripts just works, also ns*
stuff
amazing