-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish assets with Composer hook #554
Comments
It may be similarly prudent to specifically mention appropriate upgrade steps in the docs at |
@drbyte I was thinking to do that first but if we can automate this then this is unnecessary. |
True, but docs also help with troubleshooting when automation goes awry. :) |
Yeah, true. You can send in a PR if you want :) |
Done |
What do you think about something like this? laravel/telescope#729 Eg. show a warning when the assets are out-of-date. Still requires a manual step but at least people are warned. I don't think composer hooks work for non-root projects. |
Hmm I'm not sure if something like that should make its way into the actual UI.
Yeah I'm not sure either. I need to look into this but bit swamped atm. |
Yeah the alternative is not publishing it, but loading the assets through a controller, example: https://github.com/fruitcake/laravel-telescope-toolbar/blob/master/src/Http/Controllers/ToolbarController.php#L67-L86 |
Why shouldn't it make the way into the UI? It's only visible when it's outdated and a relatively simple check to prevent common errors. |
Because you're displaying an implementation detail in an app. Imo the app shouldn't have any knowledge about how the ui is build. This is a slippery slope imo. |
I personally don't find it bad for the UI to help with this. But of course, if this can be avoided altogether that would be the best solution. |
I still think we can solve this with Composer hooks. |
https://getcomposer.org/doc/articles/scripts.md
|
I was more thinking of setting a hook on the composer.json of the app itself. Like a note in the docs to add it to your composer.json |
Yeah you can do that, but it will publish for all updates (not just this one). Not that it matters much. |
@barryvdh you can filter by service provider or tag |
Oh yeah I mean you can just put
But it will publish on each composer update, not just for when Horizon updates (but it also doesn't changes much when its not updated). |
ah yeah. Gotcha. I indeed think it's not that big of a deal if you're not overriding anything. If you're overriding the templates you probably don't want to add it. |
So, no interest in adding a warning like in Telescope? |
@driesvints Did you find any downsides from automatically publishing the assets when updating the package? I'm one of them constantly forgetting doing so manually and first notices in production and has to redeploy. Perhaps the |
I've been doing this the same way Livewire suggests it, by hooking |
@drbyte yeah I saw that as well. Might be a good solution. |
I've opted for the suggestion by @drbyte to note this in the docs of Horizon and Telescope: laravel/docs#6230 |
We're currently getting a lot of issues where people forgot to update their Horizon assets. Technically it should be possible for us to implement a Composer hook in the
composer.json
command that runsphp artisan horizon:assets
so updated assets get published.The text was updated successfully, but these errors were encountered: