Skip to content

[SF PROFILER] Use fetch instead of Sfjs.request and minor style adjusments to better match the new profiler layout #500

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 2 commits into from
Dec 15, 2023

Conversation

n3o77
Copy link
Contributor

@n3o77 n3o77 commented Dec 3, 2023

Not sure exactly when it happened but in Symfony 6.4.1 the Sfjs class is not available in the profiler so i replaced Sfjs.request with fetch.

I wanted to change as little as possible so the requests match the old functionality and no controller changes are necessary.

Also included some minor styling adjustments to match the new profiler design and support dark-mode. Mainly avoiding the buttons to break in multiple lines and changing the font color in the textarea in dark-mode. Let me know if you would prefer a separate PR for those.

Before:
before

After:
after

Any feedback is welcome.

Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

I'm not sure why it was written with Sfjs initially, probably for better compatibility with browsers, but all latest ones should support fetch with no problem: https://caniuse.com/?search=fetch

So I wonder about others opinions

@rvanlaak
Copy link
Member

A global browser usage of 97.48% for fetch is fine by me, especially given that it's mostly engineers that use the profile and likely won't fall under that remaining several %.

@bocharsky-bw
Copy link
Member

Makes sense :)

OK, thank you for your work on it!

@bocharsky-bw bocharsky-bw merged commit 722e616 into php-translation:master Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants