This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-26
Channels
- # announcements (2)
- # babashka (9)
- # beginners (95)
- # calva (4)
- # circleci (2)
- # clj-kondo (5)
- # clojure (57)
- # clojure-berlin (2)
- # clojure-conj (3)
- # clojure-europe (6)
- # clojure-italy (14)
- # clojure-nl (3)
- # clojure-switzerland (5)
- # clojure-uk (32)
- # clojuredesign-podcast (5)
- # clojurescript (29)
- # clojutre (16)
- # code-reviews (6)
- # data-science (6)
- # datomic (9)
- # fulcro (33)
- # graalvm (2)
- # jobs (1)
- # jvm (1)
- # kaocha (6)
- # leiningen (4)
- # off-topic (3)
- # re-frame (31)
- # reagent (16)
- # reitit (22)
- # remote-jobs (2)
- # shadow-cljs (70)
- # spacemacs (19)
- # sql (9)
- # tools-deps (13)
- # xtdb (2)
- # yada (3)
Would it make sense to add a top-level config, something like :ignore-warnings-in-ns #{ns.*}
instead of adding the :ignore
in :warnings-as-errors
? We also have a dep that causes warnings and we can't really do anything about them, so I'd prefer just to ignore those warnings altogether and then let all other warnings throw errors.
I was thinking about adding something like :defaults {:compiler-options ...}
at the top level. so config that applies to all builds
given the popularity of react-bootstrap
, i'm hoping someone can help. when i require react-bootstrap
:
(ns myproject.core
(:require ["react-bootstrap" :as bs]))
i get the following runtime exception:
TypeError: (0 , _uncontrollable.default) is not a function
i think last time i asked about this error regarding another npm module, the cause had to do with a transitive dependency conflict?Hi everyone, still relatively new to cljs and shadow but I just wanted to confirm something, given this code:
(ns demo.foo)
(defn hello [who]
(str "Hello, " who "!"))
(defn generate-exports []
#js {:hello hello})
and this config
:builds
{:lib {:target :node-library
:output-to "package/lib.js"
:exports-fn demo.foo/generate-exports}}
and this command: shadow-cljs release lib
Iām getting a ālib.jsā size of 98k. Does that seem right?got it. and i think last time you said there's no easy solution, as juggling multiple versions on the NPM side is crazytalk
@miguelb that's pretty small all things considered, and way smaller when automatically gzipped by the server/browser.
@miguelb yes. there isn't much use in checking the size of dummy code since most of it is cljs.core
and stuff
ah ok, Iām starting to evaluate writing libraries in cljs for use at work so I wanted to see how much overhead I would be bringing along
@thheller i think last time you did some digging on my behalf. any advice for identifying the conflict myself?
@miguelb IMO writing libs in CLJS for JS is not tenable right now, exactly because most of the time you donāt want the overhead of CLJS core data structures and standard library in your library code
though none of the libraries I was thinking about doing have any browser specific in them.
@joshkh even for Node.js I would ask: why? writing libraries in CLJS is not itās forte
Iām often far more tempted to write libs in JS and a small wrapper in CLJS, than the other way around
CLJS and itās standard library and data structures really only shine in application development
thanks for sharing, and i do agree that writing one-off cljs libs for any js based project is not ideal.
itās tough when you want to transition to using Clojure but your app is written in JS already
that being said i've had success replacing large portions of js based projects with self contained cljs projects, but they were full apps with their own api, and ended up being the same file size in the end.
@lilactown thatās exactly the situation iām in
@lilactown I disagree. you can write libraries pretty well in CLJS. just not those typical micro libraries with one function in them. writing something bigger that would bring in something like immutable-js+lodash etc in JS wouldn't be much different.
yeah I wouldnāt adopt a library that brought in immutable.js or (probably) lodash either. IMO those are app-level abstractions that arenāt really useful in a library
itās the same as a library including core.async. Donāt do that to me! Iāll use core.async in my app and bridge the gap if I need your lib, or maybe install a peer lib that provides that interop
I can totally see big libs using immutable-js or so internally. like a database implementation or something like apollo
stuff that exposes a "normal" API and just does a lot of stuff behind the scenes but doesn't actually expose immutable-js to the outside
something like immutable-js (or CLJSā data) is likely to be too general purpose for a lot of cases too
depends on what you are changing from. if you have to go back and forth all the time it probably isn't worth it
@joshkh if you wouldn't mind asking that question again somewhere others can find it too (http://ask.clojure.org, stackoverflow or so)
great idea, and thanks @thheller. i was already finding it frustrating not being able to find my previous question on slack.
for when (if ever) you find the time, thanks again @thheller https://ask.clojure.org/index.php/8665/compiling-shadow-projects-transitive-dependency-conflicts
/js/cljs-runtime/shadow.js.js:36 shadow-cljs - failed to load module$node_modules$$emotion$core$dist$core_browser_cjs
shadow.js.jsRequire @ /js/cljs-runtime/shadow.js.js:36
shadow$provide.module$node_modules$react_select$dist$react_select_browser_cjs @ /js/cljs-runtime/module$node_modules$react_select$dist$react_select_browser_cjs.js:3
shadow.js.jsRequire @ /js/cljs-runtime/shadow.js.js:34
shadow.js.require @ /js/cljs-runtime/shadow.js.js:55
eval @ /js/cljs-runtime/doublethedonation.integrations.records.js:9
goog.globalEval @ mp360.js?updated=20190805:827
env.evalLoad @ mp360.js?updated=20190805:2174
(anonymous) @ mp360.js?updated=20190805:2633
/js/cljs-runtime/shadow.js.js:36 shadow-cljs - failed to load module$node_modules$react_select$dist$react_select_browser_cjs
might be the same problem I just described here https://ask.clojure.org/index.php/8665/compiling-shadow-projects-transitive-dependency-conflicts?show=8666#a8666