Make RecipeDiscovery swappable

Created on 3 August 2023, over 1 year ago
Updated 13 August 2024, 4 months ago

Problem/Motivation

A lot of the recipe classes are marked internal and final at the moment (which is fine IMO). One part that would be useful to provide swappability is the discovery. Enabling swappability for the discovery would allow constructing Drupal\Core\Recipe\Recipe objects from different sources. Examples of this could be recipes generated dynamically using PHP or recipes written in JSON.

Proposed resolution

Provide Drupal\Core\Recipe\RecipeDiscoveryInterface to allow overriding the recipe discovery.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Closed: won't fix

Version

11.0

Component

Code

Created by

🇫🇮Finland lauriii Finland

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

Comments & Activities

  • Issue created by @lauriii
  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States thejimbirch Cape Cod, Massachusetts
  • First commit to issue fork.
  • 🇨🇦Canada b_sharpe

    I believe this can be closed due to 📌 Move RecipeDiscovery into RecipeConfigurator Needs review

  • Status changed to Closed: won't fix 4 months ago
  • 🇺🇸United States phenaproxima Massachusetts

    This probably isn't going to happen, at least not in its current form.

    Recipes are not meant to be "discoverable" the way modules and themes are. They all need to live in one directory, as siblings. They can't contain other recipes. This is a very strict and intentional limitation of the way recipes are designed - it completely prevents the ambiguity that can occasionally bedevil modules and themes, which can be found in several different places and have a weird, idiosyncratic priority order when it comes to actually loading them into the runtime environment.

    The truth is, RecipeDiscovery is a terrible name for the class in core; it should be renamed something like RecipeLoader or similar, to better describe what it actually does.

    So, tentatively closing this as a wontfix.

Production build 0.71.5 2024