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.98k stars 2.93k forks source link

Blade icons causing performance issues, even on non-Filament pages #9672

Closed vjanssens closed 11 months ago

vjanssens commented 11 months ago

Package

filament/support

Package Version

v3.0.94

Laravel Version

v10.31.0

Livewire Version

v3.1.0

PHP Version

PHP 8.2.12

Problem description

The package blade-ui-kit/blade-heroicons loaded by filament/support is causing quite severe performance issues on non-Filament pages (regular routes loading regular blade views). It took me long to get to the bottom of the issue, but after including DisableBladeIconComponents (https://github.com/filamentphp/filament/blob/e8d44231fcba1a0f4e9625afe7368447d56b2866/packages/panels/src/Http/Middleware/DisableBladeIconComponents.php) in my main middleware stack the problem resolved.

I think it's interesting to note Filament apparently seen this issue before, include the mentioned Middleware it in the AdminPanelProvider.php, but the package is still causing issues. So loading this middleware only in an AdminPanelProvider does not fully resolve it.

I wonder if I should include DisableBladeIconComponent in all of my other projects containing Filament V3?

Please also see the issue created in blade-icons: https://github.com/blade-ui-kit/blade-icons/issues/71#issuecomment-1810493388.

Expected behavior

No performance penalty on non-Filament pages after installing Filament v3.

Steps to reproduce

-

Reproduction repository

-

Relevant log output

No response

github-actions[bot] commented 11 months ago

Hey @vjanssens! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

Also, it doesn't look like you've provided much information on how to replicate the issue. Please edit your original post with clear steps we need to take.

kayvanaarssen commented 11 months ago

@zepfietje Can you check this one. And reopen? Maybe this also has an effect on the slow loading ot the tables.

zepfietje commented 11 months ago

Are you using any Blade icons outside Filament panels, @vjanssens?

@kayvanaarssen, this shouldn't have anything to do with table performance within panels.

vjanssens commented 11 months ago

@zepfietje No, I wasn't using icons outside Filament panels. I now see it has already been mentioned in the installation docs, something I did not take note of: https://filamentphp.com/docs/3.x/panels/installation#caching-blade-icons.