Problem/Motivation

In #3252386: Use PHP attributes instead of doctrine annotations we switched to parsing annotations before attributes. This is not great for performance when core is converted.

At some point in the future, potentially around the time 11.0.0 is released, most contrib will also be converted, and then it'll be even worse for performance.

Opening to see if we can switch the order back again, for example in 10.4.0 or 10.5.0

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3397318

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

catch created an issue. See original summary.

claudiu.cristea’s picture

Title: Parse attributes before annotations » [PP-1] Parse attributes before annotations
Status: Active » Postponed
Related issues: +#3502913: Add a fallback classloader that can handle missing traits for attribute discovery
godotislate’s picture

Title: [PP-1] Parse attributes before annotations » Parse attributes before annotations
Status: Postponed » Active

godotislate’s picture

claudiu.cristea’s picture

Do we need a test to prove it?

godotislate’s picture

Wasn't sure tests were necessary, but it was relatively low lift, so added them.

claudiu.cristea’s picture

Issue tags: +Needs change record

Great. I was looking to the MR and everything looks good. I think we still miss a CR because some sites might rely on annotations precedence. I know, very unlikely, but let's add a record to announce this change.

godotislate’s picture

claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

Thank you. This looks and works as expected

catch’s picture

Status: Reviewed & tested by the community » Needs work

Yeah agreed with the CR, seems possible that an incorrect attribute that was being ignored would start to cause problems.

I nearly went to commit this, but I think there is one comment in the test where annotation and attribute are reversed. If that's the issue, please feel free to self-RTBC after fixing it. I theoretically could have changed it on commit but would rather get confirmation that's just a typo and not anything else.

godotislate’s picture

Status: Needs work » Needs review

I nearly went to commit this, but I think there is one comment in the test where annotation and attribute are reversed.

Replied in MR, but comment looks correct to me. The plugin manager in that test case only looks at annotations, so for the plugin that has both, the annotation gets picked up. If that's unclear, I'm open to changes.

catch’s picture

Status: Needs review » Reviewed & tested by the community

ohhh I see. OK back to RTBC, thanks for clarifying.

  • catch committed 6173817f on 11.x
    Issue #3397318 by godotislate, claudiu.cristea, catch: Parse attributes...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

claudiu.cristea’s picture

Published the CR

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.