-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[WebProfilerBundle] turbolinks compatibility #11504
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
[WebProfilerBundle] turbolinks compatibility #11504
Conversation
@DraCzris What's turbolinks? It looks like a ruby on rails feature? Is it something else? How does it relate to Symfony? Thanks! |
more info on turbolinks and how those could be used with Symfony: #7410 |
@weaverryan PHP port of ruby on rails turbolinks - https://github.com/helthe/Turbolinks |
I'm not a big fan of adding things that seems very specific and not widespread/standard. |
@@ -1,6 +1,6 @@ | |||
<!-- START of Symfony2 Web Debug Toolbar --> | |||
{% if 'normal' != position %} | |||
<div id="sfMiniToolbar-{{ token }}" class="sf-minitoolbar"> | |||
<div id="sfMiniToolbar-{{ token }}" class="sf-minitoolbar" data-no-turbolink> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make this more general by using a block or variable that can be set in an extending template.
This file.
<div id="sfMiniToolbar-{{ token }}" class="sf-minitoolbar" {{ attributes_overwrite|default('')|raw }}>
Child template in app/or bundle (overwrites original using bundle inheritance).
{% extends '@WebProfilerBundle/Profiler/toolbar.html.twig' %}
{% set = attributes_overwrite=' data-no-turbolink' %}
This way its less one solution focused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sstok I like this solution very much. I was just thinking to add possibility to add classes to profiler wrapper, but for javascript libraries this looks even better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sstok I agree that using a variable is a more generic solution. However, what would you think about replacing attributes_overwrite
variable name by custom_attributes
? The first name sounds like a verb (overwrite) instead of a noun. Moreover, you could add new attributes instead of rewrite the existing ones, so the first variable name could be inaccurate for some cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just suggestion, better naming is welcome ;)
What do we do here? I can see two options here: merge as is or close it (I'm not a big fan of adding yet another configuration point.) |
I guess it does not hurt to merge this afterall. |
This PR was merged into the 2.3 branch. Discussion ---------- [WebProfilerBundle] turbolinks compatibility | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | - | License | MIT | Doc PR | - Fix profiler when using turbolinks. (Without this, profiler is rendered without assets) Commits ------- c65b4c7 [WebProfilerBundle] turbolinks compatibility
…Czris) This PR was merged into the 2.3 branch. Discussion ---------- [WebProfilerBundle] turbolinks compatibility | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | - | License | MIT | Doc PR | - Fix profiler when using turbolinks. (Without this, profiler is rendered without assets) Commits ------- c65b4c7 [WebProfilerBundle] turbolinks compatibility
Fix profiler when using turbolinks. (Without this, profiler is rendered without assets)