Skip to content

[DI] Deprecate dumping an uncompiled container #20634

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

Closed
wants to merge 2 commits into from
Closed

[DI] Deprecate dumping an uncompiled container #20634

wants to merge 2 commits into from

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Nov 25, 2016

Q A
Branch? "master"
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #19673 (comment)
License MIT
Doc PR reference to the documentation PR, if any

It makes the PHP dumper less complex. Compiled container goes in, compiled container goes out.

Relates to #19673

@fabpot
Copy link
Member

fabpot commented Nov 25, 2016

Why? Dumping a container to YAML or XML is perfectly valid for a non-compiled container. How is that a bug fix?

@nicolas-grekas
Copy link
Member

This is not a bug fix for sure.
Without compiler passes applied, the container is really in some intermediary "bootstrapping" state. For XML & Yaml, we don't care. But for the PhpDumper?
Anyway, I've no strong opinion on this, I'm just explaining the reasoning I had :-)

@ro0NL
Copy link
Contributor Author

ro0NL commented Nov 26, 2016

Updated. I think indeed it make no sense for YAML, etc.

Also no strong opinion on this (as compared to #19673) however it would simplify the PHP Dumper in 4.0 a lot.

Also tests are unclear about this, some call compile beforehand others dont.

@nicolas-grekas
Copy link
Member

it would simplify the PHP Dumper in 4.0 a lot.

I forgot to mention this argument and it was really the beginning of the idea: PhpDumper is already complex enough, there is no need to have all these !isFrozen code paths in the code. Thus I'm 👍 (when tests will be green of course).

@ro0NL
Copy link
Contributor Author

ro0NL commented Nov 26, 2016

There are some bottlenecks.. which im not sure how to solve;

Dumping an uncompiled ContainerBuilder is deprecated since version 3.3 and will not be supported anymore in 4.0. Compile the container beforehand: 7x
    2x in PhpDumperTest::testAddService from Symfony\Component\DependencyInjection\Tests\Dumper
    2x in PhpDumperTest::testDump from Symfony\Component\DependencyInjection\Tests\Dumper
    1x in PhpDumperTest::testDumpAutowireData from Symfony\Component\DependencyInjection\Tests\Dumper
    1x in PhpDumperTest::testAddParameters from Symfony\Component\DependencyInjection\Tests\Dumper
    1x in PhpDumperTest::testServicesWithAnonymousFactories from Symfony\Component\DependencyInjection\Tests\Dumper

Basically all service fixtures (Fixtures/php/) must be revised to compiled containers. ie. testAddService tests both variants rather explicitly (services9.php vs services9_compiled.php).

We need to separate these tests for legacy and add a services[0-9]_compiled.php variant for each one. Right?

Im still 👍 for deprecating this feature though.

PhpDumper is already complex enough, there is no need to have all these !isFrozen code paths in the code

Agree, this makes it a real burden to maintain.

@nicolas-grekas nicolas-grekas added this to the 3.x milestone Dec 6, 2016
@fabpot
Copy link
Member

fabpot commented Dec 13, 2016

👍 for doing this on PhpDumper only.

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 18, 2016

Looks like tests are passing :)

@fabpot
Copy link
Member

fabpot commented Dec 19, 2016

Thank you @ro0NL.

@fabpot fabpot closed this in ed5b1d8 Dec 19, 2016
@ro0NL ro0NL deleted the patch-2 branch December 19, 2016 08:49
fabpot added a commit that referenced this pull request Dec 19, 2016
…guiluz)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] update changelog and upgrade files

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20634
| License       | MIT
| Doc PR        |

Commits
-------

ad7afe0 Added a needed blank line
d2b4996 [DI] update changelog and upgrade files
@nicolas-grekas nicolas-grekas modified the milestones: 3.x, 3.3 Mar 24, 2017
@fabpot fabpot mentioned this pull request May 1, 2017
nicolas-grekas added a commit that referenced this pull request May 22, 2017
… (ro0NL)

This PR was merged into the 4.0-dev branch.

Discussion
----------

[DI] Remove deprecated dumping an uncompiled container

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | should be
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

See #20634

Commits
-------

c1c525c [DI] Remove deprecated dumping an uncompiled container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants