HtmlCompilation has grown past the point where the transform can be reasoned about
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the #1942 contract, then trace the entry points and transform orchestration in HtmlCompilation.php and NavigationPattern.php. The decomposition is done when both entry points visibly share one transform path, the stylesheet stages are named, and the existing navigation tests still pass.
Written by the indexing model from the issue text.
Description
Observation
HtmlCompilation.php 10,629 lines
ArtifactCompiler.php 4,522
StyleResolver.php 3,199
NavigationPattern.php 2,399
AuthorStylesheetProjector 1,606
NavigationStyleProjector 1,553
Filing this against the concrete cost rather than the line count.
The concrete cost
HtmlCompilation is where the compiler drives the transform, and it is exactly where #1942 lives: the same document produces different blocks depending on which entry point ran, and reading the file does not reveal why. I could not answer that question from source and had to bisect by re-importing.
NavigationPattern emits core/navigation from three sites. Patching two of them and verifying through one entry point produced a merged change that does nothing in production (#1939). With 2,399 lines and 20 dedicated navigation tests, I could not predict blast radius, so "verified" degraded to "CI did not complain".
That is the real symptom: at this size, changes are validated by the test suite rather than understood by the author. It works until the suite has a hole in it, which is what #1942 is.
Suggested direction
Not a rewrite. The useful cut is wherever it makes the entry-point question answerable:
- separate the transform pipeline from the orchestration that drives it, so both entry points visibly share one path
- move the stylesheet materialisation sequence out into something that names its stages
The CSS path alone currently runs author-css → projected → editor-static-state → engine-support(before/after) → wordpress-compat, with roughly fifteen generated marker-class families. That sequence is not declared anywhere — I reconstructed it by grepping call sites.
Dependency
#1942 is the test that makes this safe to do. I would not attempt this decomposition before that contract exists.
AI assistance
Grok 4.6 via OpenCode. Written after diagnosing four defects in this codebase in one session, three of which required runtime bisection rather than source reading.
- Dominant language
- PHP
- Stars
- 15
- Forks
- 2
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 796
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/blocks-engine
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#1701 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Automattic/blocks-engine#775 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Automattic/blocks-engine#2007 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Automattic/blocks-engine#1998 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Automattic/blocks-engine#1982 ·
All issues in Automattic/blocks-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100