Skip to content

[3.x] Breaking: Remove the rebuild command#2490

Merged
emmadesilva merged 3 commits into
v3-devfrom
v3/remove-the-rebuild-command
Jul 3, 2026
Merged

[3.x] Breaking: Remove the rebuild command#2490
emmadesilva merged 3 commits into
v3-devfrom
v3/remove-the-rebuild-command

Conversation

@emmadesilva

@emmadesilva emmadesilva commented Jul 3, 2026

Copy link
Copy Markdown
Member

Remove the rebuild command

Why

rebuild is vestigial. It was added to build a single file to disk back before the realtime compiler existed, and then the RC used it internally to build-and-serve a given path. The realtime compiler now renders everything in-memory, so nothing calls rebuild anymore — which is why its signature had quietly drifted out of date. It's a command that exists for two reasons that no longer apply.

There also isn't a real user-facing use case left for it. A single-page build only produces a correct _site when the page happens to be self-contained. In practice a single page change routinely invalidates aggregate outputs — sitemap, RSS feed, search index, "latest posts" listings, navigation — none of which rebuild regenerates. So the command silently leaves you with a stale output directory that looks complete. That's a footgun with no guard, and it's the opposite of the "you don't have to fight with it" experience Hyde is meant to give.

What changed

  • Removed the rebuild command.
  • The single-page build capability is unchanged: StaticPageBuilder::handle() remains available as an internal action for programmatic consumers that legitimately need to render one page. Only the user-facing command is gone.

Breaking change

Removing a command is breaking, so it's landing in v3 and documented in the v3 planning notes. The deprecation shim for v2 is handled separately — this PR ships the clean removal rather than introducing deprecated code into a major. See #2491

Docs & tests

  • Removed the rebuild section from the console commands reference
  • Removed the command's tests
  • Changelog and HYDEPHP_V3_PLANNING.md updated with a short motivation.
  • Updated UPGRADE.md

Note

Closes #2189 — but resolves it by removing rebuild rather than merging it into build. The merge would have relocated the stale-output footgun under a more discoverable keystroke instead of retiring it. Removal is the right call.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a0bdf82) to head (36622d5).

Additional details and impacted files
@@             Coverage Diff             @@
##              v3-dev     #2490   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
+ Complexity      1615      1608    -7     
===========================================
  Files            169       168    -1     
  Lines           4073      4039   -34     
===========================================
- Hits            4073      4039   -34     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@emmadesilva emmadesilva force-pushed the v3/remove-the-rebuild-command branch from 6f77c9c to baab792 Compare July 3, 2026 19:59
@emmadesilva emmadesilva marked this pull request as ready for review July 3, 2026 20:01
@emmadesilva emmadesilva requested a review from Copilot July 3, 2026 20:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the vestigial user-facing rebuild CLI command in HydePHP v3, while keeping single-page compilation available via the internal StaticPageBuilder::handle() action. It also updates tests and documentation to reflect the breaking change.

Changes:

  • Removed the rebuild console command registration and implementation.
  • Updated framework tests to compile single pages via StaticPageBuilder::handle(Pages::getPage(...)) instead of invoking php hyde rebuild.
  • Updated upgrade guide and docs to remove rebuild references and guide programmatic consumers to StaticPageBuilder.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
UPGRADE.md Adds v3 migration guidance for replacing php hyde rebuild <path> with StaticPageBuilder::handle() or php hyde build.
HYDEPHP_V3_PLANNING.md Documents removal of the rebuild command as a v3 breaking change and notes the internal replacement.
docs/getting-started/console-commands.md Removes rebuild from the console command reference table and deletes the rebuild section.
docs/creating-content/compile-and-deploy.md Removes deprecated single-file compilation instructions and link to the removed rebuild docs section.
packages/framework/src/Console/ConsoleServiceProvider.php Unregisters the RebuildPageCommand from the CLI.
packages/framework/src/Console/Commands/RebuildPageCommand.php Deletes the command implementation entirely.
packages/framework/tests/Unit/Views/NavigationMenuViewTest.php Replaces artisan rebuild usage with direct StaticPageBuilder invocation.
packages/framework/tests/Feature/Views/MetadataViewTest.php Replaces artisan rebuild usage with direct StaticPageBuilder invocation in the helper build method.
packages/framework/tests/Feature/PostsAuthorIntegrationTest.php Replaces artisan rebuild usage with direct StaticPageBuilder invocation across post-author integration scenarios.
packages/framework/tests/Unit/MediaDirectoryCanBeChangedTest.php Removes the rebuild-specific media directory test since the command no longer exists.
packages/framework/tests/Feature/Commands/RebuildPageCommandTest.php Removes tests for the deleted command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/creating-content/compile-and-deploy.md Outdated
Comment thread HYDEPHP_V3_PLANNING.md
@emmadesilva emmadesilva merged commit e784dfd into v3-dev Jul 3, 2026
7 checks passed
@emmadesilva emmadesilva deleted the v3/remove-the-rebuild-command branch July 3, 2026 21:41
emmadesilva added a commit that referenced this pull request Jul 3, 2026
* Breaking: Remove the rebuild command

* Fix broken anchor links in compile-and-deploy.md to use explicit anchors

* Move rebuild command from Deprecated to Removed in CHANGELOG

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
emmadesilva added a commit that referenced this pull request Jul 3, 2026
* Breaking: Remove the rebuild command

* Fix broken anchor links in compile-and-deploy.md to use explicit anchors

* Move rebuild command from Deprecated to Removed in CHANGELOG

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@emmadesilva emmadesilva changed the title [v3] Breaking: Remove the rebuild command [3.x] Breaking: Remove the rebuild command Jul 4, 2026
emmadesilva added a commit that referenced this pull request Jul 4, 2026
* Breaking: Remove the rebuild command

* Fix broken anchor links in compile-and-deploy.md to use explicit anchors

* Move rebuild command from Deprecated to Removed in CHANGELOG

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
emmadesilva added a commit that referenced this pull request Jul 4, 2026
* Breaking: Remove the rebuild command

* Fix broken anchor links in compile-and-deploy.md to use explicit anchors

* Move rebuild command from Deprecated to Removed in CHANGELOG

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants