Skip to content

Remove dead WordPressDataProvider and site REST proxy scaffolding - #4279

Merged
wojtekn merged 2 commits into
trunkfrom
remove-dead-rest-proxy
Jul 22, 2026
Merged

Remove dead WordPressDataProvider and site REST proxy scaffolding#4279
wojtekn merged 2 commits into
trunkfrom
remove-dead-rest-proxy

Conversation

@wojtekn

@wojtekn wojtekn commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude Code verified each symbol was unused independently (grep -rn across apps + packages, checking for dynamic imports and string refs) before deleting anything, traced the full fetchSiteRest dependency chain, confirmed the sibling readLocalMedia path was still live and left it untouched, and ran lint/typecheck/tests. All changes were reviewed by the author.

Proposed Changes

The @wordpress/core-data data layer (WordPressDataProvider) was built for Studio Desktop but is no longer wired into any UI, as Studio Desktop was removed. Because it was the only caller of the fetchSiteRest transport, that entire chain was dead: the connector method and its local/ipc/hosted implementations, the desktop IPC plumbing, the POST /sites/:id/rest endpoint on the local CLI server, and the shared REST proxy in @studio/common.

Testing Instructions

  • npm run typecheck — passes across all workspaces.
  • npm test -- apps/studio/src/tests/ipc-handlers.test.ts apps/ui/src/data/core apps/ui/src/ui-classic/components/session-view/conversation — 32/32 pass, including the readLocalMediaFile handler test confirming the retained media path is intact.
  • A repo-wide grep for the removed symbols (fetchSiteRest, WordPressDataProvider, SiteRestRequest, etc.) returns no matches.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
The @wordpress/core-data data layer (WordPressDataProvider) was built but
never rendered or imported, leaving its entire fetchSiteRest transport chain
dead. Removes the provider, the connector method and impls, the desktop IPC
plumbing, the POST /sites/:id/rest endpoint, and the shared proxy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wpmobilebot

wpmobilebot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing f07ad26 vs trunk

app-size

Metric trunk f07ad26 Diff Change
App Size (Mac) 1361.89 MB 1355.66 MB 6.24 MB 🟢 -0.5%

site-editor

Metric trunk f07ad26 Diff Change
load 748 ms 1096 ms +348 ms 🔴 46.5%

site-startup

Metric trunk f07ad26 Diff Change
siteCreation 6490 ms 6522 ms +32 ms ⚪ 0.0%
siteStartup 2388 ms 2387 ms 1 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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

LGTM 👍

@youknowriad

youknowriad commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Two minor follow-ups noticed while verifying the removal (neither blocks this PR):

  • Stale doc: docs/design-docs/studio-apps-and-surfaces.md (lines 139 and 145) still references the site REST proxy (lib/wordpress-rest.ts) and apps/studio/src/lib/wordpress-rest-api.ts, both deleted here.
  • Orphaned deps: after this change, @wordpress/api-fetch, @wordpress/core-data, and @wordpress/data in apps/ui/package.json have no remaining imports in the app. They could be dropped here or in a follow-up.
Remove @wordpress/api-fetch, @wordpress/core-data, and @wordpress/data from
apps/ui — they backed the deleted WordPressDataProvider and have no remaining
imports. Also drop the site REST proxy rows from the surfaces design doc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wojtekn

wojtekn commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @youknowriad , both addressed.

@wojtekn
wojtekn merged commit 99ad204 into trunk Jul 22, 2026
13 checks passed
@wojtekn
wojtekn deleted the remove-dead-rest-proxy branch July 22, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants