Fork me on GitHub
#shadow-cljs
<
2023-10-21
>
Adrien Siegfried10:10:09

Hi everyone, with an esm target build, is it possible to export modules with a pattern instead of a name? for instance, all fns starting with 'foo'.

thheller11:10:46

no, not currently

Adrien Siegfried11:10:08

thanks for the quick reply, and I guess it's the same for all fns from a single namespace?

thheller11:10:26

only the static config in shadow-cljs.edn works currently

Adrien Siegfried11:10:06

got it, thanks And btw, huge fan of shadow-cljs πŸ‘

nivekuil23:10:27

while debugging an electric compiler issue, I broke shadow-cljs 2.25.8. behavior is reproducible on every build, tried clearing .shadow-cljs too

Dustin Getz23:10:32

what is expectation and actual behavior? Zero idea as to what you did, what you think should happen or what this screenshot is meant to show

nivekuil23:10:47

expectation: shadow shows success, warning, or error reality: shadow throws an exception and the UI is stuck here

nivekuil23:10:30

@U09K620SG I don't know how much of this is related to electric but shadow should never fail like this, so it's a shadow bug. I don't expect you to have an idea

Dustin Getz23:10:45

did you clear js as well?

Dustin Getz23:10:04

electric compiler tampers with shadow cache because clojurescript compilation is really complicated, i don’t recall the details

nivekuil23:10:26

zero idea what that means πŸ™‚

nivekuil23:10:25

are you saying to delete node_modules?

Dustin Getz23:10:42

rm resources/public/js

nivekuil23:10:15

yes, tried it again and it's the same error. on electric cc55772f18bc46373f131e092fc20055c8062b59

Dustin Getz00:10:15

try incognito, there must be state somewhere

nivekuil00:10:02

tried that, different browsers etc., no luck yet. will keep digging, I agree there's some state somewhere if this error still shows up after reverting my code. have you seen something like this before?

nivekuil00:10:54

didn't manage to figure out what the state issue is, but fixed by changing (PIXI/Texture.from texture-url) to (.from PIXI/Texture texture-url). not sure why this suddenly became a problem. anyway, the shadow UI should still not break like this.

πŸ‘€ 1
hifumi12301:10:12

https://cljs.github.io/api/syntax/dot > Dots inside symbols accidentally work as a technical shortcut in ClojureScript > ... > Dots inside symbols are not recommended, as they are not detected by :infer-externs

πŸ‘€ 1
hifumi12301:10:06

key takeaway: foo/bar.baz may work in some cases (e.g. for js namespace it will since most of the stdlib has externs already). but this is not behavior to rely on. similarly, you should always explicitly require namespaces exporting a symbol, even if in development you can sometimes use symbols from another namespace without requiring it

πŸ‘ 1
hifumi12301:10:21

also, the yellow status icon indicates your build emitted warnings. it would be helpful to share those warnings

nivekuil01:10:29

the warning is in the console, threw an exception before the UI could render them it seems

hifumi12301:10:00

compile-time warnings appear in the build status (or your terminal if you run npx shadow-cljs compile main); the browser console displays whatever logging happens at run-time

nivekuil05:10:08

the console is in the picture

thheller07:10:45

this is just a bug in the UI, not specific to electric but I guess triggered by it throwing its own errors maybe?

πŸ‘€ 1
thheller07:10:16

this doesn't look like an error message from the shadow-cljs compiler, so I guess the UI just ends up in a path that is not normally taken (and wasn't tested)

πŸ‘€ 1
thheller07:10:34

fixed in 2.25.9, not pretty but shouldn't blow up anymore

πŸ‘ 1
Dustin Getz12:10:24

this makes sense, the foreign interop in Electric is something that had recent changes and likely isn't perfected yet