Deprecate using a PHP class as SDC property type

Created on 17 March 2025, 7 months ago

Problem/Motivation

This started as a discussion in Allow class types in item properties in SDC Active .
It is possible to use a PHP class as the type of a component property.
However, this only works on root properties (which is confusing) and we have to do some weird manipulations to get this working with the JSON schema validation.
Allowing only scalar types would make the code cleaner and more in line with the way the json-schema library works.

Steps to reproduce

See this component for example:

$schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json
name: Main menu
description: Menu main
props:
  type: object
  properties:
    attributes:
      title: "Attributes"
      type: Drupal\Core\Template\Attribute

Proposed resolution

We could deprecate using a PHP class as property type.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

theme system

Created by

🇫🇷France prudloff Lille

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

Merge Requests

Comments & Activities

  • Issue created by @prudloff
  • Merge request !13360Add deprecation → (Open) created by prudloff
  • Pipeline finished with Failed
    10 days ago
    Total: 188s
    #614146
  • Pipeline finished with Canceled
    10 days ago
    Total: 154s
    #614173
  • Pipeline finished with Failed
    10 days ago
    Total: 307s
    #614175
  • Pipeline finished with Failed
    10 days ago
    Total: 161s
    #614184
  • Pipeline finished with Failed
    9 days ago
    Total: 438s
    #615533
Production build 0.71.5 2024