Repository navigation
Conversation
|
@bmakuh What context are you talking about? We have two browser and node. Node shouldn't call raf. |
|
@TrySound in |
|
Still not clear. What the problem are you trying to achieve? raf is called only on scroll. Scroll does not exist in node. |
|
As referenced in the title, it fixes Issue #986, where browsers throw hundreds of exceptions while you scroll because and this in Chrome: If you want more context on the bug, there's more discussion on the issue: #986 |
|
|
Can you reproduce the problem in codesandbox? |
|
|
||
| // Properly handle server-side rendering. | ||
| let win; | ||
| export let win; |
There was a problem hiding this comment.
Instead of exporting win object and calling raf/caf with win, why you just don't want to export raf/caf with bound context win?
export const raf = request.bind(win);
export const caf = cancel.bind(win);
There was a problem hiding this comment.
Good call @steppefox, I can change that. I do think that it happens in the commonjs build too though; we're using webpack 1 currently and support for ES modules wasn't added until webpack 2.
There was a problem hiding this comment.
@bmakuh Btw, please try to provide some example in demo repository if you have a time of course, because it really looks strange and guys won't approve it then. Or i'll provide an example with that error on weekends if you want, cuz I already have some demo app, need to change import of react-virtualized to ES here: https://github.com/steppefox/sandbox-react-contactlist
UPD. Already done it
|
Btw, maybe I'm wrong but looks like the problem appears only in ES build, commonjs build works fine |
|
@TrySound https://github.com/steppefox/sandbox-react-contactlist here is an example repo with existing bug, please check it out) Just clone and |
|
@steppefox I just updated it to use |
|
The repro project seemingly has unrelated errors for me when run locally:
|
|
@bvaughn yep, fusebox sometimes blowing up something... let me publish that repo to GH Pages, i think that's will be better |
|
I'm having the same issue when using ES build. @bmakuh 's fix seems to work for me. |
|
This fix, solved the problem for me in #986! Thank you :)! |
|
@jokklan if you need to use this before it gets merged in, I've published a fork with the fix in it: |
|
Thanks @bmakuh ! Awesome :)! |
|
@bmakuh I'm facing a similar issue, but even your patch didn't solve my issue. For some weird reason, the I renamed it to Do you know what could cause this weird issue? |
|
@uqmessias hmm, I'm not sure, but that maybe sounds like a separate issue? |
|
I can reproduce this on Chromium Version 94.0.4606.61 (Official Build) (64-bit) This PR fixes the issue. To reproduce follow https://github.com/domenkozar/parcel-web-components-css-modules-issue |
|
I'm observing the same issue when using |
felipernb
left a comment
There was a problem hiding this comment.
I know this might be seen as a bundling issue, as @steppefox mentioned years ago
Btw, maybe I'm wrong but looks like the problem appears only in ES build, commonjs build works fine
but what would be the downside of just merging this? It seems to me that it just makes the module more robust.
|
reproduce when building with |
|
I had same issue when I build with |
|
Looks like I'm facing the same issue with Next.js + TurboPack (beta) in development |
|
Sorry for the very long delay in getting back to you about this! I've just finished a large update for version 10 of react-virtualized (#1900): the library has been rewritten in TypeScript, every component is now a function component (React 18+ is required), and the source moved from If you're still interested in this change, I'd welcome a new PR with it rebased onto the |
Currently
requestAnimationFrame/cancelAnimationFrameare getting called in another context besideswindow(orself). This throws an error as an illegal operation, so this just calls the function with the explicit context of whateverwinis.I'm happy to write tests for this, but I just don't really know how to test this sort of thing. If anyone has ideas, let me know and I'll add them to this PR.