This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-10
Channels
- # aleph (1)
- # beginners (39)
- # boot (14)
- # cider (2)
- # clara (6)
- # cljs-dev (39)
- # cljsrn (2)
- # clojure (276)
- # clojure-italy (1)
- # clojure-russia (22)
- # clojure-sg (2)
- # clojure-spec (7)
- # clojure-uk (9)
- # clojurescript (47)
- # core-async (1)
- # cursive (5)
- # emacs (1)
- # events (3)
- # leiningen (1)
- # luminus (2)
- # lumo (75)
- # om (14)
- # onyx (1)
- # parinfer (11)
- # pedestal (1)
- # ring-swagger (2)
- # spacemacs (4)
- # untangled (5)
- # yada (29)
It's been a very long time since I've had to deploy cljs and I'm (rather oddly) having trouble getting all the js to compile to one file, i.e. without needing a dependency on goog. The project.clj is from a figwheel template, but I'm using cljsbuild
and have :optimizations
set to :advanced
so not sure what's going wrong. Any ideas?
Hi #clojurescript do you have examples of distributing a clojurescript library as a regular javascript library?
only ones I know of are https://github.com/swannodette/mori and https://github.com/tonsky/datascript
it isn’t very practical to publish libraries like that since they all include cljs.core
by themselves and cannot share it
But there's no better way, right? Since cljs use the closure goog.require
, it'll break with other packaging/import system?
closure wants to optimize your whole program, which includes all the libraries you use
@roman01la then that’s contradictory to what you said earlier
hi, does anyone has an idea on how to import a scoped npm package in clojurescript? I tried something like "{:npm-deps {:@dp/whatever "2.0.10"..." but failed with the message "java.lang.RuntimeException: Invalid token: :"
And it fails even when I use something like "(keyword "@dp/whatever") "2.0.10"..."
@chrisdavies @metametadata @shaunlebron I use ‘humane-test-output‘ for prettifying my test output, works well
@curlyfry I wasn't able to get it to play nice with cljs.test, but I must have been configuring it improperly.
Do you have a sample project.clj
where you've configured it?
@chrisdavies Could this be the problem? https://github.com/pjstadig/humane-test-output/issues/15 Solution in the issue!
That helped! Thanks. It wasn't exactly right, but it got me the rest of the way. :thumbsup:
FYI, I posted this on StackOverflow for posterity: https://stackoverflow.com/questions/44475774/humane-test-output-doesnt-seem-to-work-with-clojurescripts-lein-doo-command/44475792#44475792
(Oh, and thanks! :)
@thheller Could shadow cljs rewrite something like new cljs.core.Keyword(...)
to cljs.core.keyword_intern
?
@thheller Yeah, but if I create one at runtime with the same name I have two keyword instances. I can't get the global constant in any way.
@rauh whats the state of weak refs in JS engines? maybe we can default to interning at some point
looks decent enough http://kangax.github.io/compat-table/es6/#test-WeakMap (if accurate)
Still no-go, even with the Weak Sets/Maps. I'd like an option in cljs but it'd def be big undertaking. For browser JS I don't need any weak refs since there is no attack vector. Only really needed for server side JS.
all it would take is a simple change in the compiler to not emit new cljs.core.Keyword
but actually calling the keyword
fn
Yeah, I could also hack the deftype and replace it with real constructor. But it's too hacky.
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/compiler.cljc#L268