core icon indicating copy to clipboard operation
core copied to clipboard

Asset versioning to ensure latest JS and CSS for backend

Open benr77 opened this issue 1 year ago • 1 comments

I just upgraded to the latest Bolt 5 release. All good, tested on my local dev env and then pushed live. Went to log in to the backend on the live site and the password field was completely missing from the login form. The password label was there, but no input field.

Upon investigation I realised the password field is dynamically rendered using JS (not sure this is wise - it should degrade gracefully, not depend on JS to render the input field itself).

It turns out that on my live site, I have caching enabled for static assets using my CDN (Cloudflare in my case). Purging the cache enabled me to then get the latest JS and then the password field started to appear.

So forgetting the issue with the password field itself for a moment, would it not be a good idea to implement asset versioning on the backend JS and CSS. This would completely eliminate this kind of problem for all users, and all problems, in one go.

Symfony provides asset versioning out of the box - https://symfony.com/doc/current/frontend/encore/versioning.html

Thanks

benr77 avatar Jul 11 '22 09:07 benr77

Good suggestion.. I've added this to this PR, and this will be the default in Bolt 5.2:

https://github.com/bolt/core/pull/3286/files#diff-1fb26bc12ac780c7ad7325730ed09fc4c2c3d757c276c3dacc44bfe20faf166fL40

bobdenotter avatar Aug 10 '22 12:08 bobdenotter