laravel-splade icon indicating copy to clipboard operation
laravel-splade copied to clipboard

Publish on npm, or provide packed JS build with composer?

Open pascalbaljet opened this issue 1 year ago • 2 comments

If you're updating Splade, you must update with composer and npm. Does it make sense to provide a packed JS build with the composer package and import that into the main app JS file, or provide an Artisan command that can publish/update it? It doesn't feel very 'pure', but I can see people updating just either composer or npm and ending up with different versions of the JS and PHP package.

pascalbaljet avatar Jul 25 '22 14:07 pascalbaljet

Yeah, That is a really good concern.

I think the best approach is that we can do it the way Laravel Nova ships their updates. They include the bundled JS build which you can simply publish with an artisan command (like php artisan splade:publish)

richardkeep avatar Jul 25 '22 14:07 richardkeep

As splade isn't closed source you could still optionally provide the JavaScript source code for people wanting to mess with the uncompiled source files.

Gummibeer avatar Sep 24 '22 08:09 Gummibeer

After working with it for a few months, I think the current setup works fine. I've added an Artisan Command (splade:show-versions) to help identify the installed version.

pascalbaljet avatar Nov 19 '22 12:11 pascalbaljet