Skip to content

Undeprecate the single-colon controller notation #29218

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
Nov 15, 2018

Conversation

stof
Copy link
Member

@stof stof commented Nov 14, 2018

Q A
Branch? 4.1
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a (in core)
License MIT
Doc PR n/a

This notation is the only way to support controllers as services in the 3.4 LTS version.
This deprecation has only a very small benefit for the Symfony codebase (the amount of code involved is very small), but has a huge cost for the community which cannot avoid this deprecation without dropping support for the LTS or making crazy logic to switch routing files (as they cannot switch things inline in YAML or XML files).
This deprecation will be delayed until a future 5.x version, when the current LTS will be 4.4 (which supports the new notation).

This PR is based on a discussion I had with @nicolas-grekas a few days ago about the cost of that deprecation for the community.

For instance, in FOSUserBundle, a PR got merged which duplicates the routing files with new files using the new notation, allowing people to opt-out from the deprecation, while the original files cannot be migrated without dropping support for the LTS (which is bad for the concept of LTS, as its usefulness is severally impacted if the ecosystem does not support it). But that's a bad solution for the future, as the bundle would have to keep 2 files forever (well, until next major) to avoid breaking projects referencing the new files. And most open-source bundles providing routes are faced with this challenge.

This is sent to 4.1, so that projects using 4.1 can become deprecation-free for these community bundles when using the latest 4.1 release too (meaning FOSUserBundle could revert this PR before the next release for instance)

@stof stof added this to the 4.1 milestone Nov 14, 2018
@nicolas-grekas
Copy link
Member

4.2?

@stof
Copy link
Member Author

stof commented Nov 14, 2018

@nicolas-grekas see the last paragraph.

@nicolas-grekas
Copy link
Member

Works either for 4.2 or 4.1 to me. 4.2 feels more natural since it's almost a "new feature". Also because projects that are on 4.1 either already moved to deprecation-less - or can skip 4.1 altogether. Makes sense?

@stof
Copy link
Member Author

stof commented Nov 14, 2018

@nicolas-grekas if 4.1 keeps that deprecation, community bundles wanting to support both the 3.4 LTS and 4.1 (current stable) still have to pay the cost.

And no, shared bundles have not all moved to be deprecation-free in their released versions, as there is no easy way for that.

Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

This notation is the only way to support controllers as services in the 3.4
LTS version.
This deprecation has only a very small benefit for the Symfony codebase (the
amount of code involved is very small), but has a huge cost for the community
which cannot avoid this deprecation without dropping support for the LTS or
making crazy logic to switch routing files (as they cannot switch things
inline in YAML or XML files).
This deprecation will be delayed until a future 5.x version, when the current
LTS will be 4.4 (which supports the new notation).
@stof stof force-pushed the undeprecate_controller_notation branch from e578c92 to 453efdf Compare November 15, 2018 09:34
@stof stof merged commit 453efdf into symfony:4.1 Nov 15, 2018
stof added a commit that referenced this pull request Nov 15, 2018
This PR was merged into the 4.1 branch.

Discussion
----------

Undeprecate the single-colon controller notation

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a (in core)
| License       | MIT
| Doc PR        | n/a

This notation is the only way to support controllers as services in the 3.4 LTS version.
This deprecation has only a very small benefit for the Symfony codebase (the amount of code involved is very small), but has a huge cost for the community which cannot avoid this deprecation without dropping support for the LTS or making crazy logic to switch routing files (as they cannot switch things inline in YAML or XML files).
This deprecation will be delayed until a future 5.x version, when the current LTS will be 4.4 (which supports the new notation).

This PR is based on a discussion I had with @nicolas-grekas a few days ago about the cost of that deprecation for the community.

For instance, in FOSUserBundle, a [PR](FriendsOfSymfony/FOSUserBundle#2853) got merged which duplicates the routing files with new files using the new notation, allowing people to opt-out from the deprecation, while the original files cannot be migrated without dropping support for the LTS (which is bad for the concept of LTS, as its usefulness is severally impacted if the ecosystem does not support it). But that's a bad solution for the future, as the bundle would have to keep 2 files forever (well, until next major) to avoid breaking projects referencing the new files. And most open-source bundles providing routes are faced with this challenge.

This is sent to 4.1, so that projects using 4.1 can become deprecation-free for these community bundles when using the latest 4.1 release too (meaning FOSUserBundle could revert this PR before the next release for instance)

Commits
-------

453efdf Undeprecate the single-colon notation for controllers
@stof stof deleted the undeprecate_controller_notation branch November 15, 2018 10:10
nicolas-grekas added a commit that referenced this pull request Dec 1, 2018
…urigault)

This PR was merged into the 4.1 branch.

Discussion
----------

undeprecate the single-colon notation for controllers

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This is the same as #29218 but for `Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader`.

Commits
-------

09371ad undeprecate the single-colon notation for controllers
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.

7 participants