Fork me on GitHub
#clojurescript
<
2019-01-10
>
orestis09:01:06

Is it expected that adding cljs.spec.alpha (and using it) to increase the (optimized) code by roughly 60kb? shadow-cljs reports this:

cljs/core.cljs  174.24 KB
cljs/spec/alpha.cljs  35.84 KB
cljs/spec/gen/alpha.cljs  27.33 KB

orestis12:01:43

Seems I’m hitting https://dev.clojure.org/jira/browse/CLJS-1701 — please vote if this is important to you 🙂

dnolen13:01:00

@orestis we're aware of that one, but there's not an obvious way to tackle it - the main reason there's very little activity

dnolen13:01:08

issues like often require some brain storming & cleverness - anyone should feel welcome to investigate a plan for it

dnolen13:01:50

(note I would say we're not really concerned about the size of the spec stuff, if you include you need a lot of it)

dnolen13:01:29

only the part about not shaking out unused specs

dnolen13:01:41

multimethods have a similar problem but I'm skeptical that's solveable due to dynamism

dnolen13:01:57

honestly I think the same may apply to unused specs

dnolen13:01:02

(keyword ...) etc.

dnolen13:01:52

but we can leave that one open if someone gets a really great idea that hasn't been considered before

orestis13:01:59

Yeah, I guess anything with a global state would have this issue. I’m not dying but just was surprised this happened. Thanks for the feedback!

dnolen14:01:39

@orestis it's not global state that's the issue

dnolen14:01:59

namespaces etc. are global state - but references are used statically

dnolen14:01:07

you don't invoke fns as strings

dnolen14:01:26

but specs & multimethods use keywords, dynamic lookups

dnolen14:01:40

this is probably an argument BTW to keep specs separate from code, which is my preference

dnolen14:01:16

then loading specs is optional

dnolen14:01:23

and can be controlled

orestis14:01:26

Yeah, I can do that. I planned to have some validation done at runtime anyway, so the issue will become moot, it just caught me off guard.

orestis14:01:31

I’m using CLJS in anger recently, and the experience is very very nice. Many thanks for that 🙂

parrot 5
dnolen14:01:32

cool!!! 🙂

🙏 10
👏 10
orestis19:01:23

How are people doing translation of front-end stuff? I’d like to have something as easy to use as transifex, but it seems I’m on the hook for generating a gettext .pot file, or xliff file, then somehow integrate it back in my code. I’ve seen tempura as a potential library, anything else?

lilactown20:01:22

I have a library that is intended to be used with Node.js. It needs to read some static files at runtime that I would like to package with the library

lilactown20:01:07

is there a a reasonable way to distribute static files that can be read at runtime? analogous to io/resource?

lilactown20:01:30

essentially I want to be able to read a file from the classpath in Node.js

miles21:01:52

put the files in the same directory as your module js and then fs.readFileSync(__dirname + '/data.txt', {encoding:'utf-8'})

miles21:01:38

or path.resolve(__dirname, 'data.txt') just to get an absolute path to data.txt

jaide22:01:06

Hello again, so I got fighweel-main mostly working except that in a node app if I run bad code which causes an error from the repl it gets printed in the node process to stdout. Is there a way to opt out of that behavior? I don’t think lein-figwheel behaves that way.

jaide22:01:33

I keep seeing these kinds of log messages [goog.net.WebSocket] Opening the WebSocket on

chrisulloa22:01:30

that feel when you get advanced optimizations to work parrot

10