-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle][WebProfilerBundle] Move ProfilerPass to the WebProfiler bundle #21368
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
2c03f03
to
08c0e9e
Compare
@@ -34,6 +34,9 @@ FrameworkBundle | |||
--------------- | |||
|
|||
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been deprecated. Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead. | |||
|
|||
* The `ProfilerPass` class has been deprecated and will be removed in 4.0, use the | |||
`Symfony\Bundle\WebProfilerBundle\DependencyInjection\ProfilerPass` class instead. |
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.
This is missing the Compiler
part of the namespace.
@@ -156,6 +156,9 @@ FrameworkBundle | |||
|
|||
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been removed. Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead. | |||
|
|||
* The `ProfilerPass` class has been removed, use the |
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.
same here
@@ -74,7 +74,10 @@ public function build(ContainerBuilder $container) | |||
parent::build($container); | |||
|
|||
$container->addCompilerPass(new RoutingResolverPass()); | |||
$container->addCompilerPass(new ProfilerPass()); | |||
if (class_exists(AddConsoleCommandPass::class)) { |
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.
This change does not look related to the goal of the PR.
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're right, this will be deleted.
if (class_exists(AddConsoleCommandPass::class)) { | ||
$container->addCompilerPass(new AddConsoleCommandPass()); | ||
} | ||
$this->addCompilerPassIfExists($container, ProfilerPass::class); |
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 have to specify the FQCN of an alternative implementation (the already existing one) that will be used as a fallback to provide backwards compatibility.
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're saying that I should write
if (class_exists(ProfilerPass::class)) {
$container->addCompilerPass(new ProfilerPass());
}
and duplicate the code ?
or just say somewhere that I took this part of the code from #21283 which has already been reviewed ?
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.
Or do I have to link to the old Implementation ?
or the last chance, make an if/else to import the new one or the old one ?
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.
@xabbuh In fact this doesn't expect a fallback. For the AddConsoleCommandPass, we just added a conflict to the frameworkbundle so that it is always available (it was your suggestion #19443 (comment)). I started to do the same for the FormPass (#21283) and SerializerPass(#21293), is it ok to do the same here or should we fallback to the deprecated one and mute deprecation instead?
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 are right. Adding the conflict rule should be the solution here too.
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\WebProfilerBundle\DependencyInjection; |
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.
Should be moved to the Compiler
subnamespace.
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.
Should I change only the namespace or move the file in a subdirectory ?
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.
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.
In AddConsoleCommandPass
you were moving the file from Symfony\Bundle\FrameworkBundle
to the component.
Here I am moving the file from Symfony\Bundle\FrameworkBundle
to Symfony\Bundle\WebProfilerBundle
.
After a short looking I figured that every "Bundle" in that namespace have a repository Compiler
in there DI
folder so I think in that case I should move it in a subfolder.
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.
Indeed, the Compiler subnamespace seems to concern bundles only, sorry.
#21284 should not be closed after this, it will only be partially fixed. |
@chalasr I updated the description to reflect that. |
08c0e9e
to
3afe8a2
Compare
@xabbuh, @chalasr, I did a mistake while commiting validated fixes, this discussion still open |
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.
The FrameworkBundle's composer.json needs a conflict rule for "symfony/web-profiler-bundle": "<3.3"
, and its changelog needs a mention for the deprecated pass.
9967d97
to
904b3e8
Compare
The conflict line has been added in the composer.json file and a note in the changelog of the FrameworkBundle. |
904b3e8
to
a970440
Compare
@@ -57,7 +57,8 @@ | |||
"conflict": { | |||
"phpdocumentor/reflection-docblock": "<3.0", | |||
"phpdocumentor/type-resolver": "<0.2.0", | |||
"symfony/console": "<3.3" | |||
"symfony/console": "<3.3", | |||
"symfony/web-profiler-bundle": "<3.3" |
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.
"symfony/web-profiler-bundle": "~3.3"
must be added as dev requirement in addition of the conflict, that should make the build green.
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.
That's what I figured in your comment .
The fix is coming.
3c7e18f
to
ebe2b93
Compare
ebe2b93
to
f98739b
Compare
-1 for this. the configuration to enable the profiler itself is also part of FrameworkBundle. WebProfilerBundle is currently only responsible for building a UI for the profiler, not for integrating the profiler itself. |
Closing as this is indeed wrong. |
This MR is part of the #21284 todo list