[3.x] Support pages with more output file extensions (Remove overengineered code)#2547
Merged
emmadesilva merged 5 commits intoJul 14, 2026
Merged
Conversation
emmadesilva
force-pushed
the
v3/non-html-pages-code-simplifications
branch
2 times, most recently
from
July 14, 2026 22:17
79bb0a8 to
7e4deb8
Compare
emmadesilva
force-pushed
the
v3/non-html-pages-code-simplifications
branch
from
July 14, 2026 22:18
7e4deb8 to
840324c
Compare
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.
1. The 4
InMemoryPagesubclasses are YAGNIThe Epic explicitly states that the decision to use a thin subclass (
SitemapPage extends InMemoryPage) instead of a plainInMemoryPagewith a closure was made because the commands needed a concrete class to instantiate for the fallback: "must fall back to a fresh instance when the route is not registered".However, the review notes state this fallback was removed: "an initial implementation fell back to a fresh page instance... the commands now fail with a generic error when the route is not registered".
Because the commands no longer instantiate the fallback, the sole justification for these subclasses is gone. We can delete
SitemapPage,RssFeedPage,RobotsTxtPage, andLlmsTxtPage, and just register them as plainInMemoryPageinstances with a bound closure/macro as originally proposed.2. Overzealous config validation in
RobotsTxtGeneratorThrowing a hard exception if a user provides a non-string in the
hyde.robots.disallowarray (like123or3.14) is overengineering. Just let PHP implicitly cast integers/floats to strings when building the output line, or cast it yourself with(string). We don't need a custom exception path for this.3. Repeated runtime validation on static properties
This validation runs on every single call (which happens constantly via
RouteKey::fromPage). Validating a developer-defined static string property for slashes/dots at runtime on every route resolution is unnecessary overhead. If a developer sets a bad extension, the resulting file will just look weird or fail at the OS level. Drop the validation block entirely.4. Reflection-based legacy guards on every boot
Running
property_existsand twomethod_existschecks on every registered page class on every single boot just to catch users who haven't updated a V2 API is overengineering. We already documented this inUPGRADE.mdand explicitly noted that a Rector script will handle the migration. Remove the runtime guard.