Skip to content

Consider renaming pattern to path in the routing component #5989

Closed
fabpot opened this Issue Nov 12, 2012 · 10 comments

6 participants

@fabpot
Symfony member
fabpot commented Nov 12, 2012

As of today, we have two patterns: one for the path (pattern) and another one for the host (hostname_pattern).

In #3378, it was suggested to rename pattern to path and hostname_pattern to hostname.

That's fine by me, but of course, we will keep pattern support even after the LTS release (which should not be a problem). The documentation for 2.2 will of course only use the new name.

What others think?

@Seldaek
Symfony member
Seldaek commented Nov 12, 2012

:+1: from me, hoping that it doesn't create too much confusion in the future.

@alvarezmario

:+1: for the change. I don't really see the need of the _patern suffix just to clarify that you can use variables and requirements. It only need to be put on the docs and nothing more. You can also use variables and requirements in _locale and is not named _locale_pattern

@Tobion
Symfony member
Tobion commented Nov 12, 2012

:+1: as it makes it much things much clearner. Otherwise one does't know what pattern belongs to (could be anything).

@Tobion
Symfony member
Tobion commented Nov 12, 2012

@nomack84: No, you cannot "use variables in _locale". _locale is a variable for itself. So your argument with _locale_pattern is not valid.

@alvarezmario

@Tobion right :) but even so, the docs are enough.

@schmittjoh
@Tobion
Symfony member
Tobion commented Nov 12, 2012

@schmittjoh until now, there could not be any confusion as there was only one "pattern" available. But now that we have 2, the current naming is really confusing.

@schmittjoh

I'm aware of the hostname change, and personally I don't have that confusion.

@Tobion
Symfony member
Tobion commented Nov 12, 2012

I opened another RFC that improves the route definition: #5990

@fabpot fabpot referenced this issue Jan 14, 2013
Merged

Routing options #6738

@fabpot fabpot added a commit that referenced this issue Jan 15, 2013
@fabpot fabpot merged branch fabpot/routing-options (PR #6738)
This PR was merged into the master branch.

Commits
-------

9fc7def added the UPGRADE file for Symfony 3.0
e84cad2 [Routing] updated CHANGELOG
65eca8a [Routing] added new schemes and methods options to the annotation loader
5082994 [Routing] renamed pattern to path
b357caf [Routing] renamed hostname pattern to just hostname
e803f46 made schemes and methods available in XmlFileLoader
d374e70 made schemes and methods available in YamlFileLoader
2834e7e added scheme and method setter in RouteCollection
10183de make scheme and method requirements first-class citizen in Route

Discussion
----------

Routing options

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #5989, #5990, #6049
| License       | MIT

In #5989, it has unanimously been decided to renamed `hostname_pattern` to `hostname` and `pattern` to `path`. That makes a lot of sense and I would like to do the renaming now as `hostname_pattern` is new in Symfony 2.2, so I'd like to avoid breaking BC just after the release. As we are modifying the route options, I've also included changes introduced by @Tobion in #6049 which were discussed in #5990.

As everything is BC, I think it's wise to include that in 2.2. What do you think?

---------------------------------------------------------------------------

by Tobion at 2013-01-14T18:25:53Z

I agree it should be done in 2.2. Thanks for working on it.

---------------------------------------------------------------------------

by vicb at 2013-01-14T23:11:12Z

@fabpot "Everything is BC" until it breaks BC in 3.0, that's why I'd like to see [deprecations in PR summary](symfony/symfony-docs#2116) what do you think ?

---------------------------------------------------------------------------

by vicb at 2013-01-14T23:16:40Z

it would also be great to update the CHANGELOG with deprecations (it could also help people answering your question)

---------------------------------------------------------------------------

by fabpot at 2013-01-15T07:07:03Z

@vicb: I've just updated the CHANGELOG and created the UPGRADE file for 3.0.

---------------------------------------------------------------------------

by vicb at 2013-01-15T07:15:32Z

@fabpot thanks.
89f9b24
@fabpot fabpot closed this Jan 15, 2013
@mmucklo mmucklo pushed a commit that referenced this issue May 23, 2013
@fabpot fabpot merged branch fabpot/routing-options (PR #6738)
This PR was merged into the master branch.

Commits
-------

9fc7def added the UPGRADE file for Symfony 3.0
e84cad2 [Routing] updated CHANGELOG
65eca8a [Routing] added new schemes and methods options to the annotation loader
5082994 [Routing] renamed pattern to path
b357caf [Routing] renamed hostname pattern to just hostname
e803f46 made schemes and methods available in XmlFileLoader
d374e70 made schemes and methods available in YamlFileLoader
2834e7e added scheme and method setter in RouteCollection
10183de make scheme and method requirements first-class citizen in Route

Discussion
----------

Routing options

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #5989, #5990, #6049
| License       | MIT

In #5989, it has unanimously been decided to renamed `hostname_pattern` to `hostname` and `pattern` to `path`. That makes a lot of sense and I would like to do the renaming now as `hostname_pattern` is new in Symfony 2.2, so I'd like to avoid breaking BC just after the release. As we are modifying the route options, I've also included changes introduced by @Tobion in #6049 which were discussed in #5990.

As everything is BC, I think it's wise to include that in 2.2. What do you think?

---------------------------------------------------------------------------

by Tobion at 2013-01-14T18:25:53Z

I agree it should be done in 2.2. Thanks for working on it.

---------------------------------------------------------------------------

by vicb at 2013-01-14T23:11:12Z

@fabpot "Everything is BC" until it breaks BC in 3.0, that's why I'd like to see [deprecations in PR summary](symfony/symfony-docs#2116) what do you think ?

---------------------------------------------------------------------------

by vicb at 2013-01-14T23:16:40Z

it would also be great to update the CHANGELOG with deprecations (it could also help people answering your question)

---------------------------------------------------------------------------

by fabpot at 2013-01-15T07:07:03Z

@vicb: I've just updated the CHANGELOG and created the UPGRADE file for 3.0.

---------------------------------------------------------------------------

by vicb at 2013-01-15T07:15:32Z

@fabpot thanks.
a5dd77c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.