This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-18
Channels
- # aleph (1)
- # announcements (31)
- # babashka (9)
- # babashka-sci-dev (36)
- # beginners (72)
- # calva (20)
- # clj-kondo (99)
- # cljsrn (1)
- # clojure (77)
- # clojure-europe (33)
- # clojure-nl (4)
- # clojure-norway (12)
- # clojure-uk (4)
- # clojurescript (23)
- # cursive (2)
- # datascript (5)
- # events (1)
- # fulcro (3)
- # honeysql (3)
- # inf-clojure (82)
- # interop (2)
- # kaocha (10)
- # lsp (15)
- # meander (1)
- # missionary (10)
- # off-topic (22)
- # pathom (4)
- # pedestal (3)
- # polylith (20)
- # re-frame (10)
- # react (4)
- # reagent (4)
- # reitit (27)
- # ring-swagger (1)
- # shadow-cljs (34)
- # specter (3)
- # sql (1)
- # testing (5)
- # tools-deps (22)
- # vim (12)
Hrm not sure why but Firefox debugger is showing "this page has no source" with 2.17.8 which worked in 2.13.0
Also, a warning that wasn't there before:
[To redirect Truffle log output to a file use one of the following options:
* '--log.file=<path>' if the option is passed using a guest language launcher.
* '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
* Configure logging using the polyglot embedding API.]
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see .
Looks like it's reagent that requires it, no?
How does shadow-cljs decide which code goes in which module?
I have a situation where I have a main
module and several 'per-view' modules (let's say view-a
, view-b
, ...). All these modules, including main
import a specific ns (let's call it my-ns
), but only some of the modules actually use it.
Still, almost all the code from my-ns
ends up in main.js
. Is there a way to 'move' this code out of main
, so that it doesn't get loaded except in the views that use it?
I assume you have seen https://shadow-cljs.github.io/docs/UsersGuide.html#CodeSplitting ?
Yeah, that's what I'm using. My question is about how to move code from a 'base' module (`shared` in that example) into the modules that actually use it.
I guess maybe try to make more granular shared
modules but tbh I'm not sure. I tried code splitting and ran into weird bugs with React or something.
@U15RYEQPJ namespaces are moved as far to the other edges as possible. if many namespaces depend on a thing it'll be moved to the outermost common module
so if all modules just depend on main that is the only place it can go. you can introduce another empty module with just :entries []
and have the mods depends on that too. that gives it a chance to move more maybe
:advanced
can split but the code in namespaces but only if actually used in certain places. if 2 or more places use a thing it can't move
Yeah I noticed that part of the code from this is gets moved to where I want it to be.
If two modules that aren't main use the code, shouldn't it be possible to set up an 'intermediate' ns between those modules and main and have the code go there?
it can't introduce new modules so it can only stay in main. this is by design. you can achieve the exact splits you want via tuning :modules
@U05224H0W are you saying that if i introduce the appropriate 'intermediate' modules myself, the code would get pulled up into them automatically?
If so, that's definitely good enough for me :)
Alright, thanks
How can I use inline
to load some resource from the public folder? Or... what is a better place to store resources?
864 | (def resistor-icon (rc/inline "public/css/icons/resistor.svg"))
--------------------------^-----------------------------------------------------
Encountered error when macroexpanding shadow.resource/inline.
Resource not found: public/css/icons/resistor.svg at line 864 nyancad/mosaic/editor.cljs
I added "public" to :source-paths
and that solved it
Can someone help? How I can fix it?
:shadow.build.npm/js-invalid-requires - {:resource-name "node_modules/@monaco-editor/loader/lib/cjs/loader/index.js", :requires [{:line 135, :column 2}]}
At line 135:
require(['vs/editor/editor.main'], function (monaco) {
storeMonacoInstance(monaco);
state.resolve(monaco);
}, function (error) {
state.reject(error);
});
can't. this is not supported by shadow-cljs. you can use webpack instead as described here https://code.thheller.com/blog/shadow-cljs/2020/05/08/how-about-webpack-now.html