Skip to content

[Routing] Deprecate annotations in favor of attributes #49358

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

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Feb 13, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? yes
Tickets Follows #50888
License MIT
Doc PR 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.

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.

@derrabus
Copy link
Member Author

Failing tests are related. I'm looking into those later today.

@derrabus derrabus force-pushed the deprecate/route-annotations branch from 7bab4d6 to 38b3061 Compare July 5, 2023 15:26
@derrabus derrabus force-pushed the deprecate/route-annotations branch 5 times, most recently from 44c121f to 9737926 Compare July 14, 2023 22:17
@derrabus derrabus force-pushed the deprecate/route-annotations branch 3 times, most recently from ec7c82a to 09500a3 Compare July 15, 2023 22:42
nicolas-grekas added a commit that referenced this pull request Jul 20, 2023
…ration (derrabus)

This PR was merged into the 6.4 branch.

Discussion
----------

[FrameworkBundle] Deprecate doctrine/annotations integration

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | N/A
| License       | MIT
| Doc PR        | TODO

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:

```php
framework:
    annotations: false
```

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.

Commits
-------

2b3c954 [FrameworkBundle] Deprecate doctrine/annotations integration
@derrabus derrabus force-pushed the deprecate/route-annotations branch from 09500a3 to 680f0cc Compare July 20, 2023 14:45
@derrabus
Copy link
Member Author

PR is ready

@derrabus derrabus force-pushed the deprecate/route-annotations branch 3 times, most recently from 95a59e5 to 288437f Compare July 20, 2023 17:26
@derrabus
Copy link
Member Author

The failing tests on the high-deps run can be ignored. Those tests will pass as soon as the change hits 7.0.

@derrabus derrabus force-pushed the deprecate/route-annotations branch from 288437f to 6ce15f2 Compare July 22, 2023 23:18
@nicolas-grekas
Copy link
Member

deps=high failure is related isn't it?

@derrabus
Copy link
Member Author

deps=high failure is related isn't it?

#49358 (comment)

@alexislefebvre
Copy link
Contributor

alexislefebvre commented Jul 24, 2023

The failing tests on the high-deps run can be ignored. Those tests will pass as soon as the change hits 7.0.

Does it mean that the high-deps tests will fail for all the PRs until the release of 7.0 in November?

@derrabus
Copy link
Member Author

Does it mean that the high-deps tests will fail for all the PRs until the release of 7.0 in November?

No, they fail until 6.4 has been merged into 7.0. We can do that right after merging this PR.

@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas merged commit 32d4dfa into symfony:6.4 Jul 24, 2023
@derrabus derrabus deleted the deprecate/route-annotations branch July 24, 2023 11:18
fabpot added a commit that referenced this pull request Jul 26, 2023
This PR was merged into the 7.0 branch.

Discussion
----------

[Routing] Remove Doctrine annotations support

| Q             | A
| ------------- | ---
| Branch?       | 7.0
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Follows #49358
| License       | MIT
| Doc PR        | symfony/symfony-docs#18589

Commits
-------

4b10902 [Routing] Remove Doctrine annotations support
This was referenced Oct 21, 2023
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.

6 participants