Decouple image (URI) shape matching from specific image file types/extensions

Created on 16 June 2025, 8 days ago

Overview

As recently pointed out by @isholgueras on the MR for šŸ› Img prop constraints require extension to be lower case Active , the current 3.1.2.a structured data → matching field instances ⇒ dynamic prop source infrastructure for matching and <code>$ref: json-schema-definitions://experience_builder.module/image, which rely on this:

    "image-uri": {
      "title": "Image URL",
      "type": "string",
      "format": "uri-reference",
      "pattern": "^(/|https?://)?.*\\.(png|gif|jpg|jpeg|webp)(\\?.*)?(#.*)?$"
    },

getting matched against Drupal core's (semantically equivalent) FileExtension validation constraint, which necessarily requires translating from/to two wildly different representations.

The key problem: the list of file extensions is hardcoded. Which means customizations to the list of allowed image types would be a problem. Recently, AVIF support landed in 🌱 [Meta] High-performance images (nearly) out of the box Active , which shows how likely this is to happen over time.

The current code dates back to April 2024, _before_ we had even started using d.o issues. This is some of the oldest code in XB and dates back to the research__data_model PoC research branch.

Proposed resolution

User interface changes

šŸ“Œ Task
Status

Active

Version

0.0

Component

Shape matching

Created by

šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024