Skip to content

Reader Spaces: add membership lookup, drop dead per-source feed mutations - #112468

Draft
mlaetitia wants to merge 2 commits into
trunkfrom
remove/reader-spaces-dead-source-endpoints
Draft

Reader Spaces: add membership lookup, drop dead per-source feed mutations#112468
mlaetitia wants to merge 2 commits into
trunkfrom
remove/reader-spaces-dead-source-endpoints

Conversation

@mlaetitia

Copy link
Copy Markdown
Contributor

Proposed Changes

  • Add a read-only membership lookup, GET /reader/spaces/membership, across api-core (fetcher/adapter/types), api-queries (readSpaceMembershipQuery), and a useSpaceMembership hook. Answers "which of my spaces already contain this feed/tag?"
  • Remove the dead addReadSpaceSource / deleteReadSpaceSource mutators + factories + type — their /feeds routes no longer exist on the backend.

Why are these changes being made?

  • The dead mutators targeted removed routes; nothing called them. The membership endpoint gives surfaces a server-side "already in a space?" answer without loading every space's sources. Read-only — membership still changes via the bulk PUT.

Testing Instructions

  • Data-layer only, no UI change. yarn test-packages read-spaces (55 pass); yarn typecheck-client / typecheck-packages clean.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you checked for TypeScript, React or other console errors?
  • Tested in Simple / Atomic / Jetpack sites
  • Dark mode / accessibility (no UI changes)
  • String Freeze label (no new strings)

…ions

Add the read-only membership endpoint (GET /reader/spaces/membership) across
the three data layers: fetchReadSpaceMembership + adapter/types (api-core),
readSpaceMembershipQuery (api-queries), and the useSpaceMembership consumer
hook, with tests and docs. It answers "which of my spaces already contain
this feed/tag?" without loading every space's full source list.

Remove the dead addReadSpaceSource/deleteReadSpaceSource mutators, their
mutation factories, the ReadSpaceSourceMutationParams type, and their tests:
the POST/DELETE /reader/spaces/{id}/feeds routes no longer exist on the
backend, so nothing could call them. Membership changes go through the bulk
PUT /reader/spaces/{id}.

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

Copy link
Copy Markdown
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~5 bytes removed 📉 [gzipped])

Details
name    parsed_size           gzip_size
reader       -114 B  (-0.0%)       -5 B  (-0.0%)
home         -114 B  (-0.0%)       -5 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~5 bytes removed 📉 [gzipped])

Details
name                                                 parsed_size           gzip_size
async-load-calypso-components-web-preview-component       -114 B  (-0.0%)       -5 B  (-0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.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.

2 participants