-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WebProfilerBundle] Generate profiler urls with an useful panel #32491
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
Conversation
Can you please share a screenshot (with a short animation if that makes sense?) This always helps a lot when improving the profiler. |
src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php
Show resolved
Hide resolved
62adb1f
to
bc83241
Compare
Just added tests. |
Can we do this using a special debugging header? If yes, wouldn't it make the implementation simpler? |
We can technically do it with special headers. It heavily reduces the amount of added code.
|
3deea5a
to
1645e5f
Compare
Friendly ping @nicolas-grekas, @ro0NL, @BoShurik, @ismail1432 and @fabpot (since you resolved a discussion), is this going anywhere? I deeply think it's useful and would like to see this in 4.4. The only thing left to do is to manage the constructor arguments of |
src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php
Outdated
Show resolved
Hide resolved
I also suggest rewording the PR title (which will appear in generated changelogs) and the commit message to talk about the feature being implemented. The profile stack is not the feature, but an internal implementation detail (proof is that the class is |
1645e5f
to
e634826
Compare
e634826
to
c8f9f69
Compare
@fancyweb thanks for working on this! About the new feature, I like it because it's a nice little DX improvement. About the technical details, I don't have a strong opinion. I'd like to add less code to implement this ... but this comment shows some compelling arguments against that ... so I'm divided. |
I still feel like that's a lot of code for the use case. |
@nicolas-grekas Your alternative idea seems very good actually. I will give it a try quickly. |
I suggest closing this PR in favor of #33783, which has several advantages IMO:
|
and btw, putting it in the controller also allows using this guessing in other links (we could make search results use it too). |
…el by default (fancyweb) This PR was merged into the 4.4 branch. Discussion ---------- [WebProfilerBundle] Try to display the most useful panel by default | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - Alternative to #32491, the goal stays the same. I think reserving a data collector name is fine, isn'it ? It's not likely that end users use this name (that's why I added an underscore) + shouldn't be hard for them to just rename it. I don't think adding a configuration option to toggle the "_best" behavior is useful, should be by default for DX IMHO. Not adding an extension point for now (for end users to set their panel as the "best"), maybe later if someone request it? Commits ------- a45dd98 [WebProfilerBundle] Try to display the most useful panel by default
So I did this quickly to get feedback. It could probably be splitted for clarity.
The goal of this work is to provide a better DX with Ajax requests in the WDT.
Having a private profile stack allow us to pass it to the
WebDebugToolbarListener
to process collected data and to directly build the profiler link with the useful panel.I think that adding a direct link to the dumps panel when there are dumps in an Ajax request would be very useful.
It would also impove the work done in #26665 by being sure there is actually an exception in the exception panel.
Since all impacted classes were made
@final
in 4.3, it is easy to drop the current behavior (ie remove the double usage of the$profiles
/ProfileStack
in theProfilerListener
and the optionalProfileStack
in theWebDebugToolbarListener
) and to fully switch to the new one in 5.0.👍 or 👎 ?