Docs: add the wp-build porting checklist - #52578
Conversation
Nine dashboards have shipped through wp-build so far, and the same traps kept recurring: the screen-ID alias shipping without its restore (five ports), JITM views logged for cards nobody could see, wp_localize_script silently doing nothing against an ES module page, and a build/ fallback that disagreed between call sites. Fold the checklist that already existed piecemeal across four Linear comments on JETPACK-2575, plus JETPACK-2573's verification steps and JETPACK-2687/2689's screen-ID findings, into one document in docs/ so the next port can follow it without rediscovering any of this. Fixes JETPACK-2575 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
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! |
`is_wp_build_dashboard_active()` lives in `Jetpack_Backup`, not in Search. Search had it while #52416 was current; #52506 deleted it with the legacy bundle, which §8 already cites. Attribute the shared-predicate pattern to Backup, and describe Search's post-retirement gates as they are now. Drop the duplicate symbol+line citation in the second bullet, and add a pointer from `docs/monorepo.md` § Building so the checklist is reachable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ReviewVerdict: one blocker, one suggestion — both fixed in 6679bef. All ten file:line citations were checked against [blocker] §8 pointed at a function Search no longer has"Search's The Fixed:
[suggestion] Nothing linked to the doc
Not fixed
— Terminator |
dhasilva
left a comment
There was a problem hiding this comment.
A useful consolidation. Most citations check out at this SHA: the Backup alias/restore/predicate lines, the JITM get_message_path() and jitm_view_client lines, SEO's inject_script_data(), the AdminPage defaults, the generated template's admin_init interceptor, #wpbody-content hide rule and gutenberg_ default prefix, and every cited PR. The inline comments cover a few claims that don't match the tree, a self-contradiction in §8, and some traps the checklist doesn't list yet.
Verdict: Minor issues — can merge after addressing.
See inline comments.
Generated by Claude.
Every item confirmed against trunk before it was written in. Corrections: - The restore does not protect `pagenow`. `admin-header.php` prints it from `$current_screen->id` before it fires `admin_enqueue_scripts`, so only the old `current_screen` alias ever reached it. Moved to the old-pattern line. - Seven ports shipped without the restore, not five. #52471 also fixed Podcast and SEO. - The JITM container belongs in the page shell, not in a tab panel. `Tabs.Panel` defaults to `keepMounted={ false }`, so Search's container leaves the DOM on a tab switch. Cite Social and Boost instead. - An empty `apiRoot` breaks `@automattic/jetpack-api`, not every API call. `@wordpress/api-fetch` has its own root. - #50762 fixed seven dashboards. SEO, Podcast and Scan still have no `packages/init`, no `build:stamp-textdomains` and no i18n loader, so §6 now says to copy Backup or Search rather than the SEO file it cites. - §8 required a visible error and then called a blank page expected. Split into two rules: a brand-new route shows an error, a retired port renders nothing and that is accepted. §9 step 7 matches. - Drop the port count and list, which was already stale. Name the flag mechanism: a `Feature_Flags` flag, which is where ports should land even though the shipped ones still use bare filters. Additions, each one something a port needs and the checklist omitted: the polyfills package in both manifests; the `.gitattributes` excludes and the `build/**` include; importing `route.scss` from `stage.tsx`, since `@wordpress/build` records `hasStyle` and never reads it; a shared mixin for multi-route layout; the Safe Mode banner, hidden by the same template rule; and moving the legacy entry's side effects into `stage.tsx`. Linear links replaced with bare issue IDs — external contributors cannot open them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
All ten applied in 27db12e, each one re-checked against trunk first. Corrections: Additions: polyfills package in both manifests, Two deviations. The port-list command pipes through Search's container sitting inside a tab panel is a live bug, not a doc one. Filing it separately. — Terminator |
|
Filed the Search tab-panel bug as JETPACK-2753. The container sits inside — Terminator |
Fixes JETPACK-2575
Proposed changes
docs/wp-build-porting-checklist.md, a ten-section checklist for moving a Jetpack admin dashboard onto the wp-build pipeline.Covered, each one something a port already got wrong: project wiring and the three build scripts that
build:wp-buildalone does not give you; bare Sass and JS specifiers, which esbuild will not resolve; loader ordering; aliasing the screen ID and restoring it; the two independent JITM failure modes; passing initial state to an ES-module page; assets; the fallback predicate; the seven verification steps; and retiring the flag promptly.No changelog entry:
docs/is outsideprojects/.Related product discussion/links
Does this pull request change what data or activity we track or use?
No. Documentation only.
Testing instructions
This is one new Markdown file and nothing else, so there is nothing to run.
docs/wp-build-porting-checklist.md.projects/packages/backup/src/class-jetpack-backup.php:1218and:1235, the JITM slot rendered inside the app atprojects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx:204, and the shared fallback predicate atclass-jetpack-backup.php:1292.🤖 Generated with Claude Code