clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
oly 2020-09-11T13:02:30.444300Z

Anyone used :npm-deps ? trying to use three.js but it does not appear to work for me

oly 2020-09-11T13:03:08.445200Z

{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
        org.clojure/clojurescript {:mvn/version "1.10.773"}
        rum {:mvn/version "0.12.3"}
        cljsjs/three {:mvn/version "0.1.01-1"}
        doughamil/threeagent {:mvn/version "0.0.6"}
        com.bhauman/figwheel-main {:mvn/version "0.2.11"}
        }
 :npm-deps {:three "0.120.1"}}
I thought all i needed todo was add :npm-deps to my deps.edn but the details on this are a bit sparse 😕

alexmiller 2020-09-11T13:22:00.445600Z

that doesn't go in deps.edn

alexmiller 2020-09-11T13:23:33.446Z

I think that goes in the build.edn file? https://clojurescript.org/guides/webpack

oly 2020-09-11T13:25:53.447300Z

I will try that, never created a build.edn file before usually create figwheel-main.edn dev.cljs.edn and deps.edn for a project will look into it and see if that works

oly 2020-09-11T13:28:04.448300Z

build.edn looks very similar to my dev.cljs.edn file I noticed does one have precedent over the other or is it one or the other

dnolen 2020-09-11T13:28:39.449Z

@oliver.marks you have Three as a dep in your deps.edn, you don't shouldn't need :npm-deps if you have that already

oly 2020-09-11T13:33:10.450500Z

That was my first stab, it all stems from doughamil/threeagent which fails because three.js does not exists it has suggestions for lein and shadow-clj https://github.com/DougHamil/threeagent but as I am using neither I am looking for a way to make it available

oly 2020-09-11T13:35:04.452200Z

been using native clojurescripts libraries and I have noticed a tendency for others to use shadow-clj when it comes to npm

Oliver George 2020-09-11T23:05:58.453100Z

Hi Guys

Oliver George 2020-09-11T23:06:07.453400Z

Looking for some :target :bundle help

Oliver George 2020-09-11T23:06:15.453800Z

% webpack --progress resources/public/js/index.js -o resources/public/js/app.js
92% chunk asset optimization TerserPlugin

Oliver George 2020-09-11T23:06:28.454200Z

Takes about 10 mins on my laptop!

Oliver George 2020-09-11T23:07:03.455Z

If I use the TerserPlugin and set compress: false it improves to a few seconds.

Oliver George 2020-09-11T23:07:30.455600Z

Presumably caused by chewing on the advanced build output.

Oliver George 2020-09-11T23:07:53.456200Z

Are there recommended webpack settings to avoid pointless "compress the compressed file" slowness?

Oliver George 2020-09-11T23:08:01.456500Z

(or I might be guessing at the wrong cause)

Oliver George 2020-09-11T23:10:18.457200Z

I'll stick my https://gist.github.com/olivergeorge/aa3b7dd8d8826b595bcca293cac6c3bc in a gist.