-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[AssetMapper] Disable profiler when the "dev server" respond #52100
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
[AssetMapper] Disable profiler when the "dev server" respond #52100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one thing I'm not comfortable with in this class, it's string $publicPrefix = '/assets/'
.
This works only when the app is hosted at the root of the domain, and we know that's not always the case, and that we can deal with this in other components.
That's unrelated to this PR but still :)
src/Symfony/Component/AssetMapper/AssetMapperDevServerSubscriber.php
Outdated
Show resolved
Hide resolved
How would you handle that ? |
The routing component is the one that can deal with this. IIRC, it uses |
It's just a default value... the instance from the container uses the "asset_mapper.public_prefix" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might consider changing the Response header name? @weaverryan?
src/Symfony/Component/AssetMapper/AssetMapperDevServerSubscriber.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/AssetMapper/AssetMapperDevServerSubscriber.php
Outdated
Show resolved
Hide resolved
I'm not sure there's a problem - the logic for checking to see if this controller should be used is: $pathInfo = $event->getRequest()->getPathInfo();
if (!str_starts_with($pathInfo, $this->publicPrefix)) {
return;
} So the |
Thanks for checking 🚀 |
26bd310
to
e1174ac
Compare
Thank you @smnandre. |
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 :