Fork me on GitHub
#shadow-cljs
<
2023-08-08
>
teawaterwire08:08:46

i'm trying to import this package

["@zerodevapp/sdk" :refer [getZeroDevSigner]]
but i'm getting this error:
AssertionError Assert failed: (str/starts-with? rel-require "./")
am i not importing the package correctly?

teawaterwire09:08:00

(updating to the latest version of shadow to make sure...)

teawaterwire09:08:33

hum now the build is not returning an error 🙃 (i was using shadow 2.18)

thheller09:08:32

yeah that was an issue I fixed a while ago

🙌 2
sergey.shvets21:08:08

I'm trying to build a macro around Web Components. Specifically, generating them from hiccup-like structure. I have a macro that generates Web Components class, but the problem that there is no way to redefine Web Component without page refresh (Browser limitation). I'm thinking about workaround that generates a new name for component within macro during development builds (e.g. instead of hello-world it will generate and register new version hello-world-v1, hello-world-v2, etc.) , but I can't figure out how to understand within macro if a build is a development one or a production one? Is it solvable or I'm better off just reloading a page with some build hooks?

hifumi12300:08:11

web components arent reloadable and you will need to somehow keep track of everything you have rendered. you may be able to construct a map associating names to counters somehow, but the hard part really is replacing existing components

sergey.shvets03:08:00

yeah, that's annoying.... I was thinking of rebuilding DOM with new component names once they're replaced. I think about injecting state from a global atom, so that might work...

thheller06:08:03

in the macro you can check the (:shadow.build/mode &env) value. it'll be :release for release builds, :dev otherwise.

sergey.shvets15:08:34

Thank you! That's exactly what I was looking for!