Fork me on GitHub
#shadow-cljs
<
2022-05-28
>
Karol Wójcik08:05:07

Is it possible to inline all source-map during development?

thheller08:05:51

not when using :loader-mode :eval (the default)

Karol Wójcik08:05:42

How can i change that?

thheller08:05:05

why do you want to? I mean the alternative is much slower

thheller08:05:09

assuming a browser build here

thheller08:05:21

:devtools {:loader-mode :script} in the build config

thheller08:05:43

but you are trading loading separate source maps but one source file

thheller08:05:54

to separate source files with potentially the source maps inlined

thheller08:05:05

so you in my view you are not gaining anything

Karol Wójcik08:05:25

The reason i need inline source maps is because the ionic capacitor is unable to load the source maps from the URL. I'm receiving these kind of errors

thheller08:05:55

what happens if you click the url? I mean what do you get?

Karol Wójcik08:05:03

It opens the source map correctly

Karol Wójcik08:05:13

I get the source map 🙂

thheller08:05:21

no more info on the unknown error?

thheller08:05:49

could be a restricted CSP?

Karol Wójcik08:05:55

How can I know that?

Karol Wójcik08:05:31

I didn't have CSP enabled .

thheller08:05:56

then it might be using a default which is too restrictive. don't know. never used this

thheller08:05:31

you can maybe debug it by opening the devtools on the devtools

thheller08:05:44

that sometimes gives more errors than the log line or at least lets you debug it further

Karol Wójcik08:05:45

Yeah. In my case shadow-cljs is serving all the files.

thheller08:05:22

I mean try it :compiler-options {:source-map-inline true} and :devtools {:loader-mode :script}

thheller08:05:40

maybe it works or reveals more info about the error

Karol Wójcik08:05:44

Inline source maps work. I will probably leave it for now and optimize later 🙂

sb16:05:52

I have a “maybe” the same problem, is that resolved? When I run (ns-tools/refresh :after 'mount-components-reset), I got error message.. didn’t find namespace.. at clj part (I use pedestal, and something looks like “locked(?)” ).

;; this somehow breaks reloading
  ;; the usual :reloading message tells me that is namespace is being reloaded
  ;; but when the new instance is launched it is still using the old one
  ;; i cannot figure out why
  ;; (ns-tools/refresh :after 'repl/start)

sb17:05:55

ps I read here in the community try delete .m2 > juxt folder.. and now not freeze out, but don’t update the backend content [UPDATE: works fine].

sb17:05:47

Everything fine: rm -rf ~/.m2/repository/juxt after this command.. :man-shrugging: I don’t understand fully. Sorry for this spam, if you would like I will delete this thread.

Patrick Brown23:05:02

Can anyone post a link to a good article on how to minimize release build file size? My optimizations none is 16MB and my advanced is 4MB, This is my release section in my shadow-cljs.edn :release {:compiler-options {:optimizations :advanced} :js-options {:minimize-require true}} I can't help but think... I'm doing something majorly wrong. I'm using Fulcro and MUI, so I was imagining something pretty big, but 4MB seems like an 'it's my fault' size. CHEERS!

nivekuil23:05:48

what's your build report look like? npx shadow-cljs run shadow.cljs.build-report [build-id] report.html

Patrick Brown23:05:59

Thanks for the reply. I didn't know that trick. That was very instructive. I've got 1MB for apache ECharts, 1MB for MUI. And 2MB scattered. It definitely is a 'me using too much cool stuff' problem. Looks like I'll have to go the multiple modules route.

Patrick Brown23:05:53

@U797MAJ8M That really was a good tip. Thanks again! Now that I can see where the problem is, there are some solutions out there.

nivekuil23:05:44

glad I could help!

thheller06:05:16

@U036UJBDM5G you don't need to set any of those :release options. they are the default already. setting them again does nothing.