Simplify slice 1g: move the 10 most-wired leaf methods out of HtmlCompilation and delete their 33 closures
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
- 45/100
Línea de trabajo
Read HtmlCompilation.php, the listed methods, and the consumers that receive them through constructor closures; inspect SourceBlockCreator and the existing style or presentation services to identify suitable owners. Trace the constructor wiring and internal call sites before moving the methods and removing closure parameters, fields, and forwarders. Run the php-transformer gates and compare output byte for byte; report closures removed, the HtmlCompilation.php line change, and net lines.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Part of #4368. Measured at trunk after #4634.
Problem
43 closure-wired methods in HtmlCompilation, behind 66 constructor closures, call no other HtmlCompilation method except createBlock and attr. They only use services, the session or static helpers, so they don't need to live in HtmlCompilation, and the closures exist only to reach them.
Scope: the 10 most-wired, 33 closures
| Method | Closures | Lines | Notes |
|---|---|---|---|
htmlPreservationBlock |
8 | 5 | createBlock('core/html', safeFallbackHtml(..., tagMarkers)) |
disclosureControlPresentation |
6 | 10 | |
codePresentationAttributes |
3 | 15 | |
recognizePatterns |
3 | 14 | |
requiredScriptsForElement |
3 | 11 | |
runtimeAuthoredButton |
2 | 32 | uses createBlock |
socialAnchorColors |
2 | 14 | |
rememberAccordionDisclosureRoot |
2 | 9 | |
imageDimensions |
2 | 8 | |
parsedCssSelector |
2 | 5 |
Change
- Move each method to its natural owner:
htmlPreservationBlockgoes ontoSourceBlockCreator, or a small service next to it. Converters already receiveSourceBlockCreator.- Presentation and attribute helpers go to the existing style or presentation service they read from.
- Use a new small service only when no existing owner fits.
- If a method has one consumer, move it into that consumer.
- Every consumer that received one of these methods as a closure gets the owning service instead. Delete those closure parameters, fields and forwarders, plus the constructor wiring.
HtmlCompilation's own internal call sites call the new owner directly. Delete the methods fromHtmlCompilation.- Keep the change mechanical. The other 33 leaf methods are follow-up work.
Acceptance
- Byte-identical output across all php-transformer gates.
- The PR body reports closures removed (target 33), the
HtmlCompilation.phpline change, and net lines (which must go down). - No new tests.
AI assistance: measured and scoped by Claude Opus (Anthropic) via Pi/Roadie.
- Lenguaje dominante
- PHP
- Estrellas
- 25
- Forks
- 3
- Merge medio
- 2 h 23 min
- PR fusionados (30 d)
- 942
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Automattic/blocks-engine
-
Captured slideshow pass overwrites the route path, aborting compose with a rebind() TypeErrorAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Automattic/blocks-engine#5003 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Automattic/blocks-engine#4943 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Automattic/blocks-engine#4942 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Automattic/blocks-engine#4921 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Automattic/blocks-engine#775 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Automattic/blocks-engine
Issues similares
-
enhancement priority Sales
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
novalo-dev/Prestashop-MCP-Server#201 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
web-token/jwt-framework#757 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Include flows spanning the full report time windowPosiblemente ocupada @somethingwithproof la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Cacti/plugin_flowview#306 ·
Los mantenedores suelen responder en 1 día
-
bug origin: upstream priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mattytap/Mattytap-Sermons#105 ·