-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Fix development mode hang when iframe is removed #19220
Conversation
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. Latest deployment of this branch, based on commit af57488:
|
Details of bundled changes.Comparing: 47ff31a...af57488 react-dom
react-art
react-test-renderer
react-native-renderer
react-reconciler
Size changes (stable) |
Details of bundled changes.Comparing: 47ff31a...af57488 react-dom
react-native-renderer
react-art
react-test-renderer
react-reconciler
ReactDOM: size: 0.0%, gzip: 0.0% Size changes (experimental) |
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.
LGTM
@@ -138,7 +133,15 @@ if (__DEV__) { | |||
) { | |||
window.event = windowEvent; |
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.
I wonder why this doesn't do
if (windowEventDescriptor) {
Object.defineProperty(window, 'event', windowEventDescriptor);
}
as below.
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.
I'm scared to touch it. #11696 (comment)
Verified it fixes #16585.
Verified it fixes #16734.
Follows @sophiebits's suggestion in #16734 (comment).
This is a workaround for a Chrome bug that also exists in Safari and doesn't seem to be gaining momentum. The actual cases in which this happens may be niche but I have a hunch I've run into other manifestations of this issue so I think it's worth fixing.
The basic idea is that if our shim doesn't work, we fall back to prod behavior with a simple try/catch.