I have a weird bug with shadow-cljs: when I add the dependency to tools.deps.alpha, add-libs3 branch, the watch comand crashes.
how can there be dependency conflicts with deps.alpha ? deps.alpha always takes the newest version?
any idea how to resolve it?
the newest version may be the one breaking stuff
you'll need the version the closure compiler expects
no clue why you are putting tools.deps.alpha on the classpath for CLJS compilation though, probably best to keep it in a server-only alias
this is the dependency: org.clojure/tools.deps.alpha {:git/url "https://github.com/clojure/tools.deps.alpha.git" :sha "241cd24c35ba770aea4773ea161d45276e5d3a73"
And this the error:
[2021-06-05 01:46:51.392 - WARNING] :shadow.cljs.devtools.server.util/handle-ex - {:msg {:type :start-autobuild}} NoSuchMethodError 'java.util.stream.Collector com.google.common.collect.ImmutableList.toImmutableList()' com.google.javascript.jscomp.deps.DependencyInfo$Require.asSymbolList (DependencyInfo.java:60) com.google.javascript.jscomp.deps.DependencyInfo$Base.getRequiredSymbols (DependencyInfo.java:163) com.google.javascript.jscomp.Compiler.findModulesFromInput (Compiler.java:1954) com.google.javascript.jscomp.Compiler.findModulesFromEntryPoints (Compiler.java:1910) com.google.javascript.jscomp.Compiler.parseInputs (Compiler.java:1723) com.google.javascript.jscomp.Compiler.parseForCompilationInternal (Compiler.java:933) com.google.javascript.jscomp.Compiler.lambda$parseForCompilation$4 (Compiler.java:916) com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:127) com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:816) com.google.javascript.jscomp.Compiler.parseForCompilation (Compiler.java:914) com.google.javascript.jscomp.Compiler.compile (Compiler.java:667) jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (:-2)
my setup is completely the same.
just adding the dependency is enough
What's the proper way to use printf
formatting in Clojurescript? I see posts on the web suggesting using goog.string.format
but there are other posts discussing dead code elimination issues with that library. I have a minimal test app with
(ns stopwatch (:require [goog.string :as gs]))
(println (gs/format "Hello %s" "world"))
that works with shadow-cljs when building without optimizations. But if I use :simple
or :advanced
, I get a runtime failure because goog.string
is missing format
.dependency conflict on guava
@sameer864 add an extra [goog.string.format]
to your :require
then it'll work. it lives in its own file/namespace so just importing goog.string
is not enough
(for dev builds likely some other devtool requires it, so it works accidentally. for release builds that devtool is unused and so the require is missing)
@thheller, thanks. That worked. Is this an issue specific to goog.string/format
or will I run into this with other APIs when I create release builds? I though the build system would automatically include all the transitive dependencies of the functions I refer to.
not the functions you refer to. the namespaces you require. goog.string.format
just happens to be this special case that it is a separate namespace, not part of goog.string
.
its a weird case, that is rather uncommon
Somebody solved this npm package w/shadow-cljs? https://www.npmjs.com/package/react-dates, I require as
["react-dates/initialize" :as init]
["react-dates" :as rd :refer [DateRangePicker SingleDatePicker DayPickerRangeController]]
I tried with `
(def DateRangePickerX
(r/adapt-react-class DateRangePicker))
or [:> DateRangePicker..
but not really work..any idea what.. I did in wrong way?
Clear example: https://github.com/majapw/react-dates-demo/blob/master/src/App.js
@sb and what is the error?
simply no error..
nothing happens.. when I click on the fields..
probably because you are missing the css?
at least looks like that?
without css.. I didnāt add, I just check the functionality
yes, without css
don't know what it does but it might happen outside the visual area because of the missing css
ok, Iām going to add it, thanks!
I donāt thinkā¦
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
that is the css
https://unpkg.com/browse/react-dates@21.8.0/lib/css/_datepicker.css
that is the css?
Sorry, true!
I need to setup a demo project for this.. because without this I canāt debug.. š
probably a better question for #reagent the shadow-cljs parts seem to work fine