-
Notifications
You must be signed in to change notification settings - Fork 289
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
Merge master to v2.0-beta #685
Conversation
Tie up setting up and cleaning up listeners to lifecycle methods under the assumption that lifecycle methods like `componentDidMount`/`componentWillUnmount` might be called multiple times for the same instance.
React runs `componentWillUnmount` prior to resetting refs through ref callbacks. This caused a NPE in our ref callback since it attempted to use `_wheelHandler` which had already gotten cleaned up in `componentWillUnmount`. Fixed with a simple null guard check against _wheelHandler.
Typo came through #658
Bumps [semver-regex](https://github.com/sindresorhus/semver-regex) from 3.1.3 to 3.1.4. - [Release notes](https://github.com/sindresorhus/semver-regex/releases) - [Commits](https://github.com/sindresorhus/semver-regex/commits/v3.1.4) --- updated-dependencies: - dependency-name: semver-regex dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md) - [Commits](webpack/loader-utils@v1.4.0...v1.4.2) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Use ReactDOM.flushSync() to flush scrollbar thumb updates. Starting from React 18, React batches multiple state updates together for improving performance. While this is generally good, the legacy code in our scrollbar component (for whatever reason) expects state updates to be unbatched. This leads to #668, where the scrollbar doesn't move as fast as the user's cursor when they drag the scrollbar thumb, making them go out of sync. I'm fixing this by using ReactDOM's flushSync API to make sure that the state update is flushed immediately. Read more on automatic batching by React here: reactwg/react-18#21
FDT is a bit aggressive in preventing default scroll handlers when touch scroll is enabled. This leads to mouse events like clicks not working when they originate from the table. The changeset here relaxes this by making sure we only prevent the default behavior for `touchmove` events instead of `touchstart` and `touchend`.
this.props.stopScrollDefaultHandling, | ||
this.props.stopScrollPropagation | ||
); | ||
this._setupHandlers(); |
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.
The registration of the scroll/touch handlers have been moved to a new helper _setupHandlers()
.
See #657 for more details.
this._staticRowArray[i] = null; | ||
continue; | ||
} | ||
const rowIndex = defaultTo( |
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.
From #677 where there's an extra guard check to ensure rowIndex
doesn't go out of bounds.
/** | ||
* Whether this cell is visible (i.e, inside the viewport) or not. | ||
*/ | ||
isVisible: PropTypes.bool.isRequired, |
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.
From #658 where we expose isVisible
cell prop to the cell renderer so that the client can easily figure out if a given cell is within the visible viewport.
@@ -95,10 +95,6 @@ class ReactTouchHandler { | |||
} | |||
|
|||
onTouchStart(/*object*/ event) { | |||
if (this._preventDefault) { |
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.
From #679, where we don't prevent default the touch handlers for onTouchStart
and onTouchEnd
events.
This is based on the suggestion from MDN docs (https://developer.mozilla.org/en-US/docs/Web/API/Touch_events#handling_clicks).
Since calling preventDefault() on a touchstart or the first touchmove event of a series prevents the corresponding mouse events from firing, it's common to call preventDefault() on touchmove rather than touchstart. That way, mouse events can still fire and things like links will continue to work. Alternatively, some frameworks have taken to re-firing touch events as mouse events for this same purpose.
* | ||
* (Read more on automatic batching by React here: https://github.com/reactwg/react-18/discussions/21) | ||
*/ | ||
const flushSync = ReactDOM.flushSync || ((fn) => fn()); // ReactDOM.flushSync doesn't exist in older versions of React |
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.
From #672.
global.oCancelAnimationFrame || | ||
global.msCancelAnimationFrame || | ||
global.clearTimeout; | ||
globalThis.cancelAnimationFrame || |
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.
From #674, where global
doesn't exist in vitejs environments, so we instead use a polyfilled version of globalThis
(which is standard).
@@ -3385,9 +3385,9 @@ decimal.js@^10.3.1: | |||
integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== | |||
|
|||
decode-uri-component@^0.2.0: |
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.
dependabot update -- #665
@@ -5748,9 +5748,9 @@ loader-runner@^2.4.0: | |||
integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== | |||
|
|||
loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: |
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.
dependabot update -- #660
@@ -8081,9 +8081,9 @@ semver-compare@^1.0.0: | |||
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= | |||
|
|||
semver-regex@^3.1.2: |
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.
dependabot updates -- #636
LGTM !! |
There's a decent no:of conflicts. I'll make another PR. |
Description
This merges master (v1.2.19) to our v2.0-beta branch in preparation of the v2 release.
How Has This Been Tested?
Tested local examples.
Types of changes
Checklist: