Skip to content

chore(rsc): tweak React.cache example #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2025

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Aug 16, 2025

Description

The previous one is testing only "synchronous" cache mechanism as they are all called in side Promise.all. Changing it so the asynchronus tracking can be seen more obviously. And this actually shows React.cache is broken on Stackblitz since it internally uses AsyncLocalStorage which doesn't work properly.

(cacheFnCount = {cacheFnCount}, nonCacheFnCount = {nonCacheFnCount})

This should show

'(cacheFnCount = 2, nonCacheFnCount = 3)',

but on stackblitz, it shows

(cacheFnCount = 3, nonCacheFnCount = 3)

@hi-ogawa hi-ogawa marked this pull request as ready for review August 16, 2025 02:01
@hi-ogawa hi-ogawa merged commit cc1bcdf into main Aug 16, 2025
22 checks passed
@hi-ogawa hi-ogawa deleted the 08-16-chore_rsc_tweak_react.cache_example branch August 16, 2025 02:20
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.

1 participant