This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-13
Channels
- # aleph (1)
- # beginners (105)
- # boot (6)
- # cider (9)
- # cljs-dev (61)
- # cljsrn (59)
- # clojure (132)
- # clojure-germany (1)
- # clojure-italy (6)
- # clojure-russia (18)
- # clojure-spec (1)
- # clojure-uk (58)
- # clojurescript (56)
- # core-async (1)
- # cursive (17)
- # datomic (20)
- # docs (1)
- # duct (5)
- # editors (1)
- # emacs (7)
- # events (2)
- # figwheel (7)
- # fulcro (30)
- # graphql (8)
- # jobs (3)
- # leiningen (23)
- # luminus (14)
- # mount (6)
- # off-topic (41)
- # onyx (14)
- # protorepl (2)
- # re-frame (7)
- # reagent (32)
- # shadow-cljs (236)
- # tools-deps (92)
- # unrepl (8)
- # vim (60)
- # yada (1)
Not for :target :nodejs
they don't.
Well, it does.
However it still needs to be shipped with node_modules
.
I probably am.
lots of stuff in node_modules
can’t pass through Google Closure advanced optimizations
is what you’re describing really something that Node.js users do - definitely wasn’t my impression
That's fair. It should still be possible to bundle them into a single file without doing advanced optimizations though, right?
Eh, it might not be. My particular usecase is a little strange.
I just don't like the idea of shipping node_modules
with a ton of unused dependencies.
Yeah, it's definitely a niche use case. I'm experimenting with running webpack on the output, and it seems to be working fine so far.
@ghopper I would guess that there are tools in the npm world that do this? should be usable with CLJS once you have an optimized build?
@thheller That's what I'm looking into now. I was hoping to avoid dipping into that world. I'm looking into webpack or browserify now.
I think they'll do what I want. (Analyze the optimized build for require()
statements and pull from node_modules
into a bundle.)
This should avoid shipping excessive node_modules
with each separate build.
https://github.com/nexe/nexe comes to mind
I thought that was more about shipping a binary that didn't require node. I don't mind shipping a shebang node script. I just don't want node_modules
to have to be shipped with it.
Well, in this case I'm sending a single bundle.js
file to AWS Lambda. Though I'm also thinking of the usecase of scripts to be run from the command line.
@ghopper can you keep me posted, was trying to do the same some time ago
scripts is also the use case I am looking at now
I'm not sure about that. I could certainly ship the whole node_modules
folder if I wanted.
I want to have everything centralized in :npm-deps
and let cljs handle it.
if we had a clj solution that for sure would be better. Lumo already has a lot of util functions that scan node_modules
.
actually JVM as well
@dnolen I can't think of anything critical. Out of all of the various Windows fixes, all of them were defects in the testing code apart from https://dev.clojure.org/jira/browse/CLJS-2721 which you applied.
@mfikes ok I have 3 things in critical for next release, but maybe I will only handle the spec fn arity limit one
the two others will probably end up being part of bigger push to clean up how modules are handled
Ahh. Perhaps related to that https://dev.clojure.org/jira/browse/CLJS-2732
this might be a bit tricky so that’s why it might be the only other thing I do for next release
✅ Windows CI is green again https://ci.appveyor.com/project/mfikes/clojurescript/history And it is actually checking its test results for success / fail.
You mentioned interest in the websocket stuff for next release. I haven't had a chance to work on it since last we spoke but I'll be hacking on it this weekend. Not sure if I'll have things ready by next release but if you want a WIP patch submitted just let me know.
@richiardiandrea browserify --node --standalone index index.js | uglifyjs -o bundle.js
works great. It pulls the needed dependencies from node_modules
and bundles them into a single output file.
so I assume your cljs compiler output is index.js
?
it works!
Yeah, sorry, I could've made that more clear. I output with :optimizations :advanced
, then I run it through browserify and uglify.
Right, so it is for a script I don't need advanced for now...it basically here and https://github.com/paullucas/les-clj/blob/master/scripts/build
Probably I am missing the she-bang node and at the moment the script is not working
Seems like an easy fix so thanks a lot!
I wonder if I could achieve the same thing with rollup
I briefely looked into rollup, but I didn't get very far. Let me know how it goes if you try it.
It seems it supports es6 only, don't want to go down the rabbit hole for now
I got a weird error today:
Caused by: clojure.lang.ExceptionInfo: No such namespace: fs, could not locate fs.cljs, fs.cljc, or JavaScript source providing "fs" in file /home/arichiardi/git/les-clj/src/les/core.cljc {:tag :cljs/analysis-error}