This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-12
Channels
- # aleph (8)
- # announcements (9)
- # babashka (15)
- # beginners (91)
- # calva (54)
- # chlorine-clover (3)
- # cider (25)
- # clj-kondo (9)
- # cljfx (4)
- # cljsrn (12)
- # clojure (40)
- # clojure-australia (2)
- # clojure-europe (77)
- # clojure-nl (10)
- # clojure-spec (22)
- # clojure-uk (9)
- # clojurescript (39)
- # conjure (12)
- # cursive (8)
- # datascript (17)
- # datomic (22)
- # emacs (2)
- # expound (6)
- # fulcro (25)
- # kaocha (7)
- # malli (9)
- # meander (5)
- # off-topic (13)
- # pathom (8)
- # pedestal (5)
- # portal (1)
- # rdf (58)
- # re-frame (65)
- # reagent (15)
- # sci (3)
- # shadow-cljs (50)
- # test-check (6)
- # testing (3)
- # tools-deps (1)
- # vim (7)
- # xtdb (10)
Has anyone used apollo client with shadow-cljs? Or does lack of webpack prevent that from working.
Are there really libs that actually do? I've seen some libs that claim to require webpack (by mentioning it as part of their install) but none of these actually did. Actually depending on it sounds like terrible design...
Anyone using dynamic loading (shadow.loader) with or without shadow.lazy?
I have a module with an init-fn that fn loads a module dynamically, but im having issues calling things from the loaded module
:module-loader true
:modules {:base {:entries [app.debug app.auth]}
:common {:entries [app.index]
:depends-on #{:base}}
:app {:init-fn app.main/init!
:depends-on #{:common}}
:cloud {:entries [app.main.cloud]
:depends-on #{:app}}}
that could very well be a typo
I was tired lastngiht
I had that module as an init-fn as well as a test
when using it as an init-fn it loaded - but I got a whole bunch of errors that things were already declared
;; app/main.cljs
(defn init! []
(loader/with-module :cloud
(fn []
(let [cloud (resolve 'app.main.cloud/dashboard)]
(cloud)))))
failed to load clojure.set.js Error: Namespace "clojure.set" already declared.
also just use shadow.lazy. much better API and doesn't involve dealing with resolve
issues
Ideally I want to use shadow.lazy but It couldnt find the modules
when I give it the symbol the compiler throws an error about not finding the app.main.cloud module
to the loadable
(def components
(lazy/loadable {:cloud app.main.cloud/dashboard)})
(defn init! []
(-> (lazy/load components)
(.then
(fn [{:keys [cloud]}]
(cloud)))))
So the block above does work, but I still get the same console errors
ill check the manifest again
also note that if you are loading the module directly on init it would be better to have your HTML load it immediately instead
base.js:2226 failed to load goog.dom.inputtype.js Error: Namespace "goog.dom.InputType" already declared.
is the depends-on correct? should the dynamic modules “depend” on the main loader module, or the other way around?
this seems to be thrown by the dynamic module
ok so i reduced the number of them by removing the module from the index file
<html>
<body>
<script src="./client/base.js"></script>
<script src="./client/common.js"></script>
<script src="./client/app.js"></script>
</body>
</html>
thats the index file
I had the cloud.js in there
so im still getting some of them
I don't like that you have ./client
as the path. much more predictable if you use absolute paths with the proper absolute :asset-path
as well
yeah thats an issue with the kubernetes ingress
ok good to know im at least kinda understanding this 😅
doing it with the lazy block as above seems to be working now, could very well have been a typo causing the issue with it last night