Skip to content

[WebProfiler] Profiler improvements / extract Font from stylesheet #51888

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 11, 2023

Conversation

smnandre
Copy link
Member

@smnandre smnandre commented Oct 8, 2023

Q A
Branch? 6.4
Bug fix? no
License MIT

This PR remove 30% of profiler responses size, removing unused font/data64


AndMore 1 - fixed a couple of CSS bugs
AndMore 2 - made the logo clickable, allowing anyone to quickly returning to the profiler homepage


In the HTML source code of every profiler page (excluding the toolbar) .... was inejected around 100KB of base64 encoded font.

With the raise of ui / system fonts, the adoption of HTTP2, and all the other techniques to handle assets in a simplier way... i think we have to improve this (minor) situation.

This PR extract the woff file in its own file, handled by the Profiler controller, and leverage the "local" stores.

Result: 30%of immediate reduction

Before After
BEFORE AFTER

Now it's

  • less energy used
  • easier to debug/read
  • lighter to log

@carsonbot carsonbot added Status: Needs Review DX DX = Developer eXperience (anything that improves the experience of using Symfony) labels Oct 8, 2023
@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "6.4" but it seems your PR description refers to branch "6.4 for features".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@carsonbot carsonbot added this to the 6.4 milestone Oct 8, 2023
@carsonbot carsonbot changed the title [WebProfiler][DX] Profiler improvments / extract Font from stylesheet [WebProfiler] Profiler improvments / extract Font from stylesheet Oct 8, 2023
@smnandre smnandre force-pushed the profiler-improvments branch 2 times, most recently from 66c38df to 4663658 Compare October 8, 2023 16:49
@smnandre
Copy link
Member Author

smnandre commented Oct 8, 2023

I'm having troubles with tests... i'll fix / ask help just after the implementation feedback .

@smnandre
Copy link
Member Author

smnandre commented Oct 9, 2023

The Twig changes made those last 24h may explain (at least partially) my troubles with the tests

twigphp/Twig#3882
twigphp/Twig#3887

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

Thanks for this Simon. I left some comments.

@smnandre
Copy link
Member Author

smnandre commented Oct 9, 2023

Test errors are now unrelated

@smnandre smnandre requested a review from javiereguiluz October 9, 2023 13:59
@smnandre
Copy link
Member Author

smnandre commented Oct 9, 2023

Is there anything else i can do ? Should i rebase the commits ?

@OskarStark OskarStark changed the title [WebProfiler] Profiler improvments / extract Font from stylesheet [WebProfiler] Profiler improvements / extract Font from stylesheet Oct 9, 2023
@@ -1,5 +1,5 @@
<div id="header">
<h1>{{ source('@WebProfiler/Icon/symfony.svg') }} Symfony Profiler</h1>
<h1><a href="{{ path('_profiler_home') }}">{{ source('@WebProfiler/Icon/symfony.svg') }} Symfony Profiler</a></h1>
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

@fabpot fabpot force-pushed the profiler-improvments branch from ba8f962 to a78ec8d Compare October 11, 2023 07:37
@fabpot
Copy link
Member

fabpot commented Oct 11, 2023

Thank you @smnandre.

@fabpot fabpot merged commit 748386b into symfony:6.4 Oct 11, 2023
This was referenced Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony) Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants