-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
See #14166 for context.
Our documentation requires a deterministic value for the version.name
config setting but does not warn the user if they have used something indeterministic. This can be very difficult to debug as the app version hash can change throughout the build if we load the svelte config more than once, causing the scripts to not match to the correct payload name.
Furthermore, our default value for the setting is based on the build time. However, nothing could have changed and the version name will still be different when re-running the build. This is indeterministic too. Not sure if this is what currently affects the asset hashes to change too often too, will have to dig into this, but would be great if this solves that problem as well.
Some ideas from Rich:
I think it might be worth us investing some time to think about what it would mean to have a deterministic version automatically. For example: I haven't thought this all the way through but could we generate the version dynamically by hashing the inputs to Vite? Maybe we need to account for externalised server-side dependencies, in which case perhaps we need to account for a lockfile/package.json in addition. Or maybe even if the code hasn't changed, we need to account for any data that changed in prerendered content, in which case perhaps we use a placeholder value at first, compute the version after prerendering, and then replace the placeholder in any outputs in which it appeared?
Reproduction
gageracer/sudokusu#6 (comment)
Logs
System Info
-
Severity
serious, but I can work around it