Skip to content

Comments

chore: bump to react@19-beta#688

Merged
dai-shi merged 2 commits intowakujs:mainfrom
himself65:update-react-beta
May 1, 2024
Merged

chore: bump to react@19-beta#688
dai-shi merged 2 commits intowakujs:mainfrom
himself65:update-react-beta

Conversation

@himself65
Copy link
Member

@himself65 himself65 commented May 1, 2024

Closes: #671
Upstream: facebook/react#28921

@vercel
Copy link

vercel bot commented May 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
waku ⬜️ Ignored (Inspect) Visit Preview May 1, 2024 1:03am

@himself65 himself65 force-pushed the update-react-beta branch from 15bd9e9 to 38f6fbb Compare May 1, 2024 00:28
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 1, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@himself65
Copy link
Member Author

Whoops, async local storage is not working for some reasons

image

@himself65
Copy link
Member Author

var supportsRequestStorage = "function" === typeof AsyncLocalStorage, requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null;

I think the reason is, as I said, it edge / worked (Cloudflare worker) AsyncLocalStorage is under globalThis, so React will access it by only AsyncLocalStorage; that's why it's false here

https://github.com/facebook/react/blob/4508873393058e86bed308b56e49ec883ece59d1/packages/react-server/src/forks/ReactFlightServerConfig.dom-edge.js#L14-L17

I checked diff and there's no AsyncLocalStorage related changes, so I think there's some new timing issue now

/cc @dai-shi

@himself65
Copy link
Member Author

OK I found the issue, file name changed, but I think don't use workerd is a better way

@himself65 himself65 marked this pull request as ready for review May 1, 2024 01:03
@himself65 himself65 changed the title Update react beta chore: bump to react@19-beta May 1, 2024
if (
// FIXME this is too hacky and not the right place to patch
id.endsWith('/react-server-dom-webpack-server.edge.production.min.js')
id.endsWith('/react-server-dom-webpack-server.edge.production.js')
Copy link
Member

Choose a reason for hiding this comment

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

Haha, of course this is brittle. Thanks for the fix!

@dai-shi dai-shi merged commit c0eb2c9 into wakujs:main May 1, 2024
@himself65 himself65 deleted the update-react-beta branch May 1, 2024 20:55
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