laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.83k stars 643 forks source link

[5.x] feature: this adds the vite integrity plugin to support assetsAreCurrent check #1415

Closed mmachatschek closed 4 months ago

mmachatschek commented 4 months ago

This adds the manifest integrity plugin for vite to support checks if the user published the current version of the horizon assets.

driesvints commented 4 months ago

@mmachatschek what would they see if the assets aren't up to date? I also thought we already had a check for this 🤔

mmachatschek commented 4 months ago

@driesvints there is a file compare check here https://github.com/laravel/horizon/blob/3c6661d19013d108143ac204bc5f0e4f3313bf68/src/Horizon.php#L195 that checks if the manifest.json in the published folder is the same as the manifest.json from the package.

with laravel mix we used versioning that added a hash ?id= for invalidating https://github.com/laravel/horizon/blob/32ca28dcb91fa2f4fa650f21440144c4bc2846dd/public/mix-manifest.json#L2 the built files.

the integrity package readds this missing feature after my change from mix to vite