Skip to content

[WebProfilerBundle] Render the toolbar stylesheet #58287

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

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

smnandre
Copy link
Member

Q A
Branch? 7.2
Bug fix? no
New feature? no
Deprecations? no
Issues Fix #...
License MIT

Render the (static) toolbar stylesheet separately from the (dynamic) toolbar content.

(avoid the 20ko inlined CSS injection on every page)

@smnandre smnandre requested review from stof and OskarStark September 17, 2024 19:06
@javiereguiluz javiereguiluz added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Oct 7, 2024
Copy link
Contributor

@tucksaun tucksaun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one 👍

@fabpot fabpot force-pushed the dx/wdt-toolbar-stylesheet branch from 7c9dd5a to c36fcff Compare October 10, 2024 05:34
@fabpot
Copy link
Member

fabpot commented Oct 10, 2024

Thank you @smnandre.

@fabpot fabpot merged commit d83167d into symfony:7.2 Oct 10, 2024
3 of 4 checks passed
@fabpot fabpot mentioned this pull request Oct 27, 2024
@alexislefebvre
Copy link
Contributor

alexislefebvre commented Dec 2, 2024

This change breaks the style of the toolbar for some users:

What about:

1.adding a parameter to use the “old” way?
2. reverting the changes from this PR to get back to the “old” way, and adding an opt-in parameter to use the “new” way?


Update: never mind, a solution has been found:

fabpot added a commit that referenced this pull request Jan 6, 2025
…xislefebvre)

This PR was merged into the 7.2 branch.

Discussion
----------

[WebProfilerBundle] fix loading of toolbar stylesheet

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #59045
| License       | MIT

It looks like this PR

- #58287

Caused issues with some configurations:

- #59045

According to the thumb-up emoji on [this comment](#59045 (comment)) (I don’t have a better measurement of the impact), it affected at least 10 users, with various web servers.

Proposals:

1. do not use the `.css` file extension so that servers do not try to serve an actual file
2. if we consider that the disappearance of the style of the profiler’s toolbar is a breaking change, the `.css` file extension could be added back with Symfony 8.0, with a note to help people upgrade (see the workarounds in the issue)

Commits
-------

7fef930 fix: loading of WebProfilerBundle’s toolbar stylesheet
@ju1ius
Copy link
Contributor

ju1ius commented Jan 25, 2025

Render the (static) toolbar stylesheet separately from the (dynamic) toolbar content.

If the stylesheet is static why not just serve a static asset instead ?

@smnandre
Copy link
Member Author

I guess because service a static asset would require to know its public path, which is harder to grant than a routed URL ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed WebProfilerBundle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants