Fork me on GitHub
#shadow-cljs
<
2022-10-14
>
Mario Trost06:10:23

👋 Does anyone know of or has implemented a Github Action diffing bundle sizes between branches using shadow-cljs build reports?

valerauko11:10:25

I'd be up to building that next week

👀 1
Mario Trost13:10:12

Nice! I had an itch to build that for the last couple of days but so far only googled for possible solutions. One of the first things found was a well-documented example for nextjs: https://jeffchen.dev/posts/Measuring-Bundle-Sizes-With-Next-js-And-Github-Actions/ I'd try something similar, perhaps tomorrow, but only if the weather allows it. Do you have it firmly planned for next week?

Aleks08:10:19

Hi! If I use lein to manage dependencies and paths, is it possible to set a dedicated lein profile only for one specific build but not for others? I know that I can do :lein {:profile "+cljs"} , but this applies for all the builds.

thheller08:10:43

no, this is not supported and generally also not useful. why do you want that?

Aleks08:10:08

I think it could be useful when you want to include some source paths in one case but not in another. What I wanted to do is to change project.clj default behaviour, but with a profile in global lein config.

Aleks08:10:19

Anyway thanks. I’ll try to find another way to solve my problem.

thheller09:10:30

@zelark it is fine to always keep everything on the classpath, files that aren't required aren't included. if your intent is to override certain namespaces there are better options to do that

thheller09:10:46

if you describe what you intend to do I can give you suggestions

Aleks11:10:17

I have a project.clj that I cannot change. shadow-cljs depends on it. When I run shadow-cljs some code evaluation (it takes ~30 secs) happen, but it’s not relevant to a shadow-cljs build at all. So I’d like to override this behaviour with a separate profile which I described in ./lein/profiles.clj.

Aleks11:10:37

Initially I thought that --config-merge can help, but it affects only a build config.

thheller12:10:54

hmm I don't get it? how is that specific to one build?

thheller12:10:35

I mean by all means do all that but why is this behavior different between builds?

thheller12:10:58

you can just use multiple lein profiles and run shadow-cljs via lein directly

thheller12:10:24

lein with-profiles +foo run -m shadow.cljs.devtools.cli watch the-build

Aleks13:10:28

Actually this behaviour should be applied to all builds, but now I cannot change neither project.clj nor shadow-cljs.edn.

Aleks13:10:05

running shadow-cljs via lein directly is what I need, I just didn’t realized that I could do that.

Lone Ranger18:10:56

It's unclear to me in the manual where the :nrepl stuff goes. This does not seem to be correct:

{:source-paths
 ["src/dev"
  "src/main"
  "src/test"]
 :dependencies
 []
 :dev-http {8080 "public"}
 :builds
 {:frontend
  {:target :browser
   :modules {:main {:init-fn }}
   :devtools {:repl-init-ns 
              :repl-pprint true
              :nrepl {:port 9000
                      :middleware []
                      :init-ns }}}}}
Can anyone point out my mistake?

thheller18:10:43

top level. its not build related

Lone Ranger18:10:34

got it, thank you

jpmonettas19:10:33

Any ideas why I could be seeing TypeError: tick.core.goog$module$goog$object is undefined ? Shadow compiles without errors but when loading my file I see that error message and everything else after that fails

jpmonettas20:10:29

the project was working fine, I just moved it to a different box and started seeing that error :thinking_face:

thheller20:10:19

or in case you are running in the REPL maybe an older version than this https://github.com/thheller/shadow-cljs/blob/master/CHANGELOG.md#2203---2022-10-09

jpmonettas20:10:17

I'm using the latest shadow-cljs

jpmonettas20:10:34

maybe a dependency doesn't work anymore with the new stuff :thinking_face:

thheller20:10:11

if the dependency is old then it probably doesn't use goog.object correctly (maybe has a macro emitting access, or tried global access?)

jpmonettas20:10:00

maybe, weird the stacktrace doesn't mention anything, so no idea what lib can be causing that

thheller20:10:17

well it is this namespace tick.core

jpmonettas20:10:04

oh, yeah, there is a tick library, first time I see it since it is not my project

jpmonettas20:10:25

that was it! damn breaking changes. Thanks @U05224H0W!