This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-04
Channels
- # announcements (5)
- # beginners (124)
- # boot (43)
- # braveandtrue (8)
- # calva (1)
- # cider (44)
- # cljs-dev (1)
- # clojure (188)
- # clojure-canada (3)
- # clojure-germany (1)
- # clojure-italy (5)
- # clojure-nl (13)
- # clojure-russia (1)
- # clojure-spec (14)
- # clojure-uk (42)
- # clojurescript (94)
- # core-async (5)
- # cursive (5)
- # datomic (45)
- # duct (3)
- # emacs (6)
- # figwheel-main (93)
- # fulcro (22)
- # graphql (3)
- # hyperfiddle (1)
- # leiningen (3)
- # off-topic (1)
- # pedestal (1)
- # play-clj (1)
- # portkey (1)
- # re-frame (17)
- # reagent (71)
- # remote-jobs (2)
- # rum (3)
- # shadow-cljs (45)
- # spacemacs (17)
- # specter (18)
- # tools-deps (27)
- # unrepl (1)
- # vim (3)
can a shadow-cljs project produce a jar file without js dependencies? What I want to do is from one project, I want to produce a NPM package for js projects and cljs jar package for cljs projects.
For cljs projects to fill out the js dependencies, I was thinking I could use the webpack method that described here https://clojurescript.org/guides/webpack
shadow-cljs doesn’t currently have a way of creating a jar AFAIK. I usually use a very minimal project.clj and use leiningen to create a jar + publish it
@ghiden CLJS packages are just uncompiled .clj(s|c)
files. you never ship compiled CLJS code to other CLJS users. so any method of producing/publishing a jar file it valid you do not need shadow-cljs for that, although it will likely get support for it at some point.
i guess the last piece that i need to figure out is whether cljs projects can use webpack to load the npm dependencies required by the published package
I have a node module that I’ve installed into an existing clj/cljs project that uses lein. I’m having some issues getting things to compile, would shadow-cljs be helpful for my scenario? I already have an existing build system, so I don’t want to replace that but if they could live in harmony together that would be ideal 🙂
not sure I understand the question. shadow-cljs is a build tool so you are going to replace your existing build system if you use it. it is however fine to use it from lein
.
right now Im trying to follow the https://clojurescript.org/guides/webpack guide, and things aren’t working out for me
but with shadow-cljs
you just npm install the-thing
and (:require ["the-thing" :as x])
the only reason I think I was pointed to the webpack guide is because I’m using webpack to build my React component, but I don’t think those things should be related
got it, so understand how things work in isolation before trying to integrate it into my existing stuff
might be best to start with https://github.com/shadow-cljs/quickstart-browser
FWIW you might be able to skip the publish to npm part completely and just consume the code directly via https://shadow-cljs.github.io/docs/UsersGuide.html#classpath-js
example for that is here https://github.com/shadow-cljs/examples/tree/master/babel
much better perf out-of-the-box and supports optional byte[]
responses, than enable NIO in some servers
I started shadow-cljs fresh this morning and was receiving this message:
------ ERROR -------------------------------------------------------------------
09:29:53 cljs | File: /home/kenny/compute_software/ui-frontend/src/compute/ui_frontend/components/constructors.cljs
09:29:53 cljs | Exception: No namespace: compute.ui-frontend.components.constructors found
The constructors
ns follows the two ns pattern for exposing macros - there's a constructors.clj
and a constructors.cljs
. I had forgotten to remove a reader conditional from my constructors.clj
file which caused that error. Once I fixed it the error went away. If I add the misplaced reader conditional back in after the initial compile, I get a much better error:
09:30:43 cljs | [2018-09-04 09:30:43.832 - WARNING] :shadow.cljs.devtools.server.reload-macros/macro-reload-ex - {:ns-sym compute.ui-frontend.components.constructors}
09:30:43 cljs | CompilerException java.lang.RuntimeException: Conditional read not allowed, compiling:(compute/ui_frontend/components/constructors.clj:9:3)
I’m looking to use an Ant design library with my shadow app, would it be best to use the antd
react package from NPM or https://github.com/priornix/antizer which is a clojurescript lib
antizer looks nice. the only thing to note is that you might have some additional steps since it uses cljsjs
Thanks! I’ll try and go the antizer route since I know it already
I really don't recommend using wrappers like antizer. it'll pull in every single thing in antd. meaning your final JS grows by at least 1mb
Here’s a quick starter I put together using the wrapper, I will work on using it without next. Thanks!
hey everyone, curious if anyone else has run into issues using test.check/defspec
with the default :runner-ns shadow.test.browser
. the workaround is easy, i just wrote a custom runner that calls clojure.test/run-tests
in start
, but curious if im missing something or what other solutions may be out there