This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-12
Channels
- # aleph (6)
- # announcements (11)
- # babashka (24)
- # beginners (127)
- # calva (33)
- # chlorine-clover (5)
- # cider (7)
- # clara (9)
- # cljs-dev (54)
- # cljsrn (5)
- # clojure (61)
- # clojure-australia (8)
- # clojure-bay-area (11)
- # clojure-europe (36)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-spec (6)
- # clojure-taiwan (1)
- # clojure-uk (8)
- # clojurescript (94)
- # code-reviews (2)
- # community-development (6)
- # conjure (26)
- # core-typed (1)
- # cursive (3)
- # datahike (4)
- # datomic (14)
- # events (1)
- # graphql (1)
- # honeysql (49)
- # introduce-yourself (5)
- # jobs-discuss (15)
- # kaocha (6)
- # lsp (8)
- # malli (1)
- # meander (5)
- # nrepl (1)
- # off-topic (21)
- # other-languages (1)
- # pathom (13)
- # podcasts-discuss (1)
- # polylith (1)
- # reitit (16)
- # shadow-cljs (50)
- # spacemacs (11)
- # sql (11)
- # tools-deps (21)
- # unrepl (1)
- # vim (9)
Can I run build-report at the same time a dev build watch is running, or should I stop the dev build watch first?
And another question: is it expected that the function names in stack traces are less helpful than they maybe could be?
Hi! I was trying to set
:module-loader :no-inject
Based on code https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/build/targets/browser.clj should be ok:
;; true to inject the loader data (which changes the signature)
;; any other true-ish value still generates the module-loader.edn data files
;; but does not inject (ie. change the signature)
(true? module-loader)
(inject-loader-setup-release config)
But spec for module loader forces bolean (s/def ::module-loader boolean?)
What is missing in my setup to avoid inclusion of module loader in js?@robert.pofuk thats a boolean only, so just :module-loader false
? what are you trying to achieve? that comment refers to old code that doesn't exist anymore
I have multiple we applications, all of them are build with shadow-cljs, clojurescript, react material ui. I would like to share some code between them. Because I would like to avoid re-building all of them every time shared peace of code changes i wanted to modularize them. App 1:
MODULES:
:main {:entries [:react, :material-ui]}
:feature-1 {:entries [alpha/feature-1]}
App 2:
MODULES:
:main {:entries [:react, :material-ui]}
:feature-2 {:entries [alpha/feature-2]}
App 3:
MODULES:
:main {:entries [:react, :material-ui]}
:feature-3 {:entries [alpha/feature-3]}
Then I would be able to load javascript produced from :feature-1 and :feature-2 modules into APP3 .
All of them are compiled using :simple optimization and are forcing for all shared deps to be in main module.
My assumption here was that I will be able to override loadig of modules and put in :feature-1 and :feature-2 modules inside
var shadow$modules = {"uris":{"main":[],
"feature-1":[""]},
"feature-2":[""]},
"infos":{"main":null,"feature-3":["main"]}};
All of them are compiled using :simple optimization
and then initialize the loader via shadow.loader/init
yourself. you can change the shadow$modules
however you want before that
I know it is big 4x in my example. But sharing modules between apps would be amazing. I could have multiple teams in parallel developing without having 1 project as bottleneck. Also I could use this feature as feature toggle, rewrite module from scratch and so on... And javascript it self makes it easy to load code on demand and then it would be cool to utilize this in clojurescript. I only did small comparison and 2 different apps create same output of same code in module.
if you just want to move out the JS dependencies and share those you can do so by using :js-provider :external
Thank you for help! I will try to figure out if it is worth the risk and load the modules on my own or find a way how to compile things together.
I have a macro that looks like this
(defmacro reg-event-assoc-in [name seq-of-kw]
`(re-frame/reg-event-db
~name
(fn [db# [_ value#]]
(assoc-in db# ~seq-of-kw value#))))
(utils-events/reg-event-assoc-in ::accounts-dropdown-selected-option
[:accounts-dropdown :the-selected-option])
shadow-cljs keeps throwing this error:
4 | (utils-events/reg-event-assoc-in ::enable-new-project-modal?
-------^------------------------------------------------------------------------
Syntax error macroexpanding cljs.core/fn.
Call to cljs.core/fn did not conform to spec.
-- Spec failed --------------------
((clojure.core/apply
clojure.core/vector
(clojure.core/seq
(clojure.core/concat
(clojure.core/list 'quagga.utils.events/db__31345__auto__)
(clojure.core/list
(clojure.core/apply
clojure.core/vector
(clojure.core/seq
(clojure.core/concat
(clojure.core/list 'quagga.utils.events/_)
(clojure.core/list
'quagga.utils.events/value__31346__auto__)))))))) ...)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
should satisfy
vector?
or value
((clojure.core/apply ... ...) ...)
^^^^^^^^^^^^^^^^^^
should satisfy
vector?
-- Relevant specs -------
:shadow.cljs.devtools.cljs-specs/param-list:
(clojure.spec.alpha/and
clojure.core/vector?
(clojure.spec.alpha/cat
:params
(clojure.spec.alpha/* :shadow.cljs.devtools.cljs-specs/binding-form)
:var-params
(clojure.spec.alpha/?
(clojure.spec.alpha/cat
:ampersand
#{'&}
:var-form
:shadow.cljs.devtools.cljs-specs/binding-form))))
:shadow.cljs.devtools.cljs-specs/params+body:
(clojure.spec.alpha/cat
:params
:shadow.cljs.devtools.cljs-specs/param-list
:body
(clojure.spec.alpha/alt
:prepost+body
(clojure.spec.alpha/cat
:prepost
clojure.core/map?
:body
(clojure.spec.alpha/+ clojure.core/any?))
:body
(clojure.spec.alpha/* clojure.core/any?)))
(defn reg-event-assoc-in [name seq-of-kw]
(re-frame/reg-event-db name
(fn [db [_ value]]
(assoc-in db seq-of-kw value))))
you can't silence the spec checks since they are telling you that your code is incorrect and won't compile
I have a beginner question this time. I suspect the answer might not be shadow-cljs related, but I am not sure yet. Basically, I have two different problems related to testing, and I would like to solve them both at once. I am using a :node-test target to compile puppeteer tests that I run manually. The problem is that sometimes I only want to run a single test, but the only way to easily configure this so far was through the :ns-regexp config. Is there a conventional solution to this problem? I can imagine writing an ad-hoc solution that takes CLI arguments and calls the tests or not based on that, but I am always wary of reinventing the wheel. And the second problem is that similarly through CLI arguments, I would like to feed different data to the same tests. Anyone here has some suggestions for some tooling, any kind of tooling, that would make both these problems easier to solve? Or should I just give in and code it up myself?