refactor(breeze): move all Breeze-specific code under src/Breeze - #137
Merged
Conversation
Everything that knows about the Breeze plugin now lives under src/Breeze/ (namespace Parisek\TimberKit\Breeze), so a project that does not run Breeze can see in one directory what is dead weight. A new architecture test enforces the boundary rather than documenting it: naming Breeze anywhere else under src/ fails the build. StarterBase is the sole documented exception, because it keeps the opt-in flags and those flag names are public API — six projects in the fleet already set them. BreezeWarmupSitemap becomes Breeze\WarmupSitemap. The old class name keeps resolving through a class_alias in compat/aliases.php, wired as a composer files autoload entry; the class is final, which rules out a subclass shim. Dropping the alias outright was rejected: the old name has shipped, so removing it would break any consumer still referencing it. No behaviour changes. The warmup logic is untouched — this is a relocation plus the compatibility shim.
The alias in compat/aliases.php was invisible to the suite. Every other test uses the new name, so dropping the composer autoload.files entry, mistyping the alias target, or having it fail under an optimised autoloader would all have left the build green — the one thing that must not break on upgrade was the one thing nothing exercised. Three assertions: the legacy name resolves, it resolves to the moved class rather than merely to something, and the shim stays wired through composer.json. Verified to fail on a deliberately mistyped alias.
parisek
added a commit
that referenced
this pull request
Aug 24, 2026
Cuts 1.39.0 over the two Breeze warmup changes already on `main`: #134 (order the preload list by importance) and #137 (move Breeze code under `src/Breeze`). No code changes — this only stamps the `[Unreleased]` section with a version and a date, the same shape as 9766ccc did for 1.38.0. ## Why now The ordering in #134 is the difference between the feature working and not working, measured on a real site rather than argued. On `sloneek` (2873 sitemap URLs, five languages, 10 sub-sitemaps), the pre-#134 behaviour spends the whole 200-URL cap inside the first sub-sitemap: | Page | before #134 | with #134 | | --- | --- | --- | | `/blog/` | 261 — missed | **17** | | `/sk/`, `/it/`, `/pl/` blog | 262–264 — missed | **18–20** | | 53 category archives | unreachable (last sub-sitemap) | **27–30** | | `/pricing/` | 64 | 7 | Those are the site's most expensive pages: 4.0–4.4 s cold TTFB against 0.07 s warm. Without ordering, the cap warmed 200 cheap pages and left every expensive one cold — which is why the flag read as pointless before this landed. Simulated by applying the weights `StarterBase` declares on `main` to the site's real sitemap, `lastmod` dates, 262 menu targets and Breeze's own manual list. ## One thing the measurement also showed Category archives score only through Breeze's **manual list** (weight 800). They are in no menu, are not a homepage, and their `lastmod` is old — so with the manual list absent they fall to position ~2864 of 2873. That list lives in a `wp_options` row, so a database import wipes it. Not a blocker for this release, and not something #134 claims to solve. Worth recording as the gap: a code-side curated list (`$breeze_warmup_urls`, scored like `manual`) would be the missing link, since the kit currently has no property or filter for explicit URLs — `SignalCollector::manualKeys()` reads the admin row. ## Verification `main` is green (PHP 8.3, PHP 8.4, PHPStan, composer hygiene). Locally: 1627 tests, 2707 assertions, 1 skipped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JMYy6JHLf4mU4H4Hd47spb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Všechno, co v tomhle balíčku ví o pluginu Breeze, se přestěhovalo pod
src/Breeze/(namespaceParisek\TimberKit\Breeze). Projekt, který Breeze neprovozuje, teď vidí v jedné složce, co je pro něj mrtvá váha.Žádná změna chování. Logika warmupu je nedotčená — je to přesun plus kompatibilní alias.
Hranici vynucuje test, ne dokumentace
Projde
src/a shodí build, když se slovo Breeze objeví mimosrc/Breeze/. Hranice, kterou nikdo nevynucuje, se do půl roku rozmaže — stačí, aby si jeden helper sáhl nabreeze_get_option()odkudkoli, kde je to zrovna pohodlné.Test vznikl před přesunem a nechal se spadnout: vyjmenoval přesně těch osm souborů, které bylo potřeba přestěhovat, a posloužil tak jako seznam práce.
Druhý test v tom souboru hlídá první — kontroluje, že
src/Breeze/existuje a není prázdná. Bez toho by hlavní kontrola prošla naprázdno ve chvíli, kdy by někdo tu složku přejmenoval.Jediná výjimka
StarterBasezůstává venku a test ho má jako povolenou výjimku. Nese opt-in flagy a jejich jména jsou veřejné rozhraní — šest projektů v parku má$breeze_warmup_sitemap = true. Implementace se přestěhovala, jména flagů ne.Vědomě jsem tam nechal i
do_action( 'breeze_clear_all_cache' )ve dvou metodách pro mazání cache. Technicky patří dovnitř, ale ty flagy jsoudefault truea sahat na chování, které dnes běží na šesti webech, mi za dokonalou hranici nestálo. Kandidát na příště.Zpětná kompatibilita
BreezeWarmupSitemapje jediná třída z těch osmi, která už vyšla (v1.38.0). Zůstává po níclass_aliasvcompat/aliases.php, načítaný přesautoload.filesvcomposer.json. Podtřída nešla — třída jefinal.Zbylých sedm nikdy nevyšlo, takže se stěhovaly bez stopy.
Zrušit alias rovnou jsem zavrhl: starý název je venku a jeho odstranění by bylo breaking change pro každého, kdo se na něj odkazuje.
Ověření
composer testcomposer test:propertycomposer phpstancomposer adrGit rozpoznal všech 19 přesunů jako přejmenování, takže historie souborů zůstala zachovaná.
Proč teď
Navazující práce (dohřívání warmup ocasu, #136) přidá do téhle oblasti dalších zhruba 600 řádků. Nakreslit hranici teď znamená kreslit ji kolem menšího kusu kódu — a hlavně dokud většina těch tříd ještě nevyšla a stěhují se zadarmo.