-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WebProfilerBundle] Split and refactor all the JavaScript code #50790
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stof
requested changes
Jun 27, 2023
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig
Show resolved
Hide resolved
@stof your review has made me change my mind about some part of this PR. Modernizing the code of the toolbar means that many things will break. Let's keep the old code that works perfectly. This PR now only splits the toolbar code and modernizes the profiler code. Thanks! |
stof
requested changes
Jun 28, 2023
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig
Outdated
Show resolved
Hide resolved
Christophe, thanks for the new review. I've made all the changes that you proposed. Thanks! |
stof
approved these changes
Jun 29, 2023
Thank you @javiereguiluz. |
13a2732
to
619bba1
Compare
nicolas-grekas
added a commit
that referenced
this pull request
Jul 3, 2023
…outerj) This PR was merged into the 6.4 branch. Discussion ---------- [WebProfilerBundle] Fix minify test after JS refactor | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This test makes sure the JS files are valid after we "minify" them by removing newlines. After the refactor of #50790, it was not updated correctly causing a red CI. This fixes the test, and makes it more future proof. Commits ------- 3caa17a [WebProfilerBundle] Improve minify test after JS refactor
fabpot
added a commit
that referenced
this pull request
Dec 9, 2023
This PR was merged into the 6.4 branch. Discussion ---------- [WebProfilerBundle] Fix "Copy as cURL" | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #52920 | License | MIT The bug was introduced in #50790. #SymfonyHackday Commits ------- c97f0f9 [WebProfilerBundle] Fix Copy as Curl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in the past with @stof, the current JavaScript code is less than ideal because everything is coded into the same
Sfjs
object. That's why e.g. the toolbar loads code to handle tabs and togglers (Which don't exist in the database), the logger profiler panel, the mailer profiler panel, etc.This PR splits the code into different files:
base_js.html.twig
keeps the code that it's only used in most/all profiler panelstoolbar_js.html.twig
now stores the code that it's only used in the toolbar (mostly about Ajax requests)This feature is ready to review but:Intoolbar_js.html.twig
there's a bug that I can't fix. I need your help. It says "Illegal invocation", which is related to the usage ofthis
in the call:oldXHROpen.apply(this, Array.prototype.slice.call(arguments));
becausethis
it's not the XHR object but the new SymfonyWebDebugToolbar class.Intoolbar_js.html.twig
I want to refactor more code to use modern JS features after the previous bug is fixed.Thanks!