Fork me on GitHub
#hyperfiddle
<
2023-11-11
>
Vincent04:11:52

I want to define a :version/current for the app (current version) and have an (e/watch on the db ref and have it auto reload the page when the version shifts, i reckon this is doable with e/watch on a db call but i'm having trouble getting it to work

Dustin Getz04:11:01

electric bundles functionality to refresh on new build deployed, are you looking for something different than that?

Vincent04:11:07

i want to trigger a javascript location.reload when i update a version number manually

Dustin Getz04:11:14

to be clear, it already reloads in prod (not in dev) when the source code changes, will the database version ever change when source code didn’t?

Vincent05:11:52

oh, it does? how can i tell it to be prod and not dev mode?

Vincent05:11:50

and, to answer your question, the version will only change when code changes (-- the option to force reloads only necessary if auto-reload not a thing, since some clients hold onto stale .js asset)

Vincent16:11:40

I want hot code reloading and force my users to get latest version 😅

Dustin Getz16:11:38

you want hot code reloading in prod?

Vincent03:11:25

Danger is my middle name.

Dustin Getz13:11:49

i think dev builds are already reloading changed JS for all connected clients every time something changes. However expect many glitches related to caching. Perhaps you are experiencing one