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

オープン
#7,218 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php
領域
performance

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
PHP
スター
31
フォーク
7
平均マージ
3時間 40分
マージ済み PR(30日)
813

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/blocks-engine のほかの issue

Automattic/blocks-engine の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。