10000 [Documentation] Deprecate annotations by alexandre-daubois · Pull Request #18590 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Documentation] Deprecate annotations #18590

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

Conversation

alexandre-daubois
Copy link
Member

My take on #18589, feedbacks always welcome! 🙂

@carsonbot carsonbot added this to the 6.4 milestone Jul 20, 2023
Comment on lines -210 to -211
If your PHP version doesn't support attributes yet, use annotations, which is
similar but requires installing some extra dependencies in your project.
Copy link
Member

Choose a reason for hiding this comment

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

We can probably remove that paragraph from 6.2 as well. Symfony 6 does not support PHP versions that don't support attributes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines 301 to 303
.. deprecated:: 6.4

Annotations are deprecated since Symfony 6.4, use attributes instead.
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding this deprecation block, I'd remove the doctrine/annotations dependency from the command below. We should not recommend to install that package anymore fro new applications.

@@ -118,7 +118,6 @@ Markup Format Use It to Display
``html+twig`` Twig markup blended with HTML
``html+php`` PHP code blended with HTML
``ini`` INI
``php-annotations`` PHP Annotations
Copy link
Member

Choose a reason for hiding this comment

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

I think, we will have to keep this line as long as we still have examples with annotation syntax.

Comment on lines 231 to 233
.. deprecated:: 6.4

Annotations are deprecated since Symfony 6.4, use attributes instead.
Copy link
Member

Choose a reason for hiding this comment

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

No, just remove the addDefaultDoctrineAnnotationReader() call from the example above.

routing.rst Outdated
Comment on lines 2651 to 2653
.. deprecated:: 6.4

Annotations are deprecated since Symfony 6.4, use attributes instead.
Copy link
Member

Choose a reason for hiding this comment

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

Let's change the code snippets and the paragraph above to use the term "attribute(s)" instead of "annotation(s)" instead.

serializer.rst Outdated
.. _serializer-using-serialization-groups-attributes:

Using Serialization Groups Attributes
-------------------------------------

You can add :ref:`#[Groups] attributes <component-serializer-attributes-groups-annotations>`
You can add :ref:`#[Groups] attributes <component-serializer-attributes-groups-attributes>`
Copy link
Member

Choose a reason for hiding this comment

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

The extra whitespaces at the start of the line look like a mistake.

@alexandre-daubois alexandre-daubois force-pushed the doctrine-annotations-removal branch from 9918c6f to 0380429 Compare July 21, 2023 07:25
@alexandre-daubois
Copy link
Member Author

Thank you for the review @derrabus, PR updated 🙂

@javiereguiluz
Copy link
Member
javiereguiluz commented Jul 21, 2023

Alex, thanks for another stellar contribution 🙇 Thanks Alexander for your thorough review too!

While merging I did a minor change (see dc0ec9f) related to changes like this:

-.. _security-securing-controller-annotations:
+.. _security-securing-controller-attributes:

These internal references are publicly exposed as page anchors. E.g.: https://symfony.com/doc/current/security.html#security-securing-controller-annotations

If we remove the old reference, that anchor disappears and the link "breaks" (it doesn't break, but the user is not redirect to a specific section and that can be confusing).

For these reasons, we never delete internal references, we just add new ones. Thanks!

@alexandre-daubois
Copy link
Member Author

Got it, thank you for the explanation about link! 🙏

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.

4 participants
0