-
Notifications
You must be signed in to change notification settings - Fork 46.4k
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
[Fizz] Recover from errors thrown by progressive enhancement form generation #28611
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What was the old behavior if processReply errored? These changes make sense for the stated use case but could processReply error in a way where we wouldn't want the client action wait for hydration style treatement on SSR?
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.
It used to just error the SSR render - which itself is just a client-render to recover so not really that different.
The nice thing about that is that if your previous state or closure contains something non-serializable it would give you an early hint that IF you submitted the form it would error. Now that happens after submitting.
In principle we could in DEV or something eagerly serialize these on the client to see if it would've failed on the client too early.
But in general it's just going to error when you try to invoke the form instead.
However, since most things with temporary references is serializable anyway we don't really error for anything other than if like a promise we're trying to serialize rejects (which should arguably error on the server instead as discussed before - if we wanted to support streaming replies). More likely the server will error when you try to inspect a Reference.
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.
Should we brand the temporaryReferenceSet errors so we can treat them passively like this but let the other errors error the SSR render?
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.
Other than the promise thing - which should probably be serialized as an error instead. Any other error is really a bug in the serialization and it seems better to fallback in that case anyway.
Regardless it seems like it's better in production to fallback to client handling just for the form than client handling for the whole page.