Skip to content

Backup: remove the legacy dashboard - #53857

Draft
CGastrell wants to merge 2 commits into
trunkfrom
remove/jetpack-2314-backup-legacy-dashboard
Draft

CGastrell wants to merge 2 commits into
trunkfrom
remove/jetpack-2314-backup-legacy-dashboard

Conversation

@CGastrell

@CGastrell CGastrell commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Part 2 of 3 for JETPACK-2314.

Proposed changes

This PR retires the legacy Backup dashboard. The redesigned dashboard (default since #53443) becomes the only one. It removes the legacy React app and its build, the rsm_jetpack_ui_modernization_backup filter, the use-backup-legacy-dashboard sticker and Jetpack_Backup::is_modernized(). The REST bridge routes now always register.

DO NOT MERGE until:

  • The Jetpack 16.5 release branch is cut. The flip (Backup: show the modernized dashboard by default #53443) shipped in Jetpack 16.4 (2026-11-03) and Backup 4.0 (2026-11-04). Merging after the 16.5 cut ships the removal in 16.6, so 16.4 gets one full stable cycle with the opt-out still in place. The 16.5 release is expected around 2026-12-01; that date is inferred from the 16.3 and 16.4 cuts, not confirmed. Do not merge during the 16.5 alpha cycle: weekly alpha cuts reach Atomic sites, so the opt-out would disappear there within a week.
  • The Tracks crash event (PR 1 of 3, Backup: record a Tracks event when the dashboard crashes #53821) shows no crash signal.
  • Follow-up, not a blocker: when this PR is ready to merge, file a documentation update request (JETHPA-311) tied to this PR. Support documents the redesigned dashboard and the filter and sticker as the way back to the legacy dashboard. Those docs must drop the opt-out. Place the request in the Jetpack release that ships the removal.

The 3-PR plan

  1. PR 1: Tracks crash event (Backup: record a Tracks event when the dashboard crashes #53821).
  2. PR 2 (this PR): remove the legacy dashboard, filter, sticker and is_modernized().
  3. PR 3: remove the four legacy-only REST routes (backup-capabilities, site/current-purchases, site/dismissed-review-request, has-backup-plan) and bump the V0005 class namespace to V0006. It must retarget Jetpack_Eager_Load_Packages_Test.php first, because that test uses /jetpack/v4/has-backup-plan as a marker.

What this PR deletes

  • src/js/**: 106 files (54 code files, 23 jest test files, styles, images). Entry webpack.config.js, postcss.config.js (verified unused by wp-build: the bundle holds the same token fallbacks with and without it) and tests/legacy-storage-usage-text.test.tsx.
  • src/class-initial-state.php (JPBACKUP_INITIAL_STATE, read only by the legacy bundle) and tests/php/mock-wpcomsh-site-sticker.php.
  • In Jetpack_Backup: MODERNIZATION_FILTER, LEGACY_DASHBOARD_STICKER, is_modernized(), plugin_settings_page(), get_initial_state() and the legacy enqueue branch. The wp-build branches are now unconditional.
  • Dependencies only the legacy code used: @wordpress/data, moment, prop-types, concurrently, webpack, webpack-cli, sass-loader, postcss-loader, postcss, autoprefixer, storybook. The lockfile is updated.
  • 112 files deleted in total. The diff is 130 insertions and 7340 deletions across 146 files.

Behavior notes

  • An unbuilt checkout, or a release whose wp-build step failed, used to render an empty div. It now shows an error notice (render_missing_build_notice()). This is the one new string.
  • is_modernized() was public (@since 4.3.14). I found no caller outside the package in this repo. jetpack-mu-wpcom has its own copy and is unchanged. Question for reviewers: is a deprecation shim (return true) wanted for callers outside this repo? Default here: removed.
  • types.d.ts now imports @automattic/jetpack-connection for its ambient types. The legacy files used to pull those in.
  • The build-production-concurrently script keeps its name so the plugin lockfiles that copy composer.json scripts do not change. It no longer runs anything concurrently. Rename it in a later cleanup if wanted.
  • Not touched: packages/jetpack-mu-wpcom (its own filter, sticker and rollback stay on purpose), wpcomsh, the four legacy-only REST routes (still registered) and the V0005 namespace.
  • The Activity Log's "Restore backup" and backup links (jetpack_activity_log_restore_url_template and jetpack_activity_log_backup_url_template, added on trunk in Backup: Open any backup from the Activity Log's backup links #53929) now always point at this dashboard. activity_log_restore_url_template() and activity_log_backup_url_template() no longer take the unused $template argument. WordPress still passes it, and PHP ignores the extra argument.
  • A few comments in src/dashboard still say "ported from legacy". They are harmless and left alone.

Related product discussion/links

Open questions

  • How many sites hold the use-backup-legacy-dashboard sticker? This needs a query on the WordPress.com side. Sites with it will get the redesigned dashboard when this ships.
  • Does anything outside this repo call the four legacy-only routes? This also needs a WordPress.com-side check. It decides PR 3, not this PR.
  • jetpack-mu-wpcom keeps its own rollback (Simple and Atomic menu opens Calypso). It is a separate switch and stays intentionally.

Does this pull request change what data or activity we track or use?

No. It removes legacy code only.

Testing instructions

Run from the monorepo root unless noted. All of these passed on this branch. The first three, and PHPCS on class-jetpack-backup.php, were re-run after the 2026-11-18 rebase; the rest are from the 2026-11-10 rebase:

  • jetpack test php packages/backup -v: OK (508 tests, 1303 assertions).
  • In projects/packages/backup: pnpm run test: 82 suites, 977 tests passed.
  • In projects/packages/backup: pnpm run typecheck: no errors.
  • pnpm exec eslint on the changed JS and TS files, and vendor/bin/phpcs on the changed PHP files: clean.
  • jetpack build packages/backup -p: builds. build/ holds the wp-build output only (routes, modules, pages); there is no build/index.js.

Not browser-tested. To check by hand: build the package, open Jetpack > Backup on a connected site, and confirm the redesigned dashboard loads with no console errors. Then delete build/ and confirm the page shows the error notice.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the remove/jetpack-2314-backup-legacy-dashboard branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack remove/jetpack-2314-backup-legacy-dashboard
bin/jetpack-downloader test jetpack-mu-wpcom-plugin remove/jetpack-2314-backup-legacy-dashboard

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Status] In Progress [Tests] Includes Tests Docs E2E Tests labels Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: December 8, 2026
    • Code freeze: December 7, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Oct 20, 2026
@jp-launch-control

jp-launch-control Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Cannot generate coverage summary while tests are failing. 🤐

Please fix the tests, or re-run the Code coverage job if it was something being flaky.

Full summary · PHP report · JS report

@dhasilva dhasilva 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.

The deletion itself is clean. Nothing outside the package has ever called is_modernized(), plugin_settings_page() or the two constants (this repo, its history, and the WordPress.com codebase). No plugin depends on the jetpack-backup script handle. wp-build 0.25 builds its own PostCSS pipeline and never reads postcss.config.js, so that claim holds. The missing-build notice stays visible, since admin-ui's notice-hiding CSS only targets direct children of #wpbody-content.

[blocker] Two comments this PR wrote or edited now contradict the code:

  • Admin_Wp_Build_Fallback_Test.php L15-22 says "the menu callback and the enqueue path read one predicate". After this PR only add_wp_admin_submenu() reads it.
  • storage-usage-levels.ts L4-7 still says "Only the parameter types were widened… every legacy selector ends in ?? null… No branch changed", which compares against files this PR deletes. Suggest: "Parameters take null while data loads; the === null guards depend on it."

[suggestion] Changelog scope. The released package CHANGELOG tells site owners to "return false from the rsm_jetpack_ui_modernization_backup filter to keep the legacy dashboard", and the description says support docs document the filter and the sticker. Sites that followed that advice will switch dashboards with no notice. plugins/backup's entry is Comment-only and plugins/jetpack has none, though the Jetpack plugin has initialized this package since 16.3. Suggest public entries in both, e.g. "Remove the legacy dashboard; the rsm_jetpack_ui_modernization_backup filter no longer restores it." The package entry is patch for removing a public method, two constants and a documented filter; minor or major fits better.

[suggestion] These comments now point at files this PR deletes, so each sends a reader to a path that no longer exists:

[suggestion] Removing the flag collapsed the old flag-on/flag-off test pairs. In Admin_Wp_Build_Fallback_Test L105-132:

  • The menu test duplicates test_add_wp_admin_submenu_uses_wp_build_callback.
  • test_enqueue_skips_the_legacy_script_when_the_build_is_present, like the first assertion of test_enqueue_admin_scripts_registers_no_dashboard_script_of_its_own, asserts jetpack-backup isn't registered, which nothing can do any more.
  • test_predicate_is_true_when_the_build_is_present only checks the test's own mock.
  • The notices test overlaps Admin_Notices_Suppression_Test.

Only test_missing_build_notice_names_the_problem is new coverage. Suggest moving it into Admin_Modernization_Gating_Test, deleting the Fallback file, and dropping 'jetpack-backup' from OWNED_SCRIPT_HANDLES.

[suggestion] Optional: mu-wpcom's wpcom-backup.php L108 says the sticker works "like the Backup package's dashboard", which stops being true here.

On the deprecation-shim question: no shim needed, there are no callers to protect.

PHPUnit for packages/backup passes locally (441 tests, 1128 assertions). I didn't test in a browser.

Generated by Claude.

@github-actions github-actions Bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Oct 20, 2026
@CGastrell

Copy link
Copy Markdown
Contributor Author

Changes since the review, in c4a8529:

  • Fixed the two stale comments the review flagged as a blocker: storage-usage-levels.ts has the suggested wording, and the stale Admin_Wp_Build_Fallback_Test header went with the file.
  • Package changelog is minor/removed. plugins/backup (removed) and plugins/jetpack (other) have public entries: the rsm_jetpack_ui_modernization_backup filter no longer restores the legacy dashboard.
  • Fixed the comments that cited deleted files: backup-now-button, upgrade-button, site-size, use-analytics, license-key-link, and the matching comment in no-plan-gate.test.tsx.
  • Deleted Admin_Wp_Build_Fallback_Test. Moved test_missing_build_notice_names_the_problem into Admin_Modernization_Gating_Test. Removed 'jetpack-backup' from OWNED_SCRIPT_HANDLES.
  • Not changed: the mu-wpcom comment (wpcom-backup.php), left to the WordPress.com side.

Checks: PHPUnit for packages/backup OK (437 tests, 1119 assertions). pnpm run test passes (911 tests). Changelogger check passes. Not browser-tested.

@CGastrell CGastrell removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Nov 2, 2026
@CGastrell
CGastrell force-pushed the remove/jetpack-2314-backup-legacy-dashboard branch from c4a8529 to 242e30a Compare November 10, 2026 19:19
CGastrell and others added 2 commits November 18, 2026 15:50
Remove the legacy React dashboard, its webpack build and tests, the rsm_jetpack_ui_modernization_backup filter, the use-backup-legacy-dashboard sticker and is_modernized(). The redesigned dashboard is the only one. An unbuilt checkout now shows an error notice instead of an empty page.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fix stale comments, merge the build-fallback test into the gating test,
and widen the changelog entries to minor with public plugin entries.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@CGastrell
CGastrell force-pushed the remove/jetpack-2314-backup-legacy-dashboard branch from 242e30a to d46fdb8 Compare November 19, 2026 12:19

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs E2E Tests [Package] Backup [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants