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] Change Laravel Mix asset bundling to Vite setup #1413

Closed mmachatschek closed 4 months ago

mmachatschek commented 4 months ago

This moves the current laravel mix asset bundling setup to the recommended way of bundling with Vite.

driesvints commented 4 months ago

We'll also want to pass in the right command (build) for the compile assets workflow: https://github.com/laravel/.github/blob/main/.github/workflows/compile-assets.yml#L9

driesvints commented 4 months ago

Thanks btw! This is great.

mmachatschek commented 4 months ago

@driesvints the default command for the compile assets workflow is production which is available as a npm script. I'm not 100% sure I can follow what you mean.

If this gets merged, then I'll update the laravel/telescope package with the same changes too

driesvints commented 4 months ago

ah nvm. We usually use build as a default for that but it's fine: https://github.com/laravel/laravel/blob/11.x/package.json#L6

mmachatschek commented 4 months ago

I went ahead and renamed the app.scss and app-dark.scss files to styles.scss and styles-dark.scss to avoid name conflicts.

There are basically three files now that will change behaviour on user side in the public/vendor/horizon folder:

  1. mix-manifest.json -> manifest.json -> old file not deleted
  2. app.css -> styles.css -> old file not deleted
  3. app-dark.css -> styles-dark.css -> old file not deleted
  4. img/favicon.png -> favicon.png -> old file not deleted
  5. X img/horizon.svg -> not deleted/no replacement
  6. X img/sprite.svg -> not deleted/no replacement
  7. X app.js.LICENSE.txt -> not deleted/no replacement

When user publish the horizon assets they will end up with 3 new files and 3 old files that are not cleaned up automatically

if this is an issue, then I will need to send this PR to the 6.x branch

Let me know @driesvints

driesvints commented 4 months ago

I don't think letting the old files remain is a big issue. As long as the new files are there and picked up it's fine.

jhm-ciberman commented 3 months ago

So as far as I understand, is it safe to upgrade, republish assets and then manually delete these files?