-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
[React 19] useSyncExternalStore shim might break #29854
Comments
This is a bug that's caused by our |
Easy React PR? Hold my beer :) |
It's not crashing, right? I think it just misses component stacks which |
I'm pretty sure it wouldn't even compile because of the reference, and you've explicitly set that up to fail builds. But I gotta be honest, I don't have the correct environment set up to actually test that assumption. I was reading the shipped source code when I stumbled upon this. |
How did we set it up to fail builds? |
Just double checked and we do have a test suite that runs against 17. It just doesn't test component stacks for warnings which would be missing when you use |
It does crash at runtime when we would trigger warnings. The only case right now is when you'd return an uncached snapshot: const { text } = useSyncExternalStore(store.subscribe, () => {
// Intentionally return an uncached snapshot to trigger warnings
return { ...store.getState() };
}); -- https://codesandbox.io/p/sandbox/react-19-uses-old-react-vl547c |
From what I gather, by no longer exporting At least we had reports of that happening. (As a stopgap, |
Summary
I just wanted to bring this to your attention - the
uSES
shim was previously packaged in a way that accessed__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
and the new 1.4 RC versions directly access__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
.So either way, there will be versions of the
uSES
shim and React that will break when compiling them with each other.Are there any planned workarounds or things we should know as package authors that rely on the shim, that we should communicate to our consumers?
Should they pin their version?
The text was updated successfully, but these errors were encountered: