Skip to content
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

[RFC] Improve the way annotations are enabled #118

Closed
javiereguiluz opened this issue Jul 18, 2017 · 5 comments · Fixed by #179
Closed

[RFC] Improve the way annotations are enabled #118

javiereguiluz opened this issue Jul 18, 2017 · 5 comments · Fixed by #179

Comments

@javiereguiluz
Copy link
Member

In a Symfony Flex app, I expected to enable annotations by running this:

$ composer require annotations

However, that installs the symfony/annotation-pack, which only installs the low-level libraries needed for annotations (doctrine/cache and doctrine/annotations) but it doesn't really enable annotations in the application.


First, this was a problem because it crashed my browser, as reported here.

Second, even if this comment from config/routing.yaml is perfectly clear:

# Depends on sensio/framework-extra-bundle, doctrine/annotations, and doctrine/cache
#   install with composer req sensio/framework-extra-bundle annot

It's a bit disappointing that composer require annotations doesn't enable annotations and you must also execute composer require sensio/framework-extra-bundle


Solutions:

  • Maybe we should create a better recipe for annotations?
  • Maybe we should add annotations support in frameworkbundle and forget about the framework extra bundle?
@Pierstoval
Copy link
Contributor

symfony/annotations-pack is the base for annotations, but what you need is annotations for routing, so maybe a routing-annotations pack can be created, which will require sensio/framework-extra-bundle & symfony/annotations-pack?

@ogizanagi
Copy link
Member

Note that thanks to symfony/symfony#23044 and FQCN services, we already won't need the sensio/framework-extra-bundle anymore in 3.4, when flex will become the favored way to create a new symfony project.
I'm not sure we need anything else until this. As you said, the comment is self explanatory, and symfony/annotations-pack has nothing to do with routing. I don't think creating a new pack for this is worth it. WDYT?

@weaverryan
Copy link
Member

@ogizanagi If I understand you correctly, on 3.4, the user would only need to run composer require annotations (and uncomment out the annotations route import) in order for @Route annotations to work? Is that correct?

Btw, if that's true, what about @Method? I only see this annotation in FWExtraBundle, not Symfony core.

Thanks :)

@ogizanagi
Copy link
Member

ogizanagi commented Aug 27, 2017

the user would only need to run composer require annotations (and uncomment out the annotations route import) in order for @Route annotations to work

True :)


Btw, if that's true, what about @Method? I only see this annotation in FWExtraBundle, not Symfony core.

True again. the @Method annotation isn't part of the core. But it's just a shortcut annotation; you can already configure the methods within the @Route annotation (@Route("foo", methods={"GET"})), so it's probably not a reason good enough to install the FWExtraBundle.

@fabpot
Copy link
Member

fabpot commented Sep 15, 2017

fixed by #179

@fabpot fabpot closed this as completed Sep 15, 2017
VolCh pushed a commit to VolCh/recipes that referenced this issue Nov 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants