Skip to content

Commit caff0d9

Browse files
bug #52100 [AssetMapper] Disable profiler when the "dev server" respond (smnandre)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [AssetMapper] Disable profiler when the "dev server" respond | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | License | MIT In debug mode, the "dev server" send assets as if they were compiled in the public directory. To improve the DX and not "pollute" too much the profiler (see capture below), this PR does two things : * disable the profiler for those requests * stop the request & response event propagation, to speed things a bit <img width="800" alt="Capture d’écran 2023-10-17 à 10 57 44" src="https://github.com/symfony/symfony/assets/1359581/98eff6c5-2da4-46e3-9e7e-44b34ec38eef"> Commits ------- e1174ac9dd [AssetMapper] Disable profiler when the "dev server" respond
2 parents 38e4119 + a2767aa commit caff0d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Resources/config/asset_mapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
use Symfony\Component\AssetMapper\ImportMap\Resolver\JsDelivrEsmResolver;
4040
use Symfony\Component\AssetMapper\MapperAwareAssetPackage;
4141
use Symfony\Component\AssetMapper\Path\PublicAssetsPathResolver;
42-
use Symfony\Component\HttpKernel\Event\RequestEvent;
4342

4443
return static function (ContainerConfigurator $container) {
4544
$container->services()
@@ -93,8 +92,9 @@
9392
abstract_arg('asset public prefix'),
9493
abstract_arg('extensions map'),
9594
service('cache.asset_mapper'),
95+
service('profiler')->nullOnInvalid(),
9696
])
97-
->tag('kernel.event_subscriber', ['event' => RequestEvent::class])
97+
->tag('kernel.event_subscriber')
9898

9999
->set('asset_mapper.command.compile', AssetMapperCompileCommand::class)
100100
->args([

0 commit comments

Comments
 (0)