Skip to content

Conversation

hi-ogawa
Copy link
Owner

Description

This PR adds comprehensive support and testing for the React.cache API within @vitejs/plugin-rsc, addressing the need for robust caching functionality (related to vitejs#619).

Key changes:

  • Introduces a new example route (/react-cache) to demonstrate React.cache usage.
  • Adds dedicated E2E tests in packages/plugin-rsc/e2e/basic.test.ts to verify React.cache's behavior, ensuring:
    • Identical inputs yield cached results.
    • Different inputs produce distinct results.
    • Functionality is consistent in both development and build modes.

This implementation clearly distinguishes React.cache from the existing "use cache" directive, providing separate examples and tests for each.


Open in WebOpen in CursorOpen Docs

@hi-ogawa hi-ogawa marked this pull request as ready for review July 26, 2025 13:32
@hi-ogawa hi-ogawa marked this pull request as draft July 26, 2025 13:32
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