Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Annotation routing in the core #25103

Copy link
Copy link
Closed
sensiolabs/SensioFrameworkExtraBundle
#562
sensiolabs/SensioFrameworkExtraBundle#562
@stof

Description

@stof
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 4.1

Currently, we have 2 separate annotation loaders for the routing: one in SensioFrameworkExtraBundle (SFEB) and one in FrameworkBundle (FB) which was added more recently. The component only has an abstract class (used by both).

The FB loader was added more recently (in 3.4), as we encouraged using annotation more and more and people wanting to have support in core. But it is missing a few features:

  • generated controller name is not as clean as the SFEB one when using __invoke (probably added in SFEB after the port to core, and not backported)
  • missing support for service id AFAIK (the core annotation does not have the service property)
  • SFEB supports extra @Method annotations (and its subclasses for @GET and @POST). I'm not sure how common they are. An option could be to deprecate them.

Having 2 diverging implementations makes maintenance harder (and enabling SFEB changes the loader being used, so adding a new feature in the FB loader is dangerous as installing SFEB would replace it, and the annotation Flex alias installs SFEB).

Here are my suggestions:

  • fix the support for __invoke in FB so that both loaders are in sync in 3.4 (I would consider it a bug that the implementation is different here)
  • evaluate the possibility for SFEB to extend the FB implementation so that it does not have to duplicate the logic (especially for future core features). Requires bumping min version to Symfony 3.4 in SFEB.
  • consider moving the AnnotatedRouteControllerLoader to the component rather than FB (there is nothing really specific to the bundle in it)
  • consider deprecating the SFEB routing layer (depends on the usage of @Route(service="...") and @Method()

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.