Fork me on GitHub
#portal
<
2022-05-03
>
Carlo01:05:16

I wonder if there's a way of solving this: when I reload the browser page (using shadow-cljs), portal loses theme customizations and the taps added with add-tap. What's the recommended way of dealing with hot reloading in shadow-cljs?

djblue01:05:37

I'm assuming this is via portal.web, if so, it would be hard to preserve the tap-list since those values live in memory on the page that's being refreshed. If you want to preserve those values across page refreshes, you can send them to a remote instance of portal 👌

R.A. Porter01:05:49

Pointing to a remote instance retains the tapped values, but still loses the taps, unfortunately. I'm sure there's a way to have shadow re-init them by default; I just haven't spent enough time trying to figure it out.

djblue01:05:58

I might write this up as a separate guide :thumbsup:

🙌 1
😍 1
Carlo01:05:37

What are the relative tradeoffs of using a standalone portal instead of a cljs one? Do you lose some possibilities of interaction?

djblue01:05:51

With portal.web, you get access to runtime js objects / commands. So if that isn't something you are leveraging, it might be better to use a remote instance