This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-10
Channels
- # aleph (4)
- # architecture (4)
- # aws (1)
- # beginners (64)
- # cider (26)
- # clara (9)
- # cljs-dev (45)
- # cljsrn (1)
- # clojars (8)
- # clojure (31)
- # clojure-finland (3)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-poland (9)
- # clojure-spec (1)
- # clojure-uk (81)
- # clojurescript (35)
- # core-async (1)
- # cursive (33)
- # datomic (29)
- # editors (4)
- # emacs (2)
- # fulcro (22)
- # jobs (4)
- # leiningen (2)
- # off-topic (20)
- # onyx (1)
- # portkey (17)
- # proton (2)
- # re-frame (20)
- # reagent (36)
- # remote-jobs (1)
- # ring-swagger (1)
- # rum (2)
- # shadow-cljs (179)
- # slack-help (1)
- # spacemacs (1)
- # test-check (20)
if i want to use my own CDN-provided version of react/react-dom/react-dom-server/create-react-class do I need to include a src/cljsjs/<all,those,files>
namespace?
in shadow-cljs you can configure this via :resolve
. see https://shadow-cljs.github.io/docs/UsersGuide.html#_using_a_cdn
that’s a nice feature. can I go in the other direction? can I build a bundle of all my node deps and :export them so another bundle can ref a globally exported js/namespace?
right now i’m hacking around this by building all my “npm dependencies” into a single lib.js file, then invoking a -main fn inside a single namespace which simply requires all those libs and exports them onto js/window
well you could (:require ["react" :as react])
and then (js/goog.exportSymbol "your.React" react)
which would make window.your.React
available when the file is loaded. wouldn't recommend doing that but it is possible.
@mattly how do you integrate those pure js components?
@lwhorton that's how things are done usually, yes
see this example project https://github.com/pesterhazy/double-bundle/tree/master/src/cljsjs
I think there were are changes related to this in reagent 0.8 so not sure if this is still true with that version
@mattly it might be this https://github.com/google/closure-compiler/issues/2822. are you using closure compiler version v20180204
?
@thheller I’m not sure which closure compiler I’m using, presumably the one that comes with clojurescript 1.10.238 lein-cljsbuild 1.1.7
you can manually add [com.google.javascript/closure-compiler-unshaded "v20180319"]
or [com.google.javascript/closure-compiler-unshaded "v20180402"]
. both have the fix.
just remember to take that out when you bump the cljs version the next time. otherwise you might get stuck on an incompatible version in the future.
not as long as you have the dependency in your project. that overrides whatever CLJS wants to bring in.
I tried changing (.-default react-json-view)
to (react-json-view)
and the cljs compiler has been running for seven minutes now
actually it’s just this version of the closure compiler …. after a lein clean
any advanced build will go for at least ten minutes before I give up and kill it
… and the problem persists even after removing the dependency on the new version of the closure compiler and blowing away ~/.m2/repository
it should work with the "double bundle" method, using webpack: https://github.com/pesterhazy/presumably/blob/master/posts/double-bundle.md
Source: I've used react-json-view with reagent before
Granted, it's not as elegant as using the new cljs requires feature