Editor-only stylesheets fragment into one file per producer (9 of 30 theme CSS files on a 4-route site)

Abierto
#7,218 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
php
Área
performance

Línea de trabajo

Start with the onlyplants WORKFLOW notes mentioned in the issue and inspect EditorCanvasStylesheets::split, NavigationStyleProjector, and EvidenceRouteStylesheets::retire. Compare the two proposed approaches against the enqueue order and retirement behavior. Done means reducing editor-only stylesheet file count while preserving cascade order and correct retirement; the issue does not name a test or validation command.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

On the onlyplants import (4 routes, SSI proportionate_assets reports css_file_count 30 against a cap of 20), 9 of the 30 theme CSS files are loaded only in the editor. Visitors never request them, but each one is a separate file on disk and a separate request in the editor canvas:

Generator Files Bytes each
EditorCanvasStylesheets::split: .editor-canvas.css extracts 6 242, 272, 280, 547, 1096, 1748
NavigationStyleProjector → editor-static-state-*, written per page as two sheets that differ only by source_role (engine-owned or not) 2 778, 1094
editor-static-state shared-chrome-* (global, engine-owned) 1 231

Four of the extracts are under 600 bytes, just above MIN_EXTRACT_BYTES = 200. The two per-page editor-static-state sheets share scope, placement (after-author) and target (editor), and are enqueued one after the other.

Expected

Editor-only rules that one route loads in one cascade run should arrive as one file, not one file per producer. Two options, either one rendering-neutral:

  • Concatenate adjacent editor-only sheets that have the same scopes, placement and media. Concatenating in enqueue order preserves the cascade. The source_role distinction only matters to EvidenceRouteStylesheets::retire, so it can live per rule run rather than per file.
  • Reconsider the 200-byte extract floor. It was tuned for visitor bytes, but every extract also counts against the theme's file budget.

Evidence

Baseline: SSI a606a335c + BE trunk 50c79c1bd94, full onlyplants capture. Inventory and measurements are in the import loop's onlyplants WORKFLOW notes. Related: #4563, #4589, #7205, Automattic/blocks-engine#7216 (the functions.php part of the same scorecard check).

Lenguaje dominante
PHP
Estrellas
31
Forks
7
Merge medio
3 h 40 min
PR fusionados (30 d)
813

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Automattic/blocks-engine

Todos los issues de Automattic/blocks-engine

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.