Repository navigation
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
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:
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. |
Code Coverage SummaryCannot generate coverage summary while tests are failing. 🤐 Please fix the tests, or re-run the Code coverage job if it was something being flaky. |
dhasilva
left a comment
There was a problem hiding this comment.
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.phpL15-22 says "the menu callback and the enqueue path read one predicate". After this PR onlyadd_wp_admin_submenu()reads it.storage-usage-levels.tsL4-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 takenullwhile data loads; the=== nullguards 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:
backup-now-button/index.tsxL43:src/js/components/back-up-now/index.jsxupgrade-button.tsxL27:no-backup-capabilities.jsxsite-size.tsL11:src/js/actions/index.jsuse-analytics.tsL56:src/js/hooks/useAnalytics.jslicense-key-link.tsxL8-12 andno-plan-gate.test.tsxL125-128 both explain thatJPBACKUP_INITIAL_STATE"is not emitted on the modernized page"; after this PR nothing emits it. Suggest keeping "Relative: this only renders fromadmin.php." in the component and dropping the test's copy.
[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 oftest_enqueue_admin_scripts_registers_no_dashboard_script_of_its_own, assertsjetpack-backupisn't registered, which nothing can do any more.test_predicate_is_true_when_the_build_is_presentonly 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.
|
Changes since the review, in c4a8529:
Checks: PHPUnit for |
c4a8529 to
242e30a
Compare
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>
242e30a to
d46fdb8
Compare
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_backupfilter, theuse-backup-legacy-dashboardsticker andJetpack_Backup::is_modernized(). The REST bridge routes now always register.DO NOT MERGE until:
The 3-PR plan
is_modernized().backup-capabilities,site/current-purchases,site/dismissed-review-request,has-backup-plan) and bump theV0005class namespace toV0006. It must retargetJetpack_Eager_Load_Packages_Test.phpfirst, because that test uses/jetpack/v4/has-backup-planas a marker.What this PR deletes
src/js/**: 106 files (54 code files, 23 jest test files, styles, images). Entrywebpack.config.js,postcss.config.js(verified unused by wp-build: the bundle holds the same token fallbacks with and without it) andtests/legacy-storage-usage-text.test.tsx.src/class-initial-state.php(JPBACKUP_INITIAL_STATE, read only by the legacy bundle) andtests/php/mock-wpcomsh-site-sticker.php.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.@wordpress/data,moment,prop-types,concurrently,webpack,webpack-cli,sass-loader,postcss-loader,postcss,autoprefixer,storybook. The lockfile is updated.Behavior notes
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-wpcomhas 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.tsnow imports@automattic/jetpack-connectionfor its ambient types. The legacy files used to pull those in.build-production-concurrentlyscript keeps its name so the plugin lockfiles that copycomposer.jsonscripts do not change. It no longer runs anything concurrently. Rename it in a later cleanup if wanted.packages/jetpack-mu-wpcom(its own filter, sticker and rollback stay on purpose),wpcomsh, the four legacy-only REST routes (still registered) and theV0005namespace.jetpack_activity_log_restore_url_templateandjetpack_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()andactivity_log_backup_url_template()no longer take the unused$templateargument. WordPress still passes it, and PHP ignores the extra argument.src/dashboardstill say "ported from legacy". They are harmless and left alone.Related product discussion/links
Open questions
use-backup-legacy-dashboardsticker? This needs a query on the WordPress.com side. Sites with it will get the redesigned dashboard when this ships.jetpack-mu-wpcomkeeps 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).projects/packages/backup:pnpm run test: 82 suites, 977 tests passed.projects/packages/backup:pnpm run typecheck: no errors.pnpm exec eslinton the changed JS and TS files, andvendor/bin/phpcson the changed PHP files: clean.jetpack build packages/backup -p: builds.build/holds the wp-build output only (routes, modules, pages); there is nobuild/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