Deprecate using a PHP class as SDC property type

Created on 17 March 2025, 20 days 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

Comments & Activities

Production build 0.71.5 2024