This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-28
Channels
- # aleph (1)
- # announcements (16)
- # bangalore-clj (1)
- # beginners (78)
- # cider (109)
- # clara (3)
- # cljdoc (6)
- # cljsjs (3)
- # clojure (209)
- # clojure-dev (11)
- # clojure-europe (1)
- # clojure-france (9)
- # clojure-italy (13)
- # clojure-nl (3)
- # clojure-spain (2)
- # clojure-spec (19)
- # clojure-uk (50)
- # clojurescript (41)
- # clojutre (2)
- # core-async (45)
- # cursive (2)
- # datomic (14)
- # emacs (6)
- # figwheel-main (1)
- # fulcro (101)
- # graalvm (1)
- # graphql (3)
- # jobs-discuss (3)
- # kaocha (12)
- # leiningen (8)
- # music (4)
- # off-topic (47)
- # parinfer (8)
- # pathom (17)
- # pedestal (53)
- # re-frame (47)
- # reagent (22)
- # reitit (4)
- # shadow-cljs (49)
- # tools-deps (87)
Is there a section on the tutorial on how shadow resolves, for instance, react subdependency for reagent?
I mean reagent itself depends on cljsjs/react, but as I understand, in the shadow-cljs’s context it’ll be used only for externs. It would be super cool to have a single place to see all deps that make their way into the release bundle. I know pom.xml, but AFAIK it only lists cljs part.
Not urgent, though
this will tell you exactly what is in your build https://shadow-cljs.github.io/docs/UsersGuide.html#_build_report
I can submit a card on github, if you would like to have it on the horizon
ah cool
thanks
Is there anyway to split up the release build process between what requires Node and what requires the JVM? I know the answer is most likely no, but I had to ask before spending a bunch of time making my own Docker image. Trying to get our new shadow-cljs project into our GitLab CI and I need to build the project in a Docker image. If I can split the steps I can just use the official images for Node and Java. If not I have to build my own in house Docker image that has both.
@kasuko not sure what you mean by "what requires Node"? or what the docker image has to do with this? there are plenty of images that have node+JVM available?
Unfortunately due to security policies at my company I can only use approved Docker images. We have a node and a jdk image approved and I was curious if it was possible to split up the build. So I could compile all the Clojurescript in a Docker image that just had JDK then package all the Javascript up in the image that has Node.
FROM node as node
RUN npm install
FROM clojure
COPY --from=node node_modules
RUN clj -A:cljs:build
RUN aws s3 put target/out.js s3://
just need the node_modules
folder and the package.json
so it doesn't try to install deps from deps.cljs
I'm trying to use some protobuf-generated JS in a shadow-cljs app. When I generate it with "commonjs" output format it works but needs unsafe-eval
in the Content-Security-Policy
header, which I'd rather avoid. But when I generate it with "commonjs_strict" output it doesn't work. Here's the diff (`---` is working but unsafe; +++
is safe but non-working): https://gist.github.com/cap10morgan/b9f283fa8035b8c0bc527b0911eed1fb
Anyone know if / how I can use the +++
version in a shadow-cljs app?
Can I do this in shadow-cljs? https://github.com/tomconnors/problems/blob/reagent-preact/project.clj#L40 Looks like this create a namespace for a npm dependency.
@cap10morgan I have a hard time deciphering that gist. can just just post the 2 separate variants not as a diff?
never done any protobuf stuff with generated code but there should be something easy that just works
@doglooksgood see https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve ie. :js-options {:resolve {"create-react-class" {:type :npm :require "preact-compat/lib/create-react-class"}}}
similar to this webpack aliasing https://github.com/developit/preact-compat#usage-with-webpack
https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve-npm even has preact as example 😉
@thheller Yeah, thanks. I'm trying out a slightly different approach. I'll post both files if it doesn't pan out.
@thheller OK, yeah, didn't work. Here are the 2 versions I'm trying now:
- working but not safe: https://gist.github.com/cap10morgan/7331bd6dedd6b6fb662e8bbe6f179632
- not working but safe(r) (uses ES6-style import statements but I get the error goog is not defined
when I run it): https://gist.github.com/cap10morgan/b1b0a0f151b02809b084a568c13ac2fc
I'm trying to use the library in CLJS with (:require ["path/to/js_file" :as game-lib])
in both cases.
@cap10morgan hmm does it have another output format for closure directly?
It does yeah, but that output is very different in that it's all separate files. I was trying to see if I could get it to work in one file first. But if the closure way is best, I'll bite the bullet. 🙂
OK I'll dig into that then. Thanks for the pointer!
just put the files on the classpath. ie. generate into src/gen
and :source-paths ["src/main" "src/gen"]
I like it
shadow-cljs - failed to load module$node_modules$preact_compat$dist$preact_compat What does this error mean? this file is exists.
@thheller Alas, one of the protobuf plugins we're using isn't compatible with closure-style JS. The best I can do is this CommonJS strict version (which I can't get working in shadow-cljs): https://gist.github.com/cap10morgan/2d29db3e9a3f8326dde71a56a21c6d7d
Oh, I think I figured it out. Pretty simple in the end. Because it's extending exports
with proto
, I can just refer to game-lib/game.Thingy
in my CLJS code.