GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [Fizz] Fallback to client replaying actions if we're trying to serialize a Blob by sebmarkbage · Pull Request #28987 · react/react Conversation
|
|
Comparing: 0a0a3af...8dc0498 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ize a Blob (#28987) This follows the same principle as in #28611. We cannot serialize Blobs of a form data into HTML because you can't initialize a file input to some value. However the serialization of state in an Action can contain blobs. In this case we do error but outside the try/catch that recovers to error to client replaying instead of MPA mode. This errors earlier to ensure that this works. Testing this is a bit annoying because JSDOM doesn't have any of the Blob methods but the Blob needs to be compatible with FormData and the FormData needs to be compatible with `<form>` nodes in these tests. So I polyfilled those in JSDOM with some hacks. A possible future enhancement would be to encode these blobs in a base64 mode instead and have some way to receive them on the server. It's just a matter of layering this. I think the RSC layer's `FORM_DATA` implementation can pass some flag to encode as base64 and then have decodeAction include some way to parse them. That way this case would work in MPA mode too. DiffTrain build for [6bac4f2](6bac4f2)
Completes #65845 which only updated Canary not Experimental. <details> <summary> React upstream changes</summary> - react/react#29026 - react/react#29025 - react/react#28743 - react/react#29022 - react/react#29023 - react/react#29015 - react/react#29016 - react/react#28988 - react/react#28987 - react/react#28986 - react/react#29014 - react/react#28982 - react/react#29006 - react/react#28973 - react/react#28841 - react/react#28964 - react/react#28990 - react/react#29003 - react/react#28989 - react/react#28893 - react/react#28887 - react/react#28807 - react/react#28978 - react/react#28963 - react/react#28972 - react/react#28970 - react/react#28816 - react/react#28977 - react/react#28974 - react/react#28976 - react/react#28975 - react/react#28969 - react/react#28966 - react/react#28056 </details>
…ize a Blob (react#28987) This follows the same principle as in react#28611. We cannot serialize Blobs of a form data into HTML because you can't initialize a file input to some value. However the serialization of state in an Action can contain blobs. In this case we do error but outside the try/catch that recovers to error to client replaying instead of MPA mode. This errors earlier to ensure that this works. Testing this is a bit annoying because JSDOM doesn't have any of the Blob methods but the Blob needs to be compatible with FormData and the FormData needs to be compatible with `<form>` nodes in these tests. So I polyfilled those in JSDOM with some hacks. A possible future enhancement would be to encode these blobs in a base64 mode instead and have some way to receive them on the server. It's just a matter of layering this. I think the RSC layer's `FORM_DATA` implementation can pass some flag to encode as base64 and then have decodeAction include some way to parse them. That way this case would work in MPA mode too.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.