-
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
Use undici polyfill for tests in old Node versions #28887
Conversation
CI should be running with 18.20 as of 50895bc |
This is still valuable to test in old Node versions manually. I guess the question is, which versions do we support? |
const blob = new Blob([typedArray]); | ||
const blob = new Blob([ | ||
// We should be able to pass the buffer straight through but Node < 18 treat | ||
// multi-byte array blobs differently so we first convert it to single-byte. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are only relevant in Server-to-Server calls and maybe SSR serialization of forms. The question is do we support old Node without polyfilling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should only support supported versions of Node so we can probably assume FormData
To support old Node we need to adjust how we construct blobs.
Completes #65845 which only updated Canary not Experimental. <details> <summary> React upstream changes</summary> - facebook/react#29026 - facebook/react#29025 - facebook/react#28743 - facebook/react#29022 - facebook/react#29023 - facebook/react#29015 - facebook/react#29016 - facebook/react#28988 - facebook/react#28987 - facebook/react#28986 - facebook/react#29014 - facebook/react#28982 - facebook/react#29006 - facebook/react#28973 - facebook/react#28841 - facebook/react#28964 - facebook/react#28990 - facebook/react#29003 - facebook/react#28989 - facebook/react#28893 - facebook/react#28887 - facebook/react#28807 - facebook/react#28978 - facebook/react#28963 - facebook/react#28972 - facebook/react#28970 - facebook/react#28816 - facebook/react#28977 - facebook/react#28974 - facebook/react#28976 - facebook/react#28975 - facebook/react#28969 - facebook/react#28966 - facebook/react#28056 </details>
Completes vercel#65845 which only updated Canary not Experimental. <details> <summary> React upstream changes</summary> - facebook/react#29026 - facebook/react#29025 - facebook/react#28743 - facebook/react#29022 - facebook/react#29023 - facebook/react#29015 - facebook/react#29016 - facebook/react#28988 - facebook/react#28987 - facebook/react#28986 - facebook/react#29014 - facebook/react#28982 - facebook/react#29006 - facebook/react#28973 - facebook/react#28841 - facebook/react#28964 - facebook/react#28990 - facebook/react#29003 - facebook/react#28989 - facebook/react#28893 - facebook/react#28887 - facebook/react#28807 - facebook/react#28978 - facebook/react#28963 - facebook/react#28972 - facebook/react#28970 - facebook/react#28816 - facebook/react#28977 - facebook/react#28974 - facebook/react#28976 - facebook/react#28975 - facebook/react#28969 - facebook/react#28966 - facebook/react#28056 </details>
We currently don't test FormData / File dependent features in CI because we use an old Node.js version in CI. We should probably upgrade to 18 since that's really the minimum version that supports all the features out of the box.
JSDOM is not a faithful/compatible implementation of these APIs. The recommended way to use Flight together with FormData/Blob/File in older Node.js versions, is to polyfill using the
undici
library.However, even in these versions the Blob implementation isn't quite faithful so the Reply client needs a slight tweak for multi-byte typed arrays.