Add a feature flag for the procedural hooks bc layer

Created on 22 October 2024, 6 days ago

Problem/Motivation

Follow-up for 📌 OOP hooks using attributes and event dispatcher Needs review .

The bc layer for procedural hooks is quite expensive - needs to find and parse every file that could have a hook in it etc.

Once core is converted, it will be possible for a site to run without any procedural hook implementations at all.

I think we can add a feature flag, probably a container parameter would be best since it's used in container building, so that sites that are running fully converted to OOP hooks can disable the procedural hook discovery.

This in turn could let us keep the bc layer around longer, maybe until Drupal 13, maybe with the default reversed and instructions to enable it (or a feature flag module in the future).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

base system

Created by

🇬🇧United Kingdom catch

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

Comments & Activities

  • Issue created by @catch
  • 🇷🇺Russia Chi

    Once core is converted, it will be possible for a site to run without any procedural hook implementations at all.

    This requires that none of the installed contributed modules implement procedural hooks. Right?

  • 🇬🇧United Kingdom catch

    @chi yes that's right, possible not likely ;) I don't think any sites would be able to actually disable procedural hooks until 11.3 at the earliest or even later, but the end of the 11.x cycle maybe. Also if we want to leave the bc layer in until Drupal 13, we could keep it in 12.x this way, but with a status report mention that it's possible to disable (maybe even with some detection of whether it's being relied upon).

  • 🇫🇷France andypost

    ++ to option to skip procedural hooks parsing

Production build 0.71.5 2024