Convert annotations to attributes

Created on 27 June 2025, 6 days ago

Problem/Motivation

Attributes are faster than annotation. Annotation is deprecated.

Steps to reproduce

Proposed resolution

Convert annotations to attributes

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States bluegeek9

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bluegeek9
  • 🇮🇪Ireland lostcarpark

    Before proceeding we need to decide our target minimum version:

    • Drupal 10.2: Supports attributes for Blocks and Actions (see CR 3395575 ). I don't think either are currently used in CRM.
    • Drupal 10.3: Adds attributes for a long list of objects, including Constraint, ViewsField, ViewsQuery used by CRM. See CR 3229001 for the full list.
    • Drupal 11.1: Adds attributes for ContentEntity and ConfigEntity. These are the bulk of annotations in CRM. See CR 3505422 .

    So if we need to support D10, we can only convert plugin attributes for now. We may wish to maintain support for D10 until its end of life in summer 2026. We would need to increase the minimum supported version to 10.3, but earlier versions are out of support anyway.

    If we would like to convert entity annotations, it means raising our minimum supported version to 11.1. This may be acceptable if we consider it's a new module, and the majority of sites using CRM may be Drupal CMS sites, which will be D11 based from the outset.

  • Pipeline finished with Success
    about 9 hours ago
    Total: 252s
    #538333
  • 🇮🇪Ireland lostcarpark

    To start this off, I have converted the annotations to attributes for plugins.

    I'm leaving entities until we decide what our minimum supported Drupal version is.

  • 🇮🇪Ireland lostcarpark

    At Member Platform Zoom meeting, 3 Jul, the issue was discussed, and most agreed that it is better to comply with latest standards than support all possible versions of Drupal.

    It was also mentioned that CRM module is targeting a stable release for DrupalCon Chicago, which should be only a few months from D10 end of life.

    On this basis, I'm going to continue working on converting entity annotations to attributes, and bump the minimum supported version to 11.1.

Production build 0.71.5 2024