From 34a09a30962b1d15f4b9ec73c2529d1ad2cc9612 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 12:20:57 -0800 Subject: [PATCH] Bump react-virtual from 2.8.0 to 2.8.2 in /desktop (#2999) Summary: Bumps [react-virtual](https://github.com/tannerlinsley/react-virtual) from 2.8.0 to 2.8.2.
Release notes

Sourced from react-virtual's releases.

v2.8.2

2.8.2 (2021-09-30)

Performance Improvements

v2.8.1

2.8.1 (2021-08-05)

Bug Fixes

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=react-virtual&package-manager=npm_and_yarn&previous-version=2.8.0&new-version=2.8.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `dependabot rebase` will rebase this PR - `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `dependabot merge` will merge this PR after your CI passes on it - `dependabot squash and merge` will squash and merge this PR after your CI passes on it - `dependabot cancel merge` will cancel a previously requested merge and block automerging - `dependabot reopen` will reopen this PR if it is closed - `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Pull Request resolved: https://github.com/facebook/flipper/pull/2999 Reviewed By: passy Differential Revision: D31991577 Pulled By: mweststrate fbshipit-source-id: b81c96b80478c4ae92aac26e809eabec8dbe90e9 --- desktop/flipper-plugin/package.json | 2 +- .../data-source/DataSourceRendererVirtual.tsx | 1 + .../src/ui/data-table/DataTable.tsx | 2 +- .../data-table/__tests__/DataTable.node.tsx | 7 ++++ desktop/yarn.lock | 35 +++++++++---------- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/desktop/flipper-plugin/package.json b/desktop/flipper-plugin/package.json index 5f9fd0c55..5d1a2afa3 100644 --- a/desktop/flipper-plugin/package.json +++ b/desktop/flipper-plugin/package.json @@ -19,7 +19,7 @@ "lodash": "^4.17.21", "react-color": "^2.19.3", "react-element-to-jsx-string": "^14.3.2", - "react-virtual": "^2.8.0", + "react-virtual": "^2.8.2", "string-natural-compare": "^3.0.0", "uuid": "^8.3.2" }, diff --git a/desktop/flipper-plugin/src/data-source/DataSourceRendererVirtual.tsx b/desktop/flipper-plugin/src/data-source/DataSourceRendererVirtual.tsx index e01394094..75262157c 100644 --- a/desktop/flipper-plugin/src/data-source/DataSourceRendererVirtual.tsx +++ b/desktop/flipper-plugin/src/data-source/DataSourceRendererVirtual.tsx @@ -107,6 +107,7 @@ export const DataSourceRendererVirtual: ( useObserver: isUnitTest ? () => ({height: 500, width: 1000}) : undefined, // eslint-disable-next-line estimateSize: useCallback(() => defaultRowHeight, [forceHeightRecalculation.current, defaultRowHeight]), + // TODO: optimise by using setting a keyExtractor if DataSource is keyed overscan: 0, }); if (virtualizerRef) { diff --git a/desktop/flipper-plugin/src/ui/data-table/DataTable.tsx b/desktop/flipper-plugin/src/ui/data-table/DataTable.tsx index fe2e71f22..534e1235e 100644 --- a/desktop/flipper-plugin/src/ui/data-table/DataTable.tsx +++ b/desktop/flipper-plugin/src/ui/data-table/DataTable.tsx @@ -536,7 +536,7 @@ export function DataTable( { dispatch({type: 'toggleAutoScroll'}); diff --git a/desktop/flipper-plugin/src/ui/data-table/__tests__/DataTable.node.tsx b/desktop/flipper-plugin/src/ui/data-table/__tests__/DataTable.node.tsx index 4898a9425..00c18efe9 100644 --- a/desktop/flipper-plugin/src/ui/data-table/__tests__/DataTable.node.tsx +++ b/desktop/flipper-plugin/src/ui/data-table/__tests__/DataTable.node.tsx @@ -13,6 +13,7 @@ import {render, act} from '@testing-library/react'; import {createDataSource} from '../../../state/createDataSource'; import {computeDataTableFilter, DataTableManager} from '../DataTableManager'; import {Button} from 'antd'; +import {sleep} from 'flipper-common'; type Todo = { title: string; @@ -272,7 +273,13 @@ test('search', async () => { act(() => { ref.current?.reset(); }); + await sleep(100); // Needed due to internal scheduling change in react-virtual const elem = await rendering.findAllByText(/item/); + expect(elem.map((e) => e.textContent)).toEqual([ + 'item abc', + 'item x', + 'item b', + ]); expect(elem.length).toBe(3); } }); diff --git a/desktop/yarn.lock b/desktop/yarn.lock index 13ba84cc9..b6cd78f29 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -4306,12 +4306,12 @@ browser-resolve@^1.11.3: resolve "1.1.7" browserslist@^4.16.5, browserslist@^4.16.6, browserslist@^4.17.5: - version "4.17.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.6.tgz#c76be33e7786b497f66cad25a73756c8b938985d" - integrity sha512-uPgz3vyRTlEiCv4ee9KlsKgo2V6qPk7Jsn0KAn2OBqbqKo3iNcPEC1Ti6J4dwnz+aIRfEEEuOzC9IBk8tXUomw== + version "4.17.5" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.5.tgz#c827bbe172a4c22b123f5e337533ceebadfdd559" + integrity sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA== dependencies: - caniuse-lite "^1.0.30001274" - electron-to-chromium "^1.3.886" + caniuse-lite "^1.0.30001271" + electron-to-chromium "^1.3.878" escalade "^3.1.1" node-releases "^2.0.1" picocolors "^1.0.0" @@ -4519,10 +4519,10 @@ camelcase@^6.0.0, camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001274: - version "1.0.30001278" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001278.tgz#51cafc858df77d966b17f59b5839250b24417fff" - integrity sha512-mpF9KeH8u5cMoEmIic/cr7PNS+F5LWBk0t2ekGT60lFf0Wq+n9LspAj0g3P+o7DQhD3sUdlMln4YFAWhFYn9jg== +caniuse-lite@^1.0.30001271: + version "1.0.30001271" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz#0dda0c9bcae2cf5407cd34cac304186616cc83e8" + integrity sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA== capture-exit@^2.0.0: version "2.0.0" @@ -5711,10 +5711,10 @@ electron-publish@22.14.5: lazy-val "^1.0.5" mime "^2.5.2" -electron-to-chromium@^1.3.886: - version "1.3.890" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.890.tgz#e7143b659f73dc4d0512d1ae4baeb0fb9e7bc835" - integrity sha512-VWlVXSkv0cA/OOehrEyqjUTHwV8YXCPTfPvbtoeU2aHR21vI4Ejh5aC4AxUwOmbLbBgb6Gd3URZahoCxtBqCYQ== +electron-to-chromium@^1.3.878: + version "1.3.878" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.878.tgz#baa9fb5c24b9b580f08fb245cbb52a22f8fc8fa8" + integrity sha512-O6yxWCN9ph2AdspAIszBnd9v8s11hQx8ub9w4UGApzmNRnoKhbulOWqbO8THEQec/aEHtvy+donHZMlh6l1rbA== electron@11.2.3: version "11.2.3" @@ -11322,10 +11322,10 @@ react-transition-group@2.9.0: prop-types "^15.6.2" react-lifecycles-compat "^3.0.4" -react-virtual@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/react-virtual/-/react-virtual-2.8.0.tgz#d05d9a5e0c9c594708ce4ce88bb33e2b0b66487e" - integrity sha512-VATjk/+4fk8daERyz/hOcZ20yMErSh/v9g9Ayqp+zcNgPAT1pnjpnUmZGscp87TP1aqLKMbl05+mcUbg65pJAg== +react-virtual@^2.8.2: + version "2.8.2" + resolved "https://registry.yarnpkg.com/react-virtual/-/react-virtual-2.8.2.tgz#e204b30c57c426bd260ed1ac49f8b1099e92b7cb" + integrity sha512-CwnvF/3Jev4M14S9S7fgzGc0UFQ/bG/VXbrUCq+AB0zH8WGnVDTG0lQT7O3jPY76YLPzTHBu+AMl64Stp8+exg== dependencies: "@reach/observe-rect" "^1.1.0" @@ -13563,7 +13563,6 @@ xmlchars@^2.2.0: xmldom@^0.5.0, "xmldom@github:xmldom/xmldom#0.7.0": version "0.7.0" - uid c568938641cc1f121cef5b4df80fcfda1e489b6e resolved "https://codeload.github.com/xmldom/xmldom/tar.gz/c568938641cc1f121cef5b4df80fcfda1e489b6e" xtend@^4.0.0, xtend@~4.0.1: