filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.15k stars 2.84k forks source link

Windows republishes assets differently than Mac/Linux dev env, causing unintentional file modifications #14278

Open nathan-langlois opened 2 weeks ago

nathan-langlois commented 2 weeks ago

Package

filament/filament

Package Version

v3.2.98

Laravel Version

v11.20.0

Livewire Version

v3.5.4

PHP Version

PHP 8.3.11

Problem description

When I composer install a Filament project in a WIndows environment, the php artisan filament:upgrade command that runs (set inside composer.json) republishes assets as expected, but it results in a bunch of versioned file changes of the public assets. In a Mac environment this doesn't happen. You shouldn't have to deal with code changes when just doing a composer install (think of devex environments like Codespaces). Then if you commit the changes from Windows, the next time a Mac env does a composer install now the assets are all changed again. So the republishing of assets causes this constant change set between different environments Mac vs Windows, which is annoying to deal with especially in the context of PR reviews etc.

filament-asset-changes

Expected behavior

When you composer install for a project that is already setup for Filament, it should not change any files. When you do this from a Mac env there are not any file changes (as expected). When you do this from a Windows env, it's modifying assets which are already published (unexpected). These public assets should only be modified if Filament is actually upgraded to a new release version like in a composer update.

Steps to reproduce

In a Windows dev environment (either Herd or otherwise):

  1. git clone https://github.com/filamentphp/demo.git
  2. cd demo/
  3. composer install --ignore-platform-reqs
  4. git status
  5. notice all the unintentional file modifications in public/js/filament/

Reproduction repository (issue will be closed if this is not valid)

https://github.com/filamentphp/demo.git

Relevant log output

modified:   public/css/filament/forms/forms.css
        modified:   public/js/filament/filament/app.js
        modified:   public/js/filament/filament/echo.js
        modified:   public/js/filament/forms/components/color-picker.js
        modified:   public/js/filament/forms/components/date-time-picker.js
        modified:   public/js/filament/forms/components/file-upload.js
        modified:   public/js/filament/forms/components/key-value.js
        modified:   public/js/filament/forms/components/markdown-editor.js
        modified:   public/js/filament/forms/components/rich-editor.js
        modified:   public/js/filament/forms/components/select.js
        modified:   public/js/filament/forms/components/tags-input.js
        modified:   public/js/filament/forms/components/textarea.js
        modified:   public/js/filament/notifications/notifications.js
        modified:   public/js/filament/support/async-alpine.js
        modified:   public/js/filament/support/support.js
        modified:   public/js/filament/tables/components/table.js
        modified:   public/js/filament/widgets/components/chart.js
        modified:   public/js/filament/widgets/components/stats-overview/stat/chart.js

Donate 💰 to fund this issue

Fund with Polar

danharrin commented 2 weeks ago

Some people choose to .gitignore the assets, which is why we publish them on install. What are the file modifications that happen, do they contain valid changes?