Skip to content
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

Merged
merged 27 commits into from
Jul 11, 2023
Merged

Conversation

pradeepnschrodinger
Copy link
Collaborator

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

pradeepnschrodinger and others added 26 commits June 30, 2022 13:48
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.
Expose cell visibility through a new cell renderer prop, named `isVisible`.
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.
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
Adds a polyfill for globalThis.

This also changes usages of `global` to `globalThis`.
This was necessary for clients using FDT in Vite, since Vite doesn't seem to be defining/shimming `global`.
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();
Copy link
Collaborator Author

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(
Copy link
Collaborator Author

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,
Copy link
Collaborator Author

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) {
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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 ||
Copy link
Collaborator Author

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:
Copy link
Collaborator Author

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:
Copy link
Collaborator Author

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:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependabot updates -- #636

@AmanGupta2708
Copy link
Collaborator

LGTM !!
Let also grab changes of #686 before merging.

@pradeepnschrodinger pradeepnschrodinger merged commit 2d10594 into v2.0-beta Jul 11, 2023
6 checks passed
@pradeepnschrodinger pradeepnschrodinger deleted the merge-v2.0-beta-master branch July 11, 2023 18:20
@pradeepnschrodinger
Copy link
Collaborator Author

LGTM !! Let also grab changes of #686 before merging.

There's a decent no:of conflicts. I'll make another PR.

@pradeepnschrodinger pradeepnschrodinger added this to the v2.0 milestone Jul 11, 2023
@pradeepnschrodinger pradeepnschrodinger added the v2.0-beta Tickets targeting the v2.0-beta branch. label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.0-beta Tickets targeting the v2.0-beta branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants