-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Deprecate doctrine/annotations integration #50888
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
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/default_config.php
Outdated
Show resolved
Hide resolved
7741661
to
336d0a1
Compare
45a4183
to
3387235
Compare
I don't have the whole thing in my head. Is it necessary to add the Self-reply: it's documented in FrameworkBundle's changelog. |
3387235
to
e0b4c95
Compare
No. Long answer: Unfortunately, we currently enable the annotations integration by default if the |
@derrabus regarding the "unlocking" part, shouldn't we actually first deprecate annotations in components and then deprecate the FrameworkBundle integration configuring a reader only once we don't rely on it anymore ? |
That was my first approach, but I think it's easier this way. This PR is self-contained: If we merge it and remove the integration in 7.0, the components might still support Doctrine annotations, but FrameworkBundle won't have a way to enable them. Removing a feature that FrameworkBundle doesn't use should be easy. 🙂 |
@derrabus but the DX would be worse as devs would not get deprecation warnings telling them where they still use annotations, which they should solve before disabling them. |
e0b4c95
to
bbb95eb
Compare
#49358, #50982 and #50983 trigger the deprecations you want.
This is kinda a chicken-egg problem. I'm working on removing annotations everywhere and I believe we both agree on how the end result should look like. Unless we want to discuss a big all-or-nothing PR, I think we can live with this DX flaw, knowing we will resolve it before 6.4. |
bbb95eb
to
30bd8d8
Compare
30bd8d8
to
7cae682
Compare
ea0b7a2
to
6ef6b5b
Compare
...Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php
Outdated
Show resolved
Hide resolved
...ameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflow_with_no_events_to_dispatch.xml
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
Outdated
Show resolved
Hide resolved
...Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/serializer_mapping.yml
Outdated
Show resolved
Hide resolved
6ef6b5b
to
1d3e0c6
Compare
1d3e0c6
to
2b3c954
Compare
Thank you @derrabus. |
…ion (derrabus) This PR was merged into the 7.0 branch. Discussion ---------- [FrameworkBundle] Remove doctrine/annotations integration | Q | A | ------------- | --- | Branch? | 7.0 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Follows #50888 | License | MIT | Doc PR | TODO, see symfony/symfony-docs#18589 Commits ------- 713ff44 [FrameworkBundle] Remove doctrine/annotations integration
…tes (derrabus) This PR was merged into the 6.4 branch. Discussion ---------- [Serializer] Deprecate annotations in favor of attributes | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | Follows #50888 | License | MIT | Doc PR | TODO, see symfony/symfony-docs#18589 This PR deprecates using Doctrine annotations to configure serialization. Attributes shall be used instead. Existing applications can be migrated easily using [Rector](https://getrector.com/blog/how-to-upgrade-annotations-to-attributes). Deprecation errors triggered by the bundles' functional tests will be resolved once #50888 is merged. Commits ------- 9b7b397 [Serializer] Deprecate annotations in favor of attributes
…tes (derrabus) This PR was merged into the 6.4 branch. Discussion ---------- [Serializer] Deprecate annotations in favor of attributes | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | Follows #50888 | License | MIT | Doc PR | TODO, see symfony/symfony-docs#18589 This PR deprecates using Doctrine annotations to configure serialization. Attributes shall be used instead. Existing applications can be migrated easily using [Rector](https://getrector.com/blog/how-to-upgrade-annotations-to-attributes). Deprecation errors triggered by the bundles' functional tests will be resolved once symfony/symfony#50888 is merged. Commits ------- 9b7b397ec4 [Serializer] Deprecate annotations in favor of attributes
…es (derrabus) This PR was merged into the 6.4 branch. Discussion ---------- [Validator] Deprecate annotations in favor of attributes | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | Follows #50888 | License | MIT | Doc PR | TODO, see symfony/symfony-docs#18589 This PR deprecates using Doctrine annotations to configure validation constraints. Attributes shall be used instead. Existing applications can be migrated easily using [Rector](https://getrector.com/blog/how-to-upgrade-annotations-to-attributes). Deprecation errors triggered by the bundles' functional tests will be resolved once #50888 is merged. Commits ------- 6b6dc62 [Validator] Deprecate annotations in favor of attributes
… (derrabus) This PR was merged into the 6.4 branch. Discussion ---------- [Routing] Deprecate annotations in favor of attributes | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | Follows #50888 | License | MIT | Doc PR | TODO, see symfony/symfony-docs#18589 This PR deprecates the integration of Doctrine Annotations for the Routing component. Attributes are the way to go now if we want to annotate controllers with routing information. Existing applications can be migrated easily using [Rector](https://getrector.com/blog/how-to-upgrade-annotations-to-attributes). Thus I believe that keeping support for oldschool Doctrine Annotations is not necessary anymore. If this PR is accepted, I would work on a follow-up that renames all `Annotation*Loader` classes because the names of those classes are probably misleading as soon as they support attributes only. Commits ------- 6ce15f2 [Routing] Deprecate annotations in favor of attributes
This PR deprecates the integration of the doctrine/annotations package in FrameworkBundle. Currently, the integration is enabled by default if
doctrine/annotations
is installed. This PR adds a runtime deprecation if the app does not explicitly disable it by setting:The plan is to make this the default and only valid option in Symfony 7 and remove that setting entirely in Symfony 8. This change unlocks #49358 and similar PRs that remove support for Doctrine Annotations from components.