-
-
Notifications
You must be signed in to change notification settings - Fork 82
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: use ResizeObserver global from parentNode realm to support case with multiple realms #82
fix: use ResizeObserver global from parentNode realm to support case with multiple realms #82
Conversation
…with multiple realms
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 pretty suck today so my brain isn't working so well.
Will this change still work with server rendering? I see you moved things around a bit, but can you confirm that you've tested to make sure it didn't regress?
This logic happens in
Yeah, can confirm that:
|
That's fair. (The issue the comment referred to is bvaughn/react-virtualized#41 FWIW) |
Thank you! |
…-auto-sizer to ^1.0.23 (#28408) 1. Bumps `react-virtualized-auto-sizer` to 1.0.23, which has a fix for cases with multiple realms - bvaughn/react-virtualized-auto-sizer#82 2. Removes `react-window` from react-devtools-shared/src/node_modules, now listed as dependency in `package.json` and bumped to 1.8.10 Tested: - Chrome extension - Standalone shell with RN
…-auto-sizer to ^1.0.23 (facebook#28408) 1. Bumps `react-virtualized-auto-sizer` to 1.0.23, which has a fix for cases with multiple realms - bvaughn/react-virtualized-auto-sizer#82 2. Removes `react-window` from react-devtools-shared/src/node_modules, now listed as dependency in `package.json` and bumped to 1.8.10 Tested: - Chrome extension - Standalone shell with RN
I am working on something for React DevTools, which requires us to start using
ResizeObserver
. After bumping this package to version1.0.22
, theonResize
callback has stopped being executed in valid cases for the browser extension.After some debugging, I've noticed that the
parentNode.ownerDocument
is different fromdocument
, which means that the code runs in a different realm from whereparentNode
was defined.By running
I've checked
document
andResizeObserver
instances, this is the result:Essentially, this change is only about switching
ResizeObserver
toparentNode.ownerDocument.defaultView.ResizeObserver
.Happy to provide more context if needed, tried adding a test for it with some iframes, but this will probably take much more time than the change itself.