Skip to content

Performance: Consolidate redundant APIs into getCurrentTheme#804

Merged
t-hamano merged 5 commits intotrunkfrom
quality/merge-apis
Mar 4, 2026
Merged

Performance: Consolidate redundant APIs into getCurrentTheme#804
t-hamano merged 5 commits intotrunkfrom
quality/merge-apis

Conversation

@t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Jan 24, 2026

The theme.json modal and the metadata modal reference their own endpoints to retrieve data that the getCurrentTheme selector can't retrieve, but this is redundant:

  • theme.json modal: getCurrentTheme + fetchThemeJson
  • metadata modal: getCurrentTheme + fetchReadmeData

It would make more sense to include the additional data in the getCurrentTheme response.

Another reason for submitting this PR is to enable future updates to theme templates and metadata without a browser reload.

If all data is integrated into the default WordPress store, invalidateResolution will allow the selector resolution cache to be refreshed without a browser reload.

@t-hamano t-hamano self-assigned this Jan 24, 2026
@t-hamano t-hamano marked this pull request as ready for review January 24, 2026 10:51
Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, it's looking great! I've left some minor comments.

t-hamano and others added 3 commits March 3, 2026 21:42
Co-authored-by: Sarah Norris <1645628+mikachan@users.noreply.github.com>
Co-authored-by: Sarah Norris <1645628+mikachan@users.noreply.github.com>
Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to bring in, thanks @t-hamano!

@t-hamano t-hamano merged commit 17473bf into trunk Mar 4, 2026
13 checks passed
@t-hamano t-hamano deleted the quality/merge-apis branch March 4, 2026 13:52
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