This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-22
Channels
- # asami (31)
- # babashka (1)
- # beginners (29)
- # biff (32)
- # cider (6)
- # clojure (29)
- # clojure-europe (7)
- # clojurescript (16)
- # community-development (18)
- # core-typed (11)
- # emacs (8)
- # hyperfiddle (10)
- # lsp (26)
- # nbb (8)
- # off-topic (17)
- # other-languages (1)
- # pedestal (2)
- # reitit (6)
- # releases (1)
- # sci (2)
- # shadow-cljs (19)
Would it be possible to integrate something like webpack's style-loader
into shadow-cljs or am I better served with using something like Garden? I ask because I'm dealing with a pesky React component that unfortunately wants to be passed an embedded stylesheet.
For now my best guess would be to define a macro that simply slurps an external CSS file and I mimic the import "stylesheet.css"
syntax by naming my macro something like import-css
there is no built-in support for this. and it is not possible to use style-loader directly, other than actually using webpack
Makes sense. For now I'm just going to stick with my macro idea. Hopefully React components dont mind being fed a gigantic CSS string ๐
Oh yeah, React isn't happy with my provided styles being strings. Looks like I have to figure out something different... In any case, thanks for the help
Hi, i am trying to run shadow-cljs via deps.edn 1. it means i dont have it install via npm, right? 2. i am getting this error when cider-jack-in-cljs
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: ------------------------------------------------------------------------------
WARNING: shadow-cljs not installed in project.
See
------------------------------------------------------------------------------
shadow-cljs - config: /Users/akiz/Code/Clojure/hh/shadow-cljs.edn
shadow-cljs - starting via "clojure"
--- SHADOW-CLJS FAILED TO LOAD! ----------------------
I made sure that i have got the exact version of dependencies from here: https://clojars.org/thheller/shadow-cljs This is the cause:
Caused by: java.lang.NoClassDefFoundError: com/google/common/collect/Streams
at com.google.javascript.jscomp.deps.ModuleLoader.createRootPaths(ModuleLoader.java:259)
at com.google.javascript.jscomp.deps.ModuleLoader.<init>(ModuleLoader.java:154)
at com.google.javascript.jscomp.deps.ModuleLoader$Builder.build(ModuleLoader.java:146)
at com.google.javascript.jscomp.deps.ModuleLoader.<clinit>(ModuleLoader.java:414)
at com.google.javascript.jscomp.DiagnosticGroups.<clinit>(DiagnosticGroups.java:178)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:167)
at clojure.lang.Compiler$StaticMethodExpr.eval(Compiler.java:1743)
... 211 more
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Streams
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 222 more
I solved it by adding
com.google.guava/guava {:mvn/version "31.1-jre"}
to deps.edn
Seconded. I've used shadow-cljs with leiningen in the past, but it was mostly to integrate existing projects tied together with lein-parent or lein-monolith. For standalone CLJS projects, using the NPM package saves you from tons of pain. There's absolutely no need for deps.edn or leiningen unless it's to integrate with an existing project of yours imo
that is not the reason to install the npm package and is not related to deps.edn or lein at all
the reason is just that the npm shadow-cljs package also brings in some other relavant npm packages you may need when using shadow-cljs builds
otherwise using shadow-cljs.edn to manage cljs dependencies, or deps.edn/project.clj doesn't really matter. other than sometimes having manual dependency conflicts
Thanks. I canโt remember why I chose deps.edn this time. Does it have any advantage over using npm (except that I manage dependencies in one file)?
it is absolutely fine to use deps.edn. the only difference is that you need to take care of dependency conflicts yourself. with shadow-cljs.edn the shadow-cljs tool can prevent some conflicts, so that is the advantage
but again this has absolutely nothing to do with the npm installed shadow-cljs package. that is a separate tool that I made the unfortunate choice to give it the same name