From f1d1e23b2710f23378bca3fc6a9be70ed1ab818b Mon Sep 17 00:00:00 2001 From: Gijs Weterings Date: Tue, 20 Apr 2021 05:19:54 -0700 Subject: [PATCH 001/259] bump react-native-github's metro version to v0.66.0 Summary: Updates the Metro packages used in RN to v0.66.0, excluding the Metro server, which isn't a direct dependency. Changelog: [Internal] Metro changelog: https://github.com/facebook/metro/releases/tag/v0.66.0 Reviewed By: motiz88 Differential Revision: D27879399 fbshipit-source-id: e4014772d1fed2c93b32993fa2519f4e179a25a5 --- package.json | 8 ++--- template/package.json | 2 +- yarn.lock | 78 +++++++++++++++++++++---------------------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index 98106cbd4ebe04..ff97165954dae3 100644 --- a/package.json +++ b/package.json @@ -103,10 +103,10 @@ "hermes-engine": "~0.7.0", "invariant": "^2.2.4", "jsc-android": "^245459.0.0", - "metro-babel-register": "0.65.2", - "metro-react-native-babel-transformer": "0.65.2", - "metro-runtime": "0.65.2", - "metro-source-map": "0.65.2", + "metro-babel-register": "0.66.0", + "metro-react-native-babel-transformer": "0.66.0", + "metro-runtime": "0.66.0", + "metro-source-map": "0.66.0", "nullthrows": "^1.1.1", "pretty-format": "^26.5.2", "promise": "^8.0.3", diff --git a/template/package.json b/template/package.json index f72d8d7163b5a0..672733af532db7 100644 --- a/template/package.json +++ b/template/package.json @@ -20,7 +20,7 @@ "babel-jest": "^26.6.3", "eslint": "7.14.0", "jest": "^26.6.3", - "metro-react-native-babel-preset": "^0.65.2", + "metro-react-native-babel-preset": "^0.66.0", "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.1" }, diff --git a/yarn.lock b/yarn.lock index 79857c7e8e55ef..e2a52cf2096dec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4580,10 +4580,10 @@ metro-babel-register@0.64.0: "@babel/register" "^7.0.0" escape-string-regexp "^1.0.5" -metro-babel-register@0.65.2: - version "0.65.2" - resolved "https://registry.yarnpkg.com/metro-babel-register/-/metro-babel-register-0.65.2.tgz#1e27be9b9fd472a768649d7c5e565460de02ac46" - integrity sha512-2tm4GYzioVinIkh/rtUvurMB1j4ze6FTg/EfBDdM+ZHILDH8eGokHq+jfMD1ja8C4Tj83yks6dwCryxKDKoLdQ== +metro-babel-register@0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/metro-babel-register/-/metro-babel-register-0.66.0.tgz#4a2646a0197189d0e7f85b93f823bb57e5bcc28e" + integrity sha512-Al1fJquMISNsbjaHOYVFVYO5vxyw3gOvIf1ScdxNwzndCOA+5yersRO7JSUUoVfoQZAXEdtcj027BthPmHDjsw== dependencies: "@babel/core" "^7.0.0" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.0.0" @@ -4603,13 +4603,13 @@ metro-babel-transformer@0.64.0: metro-source-map "0.64.0" nullthrows "^1.1.1" -metro-babel-transformer@0.65.2: - version "0.65.2" - resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.65.2.tgz#1715803f9c36416aff278ea613b6e04c31c35159" - integrity sha512-QMWXYg+WLhPb+ima6BbD2mmR1ThPQJBnegxLGJwF9wiilaEHRjcDDedHxjXL/6nec+BPVSNlZbhHD3KggPhNxQ== +metro-babel-transformer@0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.66.0.tgz#77b8f5fde576d35220caed5c17ba5e4e626304d2" + integrity sha512-IJCF4wILV4FT8xX4DHSntFKjYZFBi/3EJ+4TQlvcauZv89c7u4HEZ+Jjmg+M6L4pnv1m8GRNjRcgilnsY9N5nw== dependencies: "@babel/core" "^7.0.0" - metro-source-map "0.65.2" + metro-source-map "0.66.0" nullthrows "^1.1.1" metro-cache-key@0.64.0: @@ -4714,10 +4714,10 @@ metro-react-native-babel-preset@0.64.0: "@babel/template" "^7.0.0" react-refresh "^0.4.0" -metro-react-native-babel-preset@0.65.2: - version "0.65.2" - resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.65.2.tgz#786cbb8b21daa614cbbebcc5c3ce72b6b0710892" - integrity sha512-jBpZwJwnGHXUnzoZl81LlUzvec2dh1llMJ2A7pbTMuCKhx4LjqOGEE1E+hkNqj/Uh7gi6tCPy5JYSCo9Ue/Vog== +metro-react-native-babel-preset@0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.66.0.tgz#a4495df4b24a2eb9f82705e0a53f4cbbd36d983e" + integrity sha512-rO3yayxplLNxFDc7HyMShN+psgEb2mbw15EMreNvgV8QnXNYHmgU6e15tLbtEvC8LuftOLuSufEdSmR/ykm+aA== dependencies: "@babel/core" "^7.0.0" "@babel/plugin-proposal-class-properties" "^7.0.0" @@ -4760,16 +4760,16 @@ metro-react-native-babel-preset@0.65.2: "@babel/template" "^7.0.0" react-refresh "^0.4.0" -metro-react-native-babel-transformer@0.65.2: - version "0.65.2" - resolved "https://registry.yarnpkg.com/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.65.2.tgz#133b3134929ee05aa46107404e60e04434c93d42" - integrity sha512-9cecDjvEPZefcRaePToAh8ae4dukIF+npdyy8rXq9kRv5ezW6qUQsvp9NRcqPjqu8H1rueE89ewLblH2x8Dgsw== +metro-react-native-babel-transformer@0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.66.0.tgz#eaba6b478c3aff3533c690d181ef8cda646035cf" + integrity sha512-MLnhAM5uLNthw6QIKsUMH1ICVQv9fk3Isyy3B1cDWvnXXNtBs6+7OBKwfWk9I45O257kAG3drxKu5RS5+tAt0w== dependencies: "@babel/core" "^7.0.0" babel-preset-fbjs "^3.3.0" - metro-babel-transformer "0.65.2" - metro-react-native-babel-preset "0.65.2" - metro-source-map "0.65.2" + metro-babel-transformer "0.66.0" + metro-react-native-babel-preset "0.66.0" + metro-source-map "0.66.0" nullthrows "^1.1.1" metro-react-native-babel-transformer@^0.64.0: @@ -4796,10 +4796,10 @@ metro-runtime@0.64.0, metro-runtime@^0.64.0: resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.64.0.tgz#cdaa1121d91041bf6345f2a69eb7c2fb289eff7b" integrity sha512-m7XbWOaIOeFX7YcxUhmnOi6Pg8EaeL89xyZ+quZyZVF1aNoTr4w8FfbKxvijpjsytKHIZtd+43m2Wt5JrqyQmQ== -metro-runtime@0.65.2: - version "0.65.2" - resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.65.2.tgz#bedbf165928ce5450f77e08479558d0cf6d21d40" - integrity sha512-qHxPdzoJVZEuOHR//wMvOmB6Dc+JJUqy7yuT72TDm7Ou0HTGXbFGw3RDV0AxR9HC0100SgAL63kes7v4LaAMVg== +metro-runtime@0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.66.0.tgz#aff887fdcbcd202b18ae1c2a9d8572d0289fec00" + integrity sha512-oGkALjm248OGbPN0ivrI52gS6yEBnWH9Jr+rHZDSdldD/MZtpT77hBgwLj+fu0axkRgGF9xnBji0KZvozaDXKQ== metro-source-map@0.64.0: version "0.64.0" @@ -4815,17 +4815,17 @@ metro-source-map@0.64.0: source-map "^0.5.6" vlq "^1.0.0" -metro-source-map@0.65.2: - version "0.65.2" - resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.65.2.tgz#7010109b4e644afd46bd47e641fa28459039b0ef" - integrity sha512-qL9f2QVtjR5t7DmdV2oid8ewRLXcfxpE9ShAzVUDCsyh1QNcFMR5SNKuxPc2QIZ5TkJo8OHX45+0Tv43BRTsYg== +metro-source-map@0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.66.0.tgz#3a61cd8d671842f54cb2863595d026bb1011ce7f" + integrity sha512-uutlmYb92uo/diHsbxk9RTi7e49PAfwMkw2RFPfDTUrjOr+DZICv1ltkQxs/dCgHaNm/nQ1T9hJpM/vuJavREA== dependencies: "@babel/traverse" "^7.0.0" "@babel/types" "^7.0.0" invariant "^2.2.4" - metro-symbolicate "0.65.2" + metro-symbolicate "0.66.0" nullthrows "^1.1.1" - ob1 "0.65.2" + ob1 "0.66.0" source-map "^0.5.6" vlq "^1.0.0" @@ -4841,13 +4841,13 @@ metro-symbolicate@0.64.0: through2 "^2.0.1" vlq "^1.0.0" -metro-symbolicate@0.65.2: - version "0.65.2" - resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.65.2.tgz#952d7ffabaa94ba7d3b75aea66235f860245864f" - integrity sha512-MHeRjVpEuh6HmgokmpyswaUy5uln6VZD+i78yGSl3u8Wr19/2Rdy/6WpSFd2paGo6GKbK6ea7XKdDkV0S2MhUg== +metro-symbolicate@0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.66.0.tgz#cac5fd328bb63ae20f5c64b85d86a9c08097377a" + integrity sha512-OasmbRZQBJ36mYMF4T0ckXditMRrekKMG8qJezPxvizCpS3xILNTpkVyP6crCpDuMNdxbd9GcTwYKxM5YKOdLw== dependencies: invariant "^2.2.4" - metro-source-map "0.65.2" + metro-source-map "0.66.0" nullthrows "^1.1.1" source-map "^0.5.6" through2 "^2.0.1" @@ -5234,10 +5234,10 @@ ob1@0.64.0: resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.64.0.tgz#f254a55a53ca395c4f9090e28a85483eac5eba19" integrity sha512-CO1N+5dhvy+MoAwxz8+fymEUcwsT4a+wHhrHFb02LppcJdHxgcBWviwEhUwKOD2kLMQ7ijrrzybOqpGcqEtvpQ== -ob1@0.65.2: - version "0.65.2" - resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.65.2.tgz#d2a85dc8e1e0ccdf10f662335f9b471c6a3c61ba" - integrity sha512-34WR3dQ6M7Y8cVNiuyRCtJHwavUKY2Nu8RAm7pwJs/y0n+Q9SB6k/wLtPBHh8jQzYVelo6qc940LsM1gXVE0Tg== +ob1@0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.66.0.tgz#e7d52b4c49ecae2e4831d127081131b7f050984b" + integrity sha512-7G2SpMAUKFTydtao80/5FD6uN5MTRXfVqly7NPbl7YpO0MBe3SNMLRQw0oDoefMjpt1f2pYfq/UG40Sdc59yqQ== object-assign@^4.1.1: version "4.1.1" From de318cd3188fa9a5a597bd77750896ee053b1578 Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Tue, 20 Apr 2021 05:49:28 -0700 Subject: [PATCH 002/259] React Native sync for revisions c9aab1c...f7cdc89 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This sync includes the following changes: - **[f7cdc8936](https://github.com/facebook/react/commit/f7cdc8936 )**: Also turn off enableSyncDefaultUpdates in RN test renderer ([#21293](https://github.com/facebook/react/pull/21293)) //// - **[4c9eb2af1](https://github.com/facebook/react/commit/4c9eb2af1 )**: Add dynamic flags to React Native ([#21291](https://github.com/facebook/react/pull/21291)) //// - **[9eddfbf5a](https://github.com/facebook/react/commit/9eddfbf5a )**: [Fizz] Two More Fixes ([#21288](https://github.com/facebook/react/pull/21288)) //// - **[11b07597e](https://github.com/facebook/react/commit/11b07597e )**: Fix classes ([#21283](https://github.com/facebook/react/pull/21283)) //// - **[96d00b9bb](https://github.com/facebook/react/commit/96d00b9bb )**: [Fizz] Random Fixes ([#21277](https://github.com/facebook/react/pull/21277)) //// - **[81ef53953](https://github.com/facebook/react/commit/81ef53953 )**: Always insert a dummy node with an ID into fallbacks ([#21272](https://github.com/facebook/react/pull/21272)) //// - **[a4a940d7a](https://github.com/facebook/react/commit/a4a940d7a )**: [Fizz] Add unsupported Portal/Scope components ([#21261](https://github.com/facebook/react/pull/21261)) //// - **[f4d7a0f1e](https://github.com/facebook/react/commit/f4d7a0f1e )**: Implement useOpaqueIdentifier ([#21260](https://github.com/facebook/react/pull/21260)) //// - **[dde875dfb](https://github.com/facebook/react/commit/dde875dfb )**: [Fizz] Implement Hooks ([#21257](https://github.com/facebook/react/pull/21257)) //// - **[a597c2f5d](https://github.com/facebook/react/commit/a597c2f5d )**: [Fizz] Fix reentrancy bug ([#21270](https://github.com/facebook/react/pull/21270)) //// - **[15e779d92](https://github.com/facebook/react/commit/15e779d92 )**: Reconciler should inject its own version into DevTools hook ([#21268](https://github.com/facebook/react/pull/21268)) //// - **[4f76a28c9](https://github.com/facebook/react/commit/4f76a28c9 )**: [Fizz] Implement New Context ([#21255](https://github.com/facebook/react/pull/21255)) //// - **[82ef450e0](https://github.com/facebook/react/commit/82ef450e0 )**: remove obsolete SharedArrayBuffer ESLint config ([#21259](https://github.com/facebook/react/pull/21259)) //// - **[dbadfa2c3](https://github.com/facebook/react/commit/dbadfa2c3 )**: [Fizz] Classes Follow Up ([#21253](https://github.com/facebook/react/pull/21253)) //// - **[686b635b7](https://github.com/facebook/react/commit/686b635b7 )**: Prevent reading canonical property of null ([#21242](https://github.com/facebook/react/pull/21242)) //// - **[bb88ce95a](https://github.com/facebook/react/commit/bb88ce95a )**: Bugfix: Don't rely on `finishedLanes` for passive effects ([#21233](https://github.com/facebook/react/pull/21233)) //// - **[343710c92](https://github.com/facebook/react/commit/343710c92 )**: [Fizz] Fragments and Iterable support ([#21228](https://github.com/facebook/react/pull/21228)) //// - **[933880b45](https://github.com/facebook/react/commit/933880b45 )**: Make time-slicing opt-in ([#21072](https://github.com/facebook/react/pull/21072)) //// - **[b0407b55f](https://github.com/facebook/react/commit/b0407b55f )**: Support more empty types ([#21225](https://github.com/facebook/react/pull/21225)) //// - **[39713716a](https://github.com/facebook/react/commit/39713716a )**: Merge isObject branches ([#21226](https://github.com/facebook/react/pull/21226)) //// - **[8a4a59c72](https://github.com/facebook/react/commit/8a4a59c72 )**: Remove textarea special case from child fiber ([#21222](https://github.com/facebook/react/pull/21222)) //// - **[dc108b0f5](https://github.com/facebook/react/commit/dc108b0f5 )**: Track which fibers scheduled the current render work ([#15658](https://github.com/facebook/react/pull/15658)) //// - **[6ea749170](https://github.com/facebook/react/commit/6ea749170 )**: Fix typo in comment ([#21214](https://github.com/facebook/react/pull/21214)) //// - **[b38ac13f9](https://github.com/facebook/react/commit/b38ac13f9 )**: DevTools: Add post-commit hook ([#21183](https://github.com/facebook/react/pull/21183)) //// - **[b943aeba8](https://github.com/facebook/react/commit/b943aeba8 )**: Fix: Passive effect updates are never sync ([#21215](https://github.com/facebook/react/pull/21215)) //// - **[d389c54d1](https://github.com/facebook/react/commit/d389c54d1 )**: Offscreen: Use JS stack to track hidden/unhidden subtree state ([#21211](https://github.com/facebook/react/pull/21211)) //// - **[c486dc1a4](https://github.com/facebook/react/commit/c486dc1a4 )**: Remove unnecessary processUpdateQueue ([#21199](https://github.com/facebook/react/pull/21199)) //// - **[cf45a623a](https://github.com/facebook/react/commit/cf45a623a )**: [Fizz] Implement Classes ([#21200](https://github.com/facebook/react/pull/21200)) //// - **[75c616554](https://github.com/facebook/react/commit/75c616554 )**: Include actual type of `Profiler#id` on type mismatch ([#20306](https://github.com/facebook/react/pull/20306)) //// - **[1214b302e](https://github.com/facebook/react/commit/1214b302e )**: test: Fix "couldn't locate all inline snapshots" ([#21205](https://github.com/facebook/react/pull/21205)) //// - **[1a02d2792](https://github.com/facebook/react/commit/1a02d2792 )**: style: delete unused isHost check ([#21203](https://github.com/facebook/react/pull/21203)) //// - **[782f689ca](https://github.com/facebook/react/commit/782f689ca )**: Don't double invoke getDerivedStateFromProps for module pattern ([#21193](https://github.com/facebook/react/pull/21193)) //// - **[e90c76a65](https://github.com/facebook/react/commit/e90c76a65 )**: Revert "Offscreen: Use JS stack to track hidden/unhidden subtree state" ([#21194](https://github.com/facebook/react/pull/21194)) //// - **[1f8583de8](https://github.com/facebook/react/commit/1f8583de8 )**: Offscreen: Use JS stack to track hidden/unhidden subtree state ([#21192](https://github.com/facebook/react/pull/21192)) //// - **[ad6e6ec7b](https://github.com/facebook/react/commit/ad6e6ec7b )**: [Fizz] Prepare Recursive Loop for More Types ([#21186](https://github.com/facebook/react/pull/21186)) //// - **[172e89b4b](https://github.com/facebook/react/commit/172e89b4b )**: Reland Remove redundant initial of isArray ([#21188](https://github.com/facebook/react/pull/21188)) //// - **[7c1ba2b57](https://github.com/facebook/react/commit/7c1ba2b57 )**: Proposed new Suspense layout effect semantics ([#21079](https://github.com/facebook/react/pull/21079)) //// - **[316aa3686](https://github.com/facebook/react/commit/316aa3686 )**: [Scheduler] Fix de-opt caused by out-of-bounds access ([#21147](https://github.com/facebook/react/pull/21147)) //// - **[b4f119cdf](https://github.com/facebook/react/commit/b4f119cdf )**: Revert "Remove redundant initial of isArray ([#21163](https://github.com/facebook/react/pull/21163))" //// - **[c03197063](https://github.com/facebook/react/commit/c03197063 )**: Revert "apply prettier ([#21165](https://github.com/facebook/react/pull/21165))" //// - **[94fd1214d](https://github.com/facebook/react/commit/94fd1214d )**: apply prettier ([#21165](https://github.com/facebook/react/pull/21165)) //// - **[b130a0f5c](https://github.com/facebook/react/commit/b130a0f5c )**: Remove redundant initial of isArray ([#21163](https://github.com/facebook/react/pull/21163)) //// - **[2c9fef32d](https://github.com/facebook/react/commit/2c9fef32d )**: Remove redundant initial of hasOwnProperty ([#21134](https://github.com/facebook/react/pull/21134)) //// - **[1cf9978d8](https://github.com/facebook/react/commit/1cf9978d8 )**: Don't pass internals to callbacks ([#21161](https://github.com/facebook/react/pull/21161)) //// - **[b9e4c10e9](https://github.com/facebook/react/commit/b9e4c10e9 )**: [Fizz] Implement all the DOM attributes and special cases ([#21153](https://github.com/facebook/react/pull/21153)) //// - **[f8ef4ff57](https://github.com/facebook/react/commit/f8ef4ff57 )**: Flush discrete passive effects before paint ([#21150](https://github.com/facebook/react/pull/21150)) //// - **[b48b38af6](https://github.com/facebook/react/commit/b48b38af6 )**: Support nesting of startTransition and flushSync (alt) ([#21149](https://github.com/facebook/react/pull/21149)) //// Changelog: [General][Changed] - React Native sync for revisions c9aab1c...f7cdc89 jest_e2e[run_all_tests] Reviewed By: rickhanlonii Differential Revision: D27740113 fbshipit-source-id: 6e27204d78e3e16ed205170006cb97c0d6bfa957 --- Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 644 +++++++++-------- .../implementations/ReactFabric-prod.fb.js | 441 ++++++------ .../ReactFabric-profiling.fb.js | 552 +++++++-------- .../ReactNativeRenderer-dev.fb.js | 648 +++++++++-------- .../ReactNativeRenderer-prod.fb.js | 550 +++++++-------- .../ReactNativeRenderer-profiling.fb.js | 661 +++++++++--------- 7 files changed, 1826 insertions(+), 1672 deletions(-) diff --git a/Libraries/Renderer/REVISION b/Libraries/Renderer/REVISION index 35a6ff2d75f5a7..7de3a3ff9489a6 100644 --- a/Libraries/Renderer/REVISION +++ b/Libraries/Renderer/REVISION @@ -1 +1 @@ -c9aab1c9d00ce407b1c61c385b356d49cd147f60 \ No newline at end of file +f7cdc893618e9701a8e3403b2b63bfc8233c6771 \ No newline at end of file diff --git a/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index 177533bae2082b..91b1392c03acac 100644 --- a/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<7d94bdf10150fe93a2e9fa8bbf998840>> + * @generated SignedSource<<8e2b098b8adc0535d0c66734daceb246>> */ 'use strict'; @@ -380,6 +380,12 @@ function clearCaughtError() { } } +var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + +function isArray(a) { + return isArrayImpl(a); +} + var getFiberCurrentPropsFromNode = null; var getInstanceFromNode = null; var getNodeFromInstance = null; @@ -407,13 +413,13 @@ var validateEventDispatches; validateEventDispatches = function(event) { var dispatchListeners = event._dispatchListeners; var dispatchInstances = event._dispatchInstances; - var listenersIsArr = Array.isArray(dispatchListeners); + var listenersIsArr = isArray(dispatchListeners); var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; - var instancesIsArr = Array.isArray(dispatchInstances); + var instancesIsArr = isArray(dispatchInstances); var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances @@ -450,7 +456,7 @@ function executeDispatchesInOrder(event) { validateEventDispatches(event); } - if (Array.isArray(dispatchListeners)) { + if (isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; @@ -481,7 +487,7 @@ function executeDispatchesInOrderStopAtTrueImpl(event) { validateEventDispatches(event); } - if (Array.isArray(dispatchListeners)) { + if (isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; @@ -527,7 +533,7 @@ function executeDirectDispatch(event) { var dispatchListener = event._dispatchListeners; var dispatchInstance = event._dispatchInstances; - if (!!Array.isArray(dispatchListener)) { + if (!!isArray(dispatchListener)) { throw Error("executeDirectDispatch(...): Invalid `event`."); } @@ -1154,11 +1160,11 @@ function accumulate(current, next) { } // Both are not empty. Warning: Never call x.concat(y) when you are not // certain that x is an Array (x could be a string with concat method). - if (Array.isArray(current)) { + if (isArray(current)) { return current.concat(next); } - if (Array.isArray(next)) { + if (isArray(next)) { return [current].concat(next); } @@ -1190,8 +1196,8 @@ function accumulateInto(current, next) { } // Both are not empty. Warning: Never call x.concat(y) when you are not // certain that x is an Array (x could be a string with concat method). - if (Array.isArray(current)) { - if (Array.isArray(next)) { + if (isArray(current)) { + if (isArray(next)) { current.push.apply(current, next); return current; } @@ -1200,7 +1206,7 @@ function accumulateInto(current, next) { return current; } - if (Array.isArray(next)) { + if (isArray(next)) { // A bit too dangerous to mutate `next`. return [current].concat(next); } @@ -2505,7 +2511,10 @@ function getFiberCurrentPropsFromNode$1(inst) { var ReactFabricGlobalResponderHandler = { onChange: function(from, to, blockNativeResponder) { var fromOrTo = from || to; - var isFabric = !!fromOrTo.stateNode.canonical._internalInstanceHandle; + var fromOrToStateNode = fromOrTo && fromOrTo.stateNode; + var isFabric = !!( + fromOrToStateNode && fromOrToStateNode.canonical._internalInstanceHandle + ); if (isFabric); else { @@ -2809,7 +2818,7 @@ var enableLazyElements = false; var warnAboutStringRefs = false; var enableNewReconciler = false; var deferRenderPhaseUpdateToNextBatch = true; -var enableLazyContextPropagation = false; // Flow magic to verify the exports of this file match the original version. +var enableLazyContextPropagation = false; // Don't change these two values. They're used by React Dev Tools. var NoFlags = @@ -2878,9 +2887,15 @@ var ForceUpdateForLegacySuspense = // since we can defer traversing the tree during layout to look for Passive effects, // and instead rely on the static flag as a signal that there may be cleanup work. +var RefStatic = + /* */ + 262144; +var LayoutStatic = + /* */ + 524288; var PassiveStatic = /* */ - 262144; // These flags allow us to traverse to fibers that have effects on mount + 1048576; // These flags allow us to traverse to fibers that have effects on mount // don't contain effects, by checking subtreeFlags. var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visiblity @@ -2900,7 +2915,7 @@ var PassiveMask = Passive | ChildDeletion; // Union of tags that don't get reset // This allows certain concepts to persist without recalculting them, // e.g. whether a subtree contains passive effects or portals. -var StaticMask = PassiveStatic; +var StaticMask = LayoutStatic | PassiveStatic | RefStatic; var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function getNearestMountedFiber(fiber) { @@ -3248,7 +3263,7 @@ function restoreDeletedValuesInNestedArray( node, validAttributes ) { - if (Array.isArray(node)) { + if (isArray(node)) { var i = node.length; while (i-- && removedKeyCount > 0) { @@ -3373,12 +3388,12 @@ function diffNestedProperty( return updatePayload; } - if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) { + if (!isArray(prevProp) && !isArray(nextProp)) { // Both are leaves, we can diff the leaves. return diffProperties(updatePayload, prevProp, nextProp, validAttributes); } - if (Array.isArray(prevProp) && Array.isArray(nextProp)) { + if (isArray(prevProp) && isArray(nextProp)) { // Both are arrays, we can diff the arrays. return diffNestedArrayProperty( updatePayload, @@ -3388,7 +3403,7 @@ function diffNestedProperty( ); } - if (Array.isArray(prevProp)) { + if (isArray(prevProp)) { return diffProperties( updatePayload, // $FlowFixMe - We know that this is always an object when the input is. ReactNativePrivateInterface.flattenStyle(prevProp), // $FlowFixMe - We know that this isn't an array because of above flow. @@ -3415,7 +3430,7 @@ function addNestedProperty(updatePayload, nextProp, validAttributes) { return updatePayload; } - if (!Array.isArray(nextProp)) { + if (!isArray(nextProp)) { // Add each property of the leaf. return addProperties(updatePayload, nextProp, validAttributes); } @@ -3441,7 +3456,7 @@ function clearNestedProperty(updatePayload, prevProp, validAttributes) { return updatePayload; } - if (!Array.isArray(prevProp)) { + if (!isArray(prevProp)) { // Add each property of the leaf. return clearProperties(updatePayload, prevProp, validAttributes); } @@ -3830,6 +3845,179 @@ function dispatchEvent(target, topLevelType, nativeEvent) { // where it would do it. } +// This module only exists as an ESM wrapper around the external CommonJS +var scheduleCallback = Scheduler.unstable_scheduleCallback; +var cancelCallback = Scheduler.unstable_cancelCallback; +var shouldYield = Scheduler.unstable_shouldYield; +var requestPaint = Scheduler.unstable_requestPaint; +var now = Scheduler.unstable_now; +var ImmediatePriority = Scheduler.unstable_ImmediatePriority; +var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; +var NormalPriority = Scheduler.unstable_NormalPriority; +var IdlePriority = Scheduler.unstable_IdlePriority; + +{ + // Provide explicit error message when production+profiling bundle of e.g. + // react-dom is used with production (non-profiling) bundle of + // scheduler/tracing + if ( + !( + tracing.__interactionsRef != null && + tracing.__interactionsRef.current != null + ) + ) { + throw Error( + "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" + ); + } +} + +var rendererID = null; +var injectedHook = null; +var hasLoggedError = false; +var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined"; +function injectInternals(internals) { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") { + // No DevTools + return false; + } + + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + + if (hook.isDisabled) { + // This isn't a real property on the hook, but it can be set to opt out + // of DevTools integration and associated warnings and logs. + // https://github.com/facebook/react/issues/3877 + return true; + } + + if (!hook.supportsFiber) { + { + error( + "The installed version of React DevTools is too old and will not work " + + "with the current version of React. Please update React DevTools. " + + "https://reactjs.org/link/react-devtools" + ); + } // DevTools exists, even though it doesn't support Fiber. + + return true; + } + + try { + rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. + + injectedHook = hook; + } catch (err) { + // Catch all errors because it is unsafe to throw during initialization. + { + error("React instrumentation encountered an error: %s.", err); + } + } // DevTools exists + + return true; +} +function onScheduleRoot(root, children) { + { + if ( + injectedHook && + typeof injectedHook.onScheduleFiberRoot === "function" + ) { + try { + injectedHook.onScheduleFiberRoot(rendererID, root, children); + } catch (err) { + if (!hasLoggedError) { + hasLoggedError = true; + + error("React instrumentation encountered an error: %s", err); + } + } + } + } +} +function onCommitRoot(root, eventPriority) { + if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") { + try { + var didError = (root.current.flags & DidCapture) === DidCapture; + + if (enableProfilerTimer) { + var schedulerPriority; + + switch (eventPriority) { + case DiscreteEventPriority: + schedulerPriority = ImmediatePriority; + break; + + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + + case DefaultEventPriority: + schedulerPriority = NormalPriority; + break; + + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + + default: + schedulerPriority = NormalPriority; + break; + } + + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } else { + injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError); + } + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + + error("React instrumentation encountered an error: %s", err); + } + } + } + } +} +function onPostCommitRoot(root) { + if ( + injectedHook && + typeof injectedHook.onPostCommitFiberRoot === "function" + ) { + try { + injectedHook.onPostCommitFiberRoot(rendererID, root); + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + + error("React instrumentation encountered an error: %s", err); + } + } + } + } +} +function onCommitUnmount(fiber) { + if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") { + try { + injectedHook.onCommitFiberUnmount(rendererID, fiber); + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + + error("React instrumentation encountered an error: %s", err); + } + } + } + } +} + // If those values are changed that package should be rebuilt and redeployed. var TotalLanes = 31; @@ -3843,7 +4031,7 @@ var SyncLane = /* */ 1; var InputContinuousHydrationLane = - /* */ + /* */ 2; var InputContinuousLane = /* */ @@ -4477,6 +4665,9 @@ function setCurrentUpdatePriority(newPriority) { function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } +function lowerEventPriority(a, b) { + return a === 0 || a > b ? a : b; +} function isHigherEventPriority(a, b) { return a !== 0 && a < b; } @@ -5052,6 +5243,8 @@ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { return ""; } +var hasOwnProperty = Object.prototype.hasOwnProperty; + var loggedTypeFailures = {}; var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; @@ -5074,7 +5267,7 @@ function setCurrentlyValidatingElement(element) { function checkPropTypes(typeSpecs, values, location, componentName, element) { { // $FlowFixMe This is okay but Flow doesn't know it. - var has = Function.call.bind(Object.prototype.hasOwnProperty); + var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { @@ -5474,161 +5667,6 @@ function findCurrentUnmaskedContext(fiber) { var LegacyRoot = 0; var ConcurrentRoot = 1; -// This module only exists as an ESM wrapper around the external CommonJS -var scheduleCallback = Scheduler.unstable_scheduleCallback; -var cancelCallback = Scheduler.unstable_cancelCallback; -var shouldYield = Scheduler.unstable_shouldYield; -var requestPaint = Scheduler.unstable_requestPaint; -var now = Scheduler.unstable_now; -var ImmediatePriority = Scheduler.unstable_ImmediatePriority; -var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; -var NormalPriority = Scheduler.unstable_NormalPriority; -var IdlePriority = Scheduler.unstable_IdlePriority; - -{ - // Provide explicit error message when production+profiling bundle of e.g. - // react-dom is used with production (non-profiling) bundle of - // scheduler/tracing - if ( - !( - tracing.__interactionsRef != null && - tracing.__interactionsRef.current != null - ) - ) { - throw Error( - "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" - ); - } -} - -var rendererID = null; -var injectedHook = null; -var hasLoggedError = false; -var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined"; -function injectInternals(internals) { - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") { - // No DevTools - return false; - } - - var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; - - if (hook.isDisabled) { - // This isn't a real property on the hook, but it can be set to opt out - // of DevTools integration and associated warnings and logs. - // https://github.com/facebook/react/issues/3877 - return true; - } - - if (!hook.supportsFiber) { - { - error( - "The installed version of React DevTools is too old and will not work " + - "with the current version of React. Please update React DevTools. " + - "https://reactjs.org/link/react-devtools" - ); - } // DevTools exists, even though it doesn't support Fiber. - - return true; - } - - try { - rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. - - injectedHook = hook; - } catch (err) { - // Catch all errors because it is unsafe to throw during initialization. - { - error("React instrumentation encountered an error: %s.", err); - } - } // DevTools exists - - return true; -} -function onScheduleRoot(root, children) { - { - if ( - injectedHook && - typeof injectedHook.onScheduleFiberRoot === "function" - ) { - try { - injectedHook.onScheduleFiberRoot(rendererID, root, children); - } catch (err) { - if (!hasLoggedError) { - hasLoggedError = true; - - error("React instrumentation encountered an error: %s", err); - } - } - } - } -} -function onCommitRoot(root, eventPriority) { - if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") { - try { - var didError = (root.current.flags & DidCapture) === DidCapture; - - if (enableProfilerTimer) { - var schedulerPriority; - - switch (eventPriority) { - case DiscreteEventPriority: - schedulerPriority = ImmediatePriority; - break; - - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - - case DefaultEventPriority: - schedulerPriority = NormalPriority; - break; - - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - - default: - schedulerPriority = NormalPriority; - break; - } - - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } else { - injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError); - } - } catch (err) { - { - if (!hasLoggedError) { - hasLoggedError = true; - - error("React instrumentation encountered an error: %s", err); - } - } - } - } -} -function onCommitUnmount(fiber) { - if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") { - try { - injectedHook.onCommitFiberUnmount(rendererID, fiber); - } catch (err) { - { - if (!hasLoggedError) { - hasLoggedError = true; - - error("React instrumentation encountered an error: %s", err); - } - } - } - } -} - var syncQueue = null; var isFlushingSyncQueue = false; function scheduleSyncCallback(callback) { @@ -5739,7 +5777,6 @@ function is(x, y) { var objectIs = typeof Object.is === "function" ? Object.is : is; -var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. @@ -7097,8 +7134,7 @@ function commitUpdateQueue(finishedWork, finishedQueue, instance) { } } -var fakeInternalInstance = {}; -var isArray = Array.isArray; // React.Component uses a shared frozen object by default. +var fakeInternalInstance = {}; // React.Component uses a shared frozen object by default. // We'll use it to determine whether we need to initialize legacy refs. var emptyRefsObject = new React.Component().refs; @@ -7216,6 +7252,7 @@ function applyDerivedStateFromProps( updateQueue.baseState = memoizedState; } } + var classComponentUpdater = { isMounted: isMounted, enqueueSetState: function(inst, payload, callback) { @@ -7865,7 +7902,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { } } - processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; var getDerivedStateFromProps = ctor.getDerivedStateFromProps; @@ -7894,9 +7930,9 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { } if (typeof instance.componentDidMount === "function") { - { - workInProgress.flags |= Update; - } + var fiberFlags = Update; + + workInProgress.flags |= fiberFlags; } } @@ -7958,9 +7994,9 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === "function") { - { - workInProgress.flags |= Update; - } + var fiberFlags = Update; + + workInProgress.flags |= fiberFlags; } return false; @@ -8006,17 +8042,17 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { } if (typeof instance.componentDidMount === "function") { - { - workInProgress.flags |= Update; - } + var _fiberFlags = Update; + + workInProgress.flags |= _fiberFlags; } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === "function") { - { - workInProgress.flags |= Update; - } + var _fiberFlags2 = Update; + + workInProgress.flags |= _fiberFlags2; } // If shouldComponentUpdate returned false, we should still update the // memoized state to indicate that this work can be reused. @@ -8257,8 +8293,6 @@ var warnForMissingKey = function(child, returnFiber) {}; }; } -var isArray$1 = Array.isArray; - function coerceRef(returnFiber, current, element) { var mixedRef = element.ref; @@ -8373,18 +8407,16 @@ function coerceRef(returnFiber, current, element) { } function throwOnInvalidObjectType(returnFiber, newChild) { - if (returnFiber.type !== "textarea") { - var childString = Object.prototype.toString.call(newChild); + var childString = Object.prototype.toString.call(newChild); - { - throw Error( - "Objects are not valid as a React child (found: " + - (childString === "[object Object]" - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : childString) + - "). If you meant to render a collection of children, use an array instead." - ); - } + { + throw Error( + "Objects are not valid as a React child (found: " + + (childString === "[object Object]" + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : childString) + + "). If you meant to render a collection of children, use an array instead." + ); } } @@ -8640,7 +8672,7 @@ function ChildReconciler(shouldTrackSideEffects) { } } - if (isArray$1(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild)) { var _created3 = createFiberFromFragment( newChild, returnFiber.mode, @@ -8698,7 +8730,7 @@ function ChildReconciler(shouldTrackSideEffects) { } } - if (isArray$1(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild)) { if (key !== null) { return null; } @@ -8753,7 +8785,7 @@ function ChildReconciler(shouldTrackSideEffects) { } } - if (isArray$1(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild)) { var _matchedFiber3 = existingChildren.get(newIdx) || null; return updateFragment( @@ -9363,9 +9395,7 @@ function ChildReconciler(shouldTrackSideEffects) { newChild = newChild.props.children; } // Handle object types - var isObject = typeof newChild === "object" && newChild !== null; - - if (isObject) { + if (typeof newChild === "object" && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: return placeSingleChild( @@ -9387,6 +9417,26 @@ function ChildReconciler(shouldTrackSideEffects) { ) ); } + + if (isArray(newChild)) { + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + + if (getIteratorFn(newChild)) { + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + + throwOnInvalidObjectType(returnFiber, newChild); } if (typeof newChild === "string" || typeof newChild === "number") { @@ -9400,28 +9450,6 @@ function ChildReconciler(shouldTrackSideEffects) { ); } - if (isArray$1(newChild)) { - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - } - - if (getIteratorFn(newChild)) { - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - } - - if (isObject) { - throwOnInvalidObjectType(returnFiber, newChild); - } - { if (typeof newChild === "function") { warnOnFunctionType(returnFiber); @@ -9873,7 +9901,7 @@ function updateHookTypesDev() { function checkDepsAreArrayDev(deps) { { - if (deps !== undefined && deps !== null && !Array.isArray(deps)) { + if (deps !== undefined && deps !== null && !isArray(deps)) { // Verify deps, but only on mount to avoid extra checks. // It's unlikely their type would change as usually you define them inline. error( @@ -10093,7 +10121,7 @@ function renderWithHooks( if ( current !== null && - (current.flags & PassiveStatic) !== (workInProgress.flags & PassiveStatic) + (current.flags & StaticMask) !== (workInProgress.flags & StaticMask) ) { error( "Internal React error: Expected static flag was missing. Please " + @@ -10907,9 +10935,9 @@ function updateEffect(create, deps) { } function mountLayoutEffect(create, deps) { - { - return mountEffectImpl(Update, Layout, create, deps); - } + var fiberFlags = Update; + + return mountEffectImpl(fiberFlags, Layout, create, deps); } function updateLayoutEffect(create, deps) { @@ -10961,15 +10989,14 @@ function mountImperativeHandle(ref, create, deps) { var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + var fiberFlags = Update; - { - return mountEffectImpl( - Update, - Layout, - imperativeHandleEffect.bind(null, create, ref), - effectDeps - ); - } + return mountEffectImpl( + fiberFlags, + Layout, + imperativeHandleEffect.bind(null, create, ref), + effectDeps + ); } function updateImperativeHandle(ref, create, deps) { @@ -13341,17 +13368,6 @@ function mountIndeterminateComponent( workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; initializeUpdateQueue(workInProgress); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - - if (typeof getDerivedStateFromProps === "function") { - applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - props - ); - } - adoptClassInstance(workInProgress, value); mountClassInstance(workInProgress, Component, props, renderLanes); return finishClassComponent( @@ -14111,11 +14127,12 @@ function validateTailOptions(tailMode, revealOrder) { function validateSuspenseListNestedChild(childSlot, index) { { - var isArray = Array.isArray(childSlot); - var isIterable = !isArray && typeof getIteratorFn(childSlot) === "function"; + var isAnArray = isArray(childSlot); + var isIterable = + !isAnArray && typeof getIteratorFn(childSlot) === "function"; - if (isArray || isIterable) { - var type = isArray ? "array" : "iterable"; + if (isAnArray || isIterable) { + var type = isAnArray ? "array" : "iterable"; error( "A nested %s was passed to row #%s in . Wrap it in " + @@ -14143,7 +14160,7 @@ function validateSuspenseListChildren(children, revealOrder) { children !== null && children !== false ) { - if (Array.isArray(children)) { + if (isArray(children)) { for (var i = 0; i < children.length; i++) { if (!validateSuspenseListNestedChild(children[i], i)) { return; @@ -15750,7 +15767,7 @@ function completeWork(current, workInProgress, renderLanes) { var _primaryChildFragment2 = workInProgress.child; if (_primaryChildFragment2 !== null) { - // $FlowFixMe Flow doens't support type casting in combiation with the -= operator + // $FlowFixMe Flow doesn't support type casting in combination with the -= operator workInProgress.treeBaseDuration -= _primaryChildFragment2.treeBaseDuration; } @@ -16418,6 +16435,7 @@ function attachPingListener(root, wakeable, lanes) { // Memoize using the thread ID to prevent redundant listeners. threadIDs.add(lanes); var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); + wakeable.then(ping, ping); } } @@ -16651,10 +16669,9 @@ var didWarnAboutUndefinedSnapshotBeforeUpdate = null; { didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); -} - +} // Used during the commit phase to track the state of the Offscreen component stack. var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set; -var nextEffect = null; +var nextEffect = null; // Used for Profiling builds to track updaters. var callComponentWillUnmountWithTimer = function(current, instance) { instance.props = current.memoizedProps; @@ -16663,7 +16680,7 @@ var callComponentWillUnmountWithTimer = function(current, instance) { { instance.componentWillUnmount(); } -}; // Capture errors so they don't interrupt unmounting. +}; // Capture errors so they don't interrupt mounting. function safelyCallComponentWillUnmount( current, @@ -16684,7 +16701,7 @@ function safelyCallComponentWillUnmount( captureCommitPhaseError(current, nearestMountedAncestor, unmountError); } } -} +} // Capture errors so they don't interrupt mounting. function safelyDetachRef(current, nearestMountedAncestor) { var ref = current.ref; @@ -17603,6 +17620,7 @@ function attachSuspenseRetryListeners(finishedWork) { } retryCache.add(wakeable); + wakeable.then(retry, retry); } }); @@ -17624,7 +17642,7 @@ function isSuspenseBoundaryBeingHidden(current, finishedWork) { return false; } -function commitMutationEffects(root, firstChild) { +function commitMutationEffects(root, firstChild, committedLanes) { nextEffect = firstChild; commitMutationEffects_begin(root); } @@ -17765,6 +17783,9 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { } function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { + // Suspense layout effects semantics don't change for legacy roots. + var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; + while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; @@ -17779,6 +17800,9 @@ function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { } function commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) { + // Suspense layout effects semantics don't change for legacy roots. + var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; + while (nextEffect !== null) { var fiber = nextEffect; @@ -18107,6 +18131,7 @@ if (typeof Symbol === "function" && Symbol.for) { var ceil = Math.ceil; var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing; var NoContext = /* */ @@ -18270,6 +18295,7 @@ function requestUpdateLane(fiber) { // TODO: Move this type conversion to the event priority module. var eventLane = getCurrentEventPriority(); + return eventLane; } @@ -18295,7 +18321,7 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { if (root === null) { warnAboutUpdateOnUnmountedFiberInDEV(fiber); return null; - } // Mark that the root has a pending update. + } markRootUpdated(root, lane, eventTime); @@ -18814,7 +18840,10 @@ function performSyncWorkOnRoot(root) { var finishedWork = root.current.alternate; root.finishedWork = finishedWork; root.finishedLanes = lanes; - commitRoot(root); // Before exiting, make sure there's a callback scheduled for the next + + { + commitRoot(root); + } // Before exiting, make sure there's a callback scheduled for the next // pending level. ensureRootIsScheduled(root, now()); @@ -18839,9 +18868,11 @@ function batchedUpdates$1(fn, a) { function flushSync(fn, a) { var prevExecutionContext = executionContext; executionContext |= BatchedContext; + var prevTransition = ReactCurrentBatchConfig$2.transition; var previousPriority = getCurrentUpdatePriority(); try { + ReactCurrentBatchConfig$2.transition = 0; setCurrentUpdatePriority(DiscreteEventPriority); if (fn) { @@ -18851,6 +18882,7 @@ function flushSync(fn, a) { } } finally { setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. // Note that this will happen even if batchedUpdates is higher up // the stack. @@ -19296,11 +19328,14 @@ function commitRoot(root) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); + var prevTransition = ReactCurrentBatchConfig$2.transition; try { + ReactCurrentBatchConfig$2.transition = 0; setCurrentUpdatePriority(DiscreteEventPriority); commitRootImpl(root, previousUpdateLanePriority); } finally { + ReactCurrentBatchConfig$2.transition = prevTransition; setCurrentUpdatePriority(previousUpdateLanePriority); } @@ -19386,6 +19421,8 @@ function commitRootImpl(root, renderPriorityLevel) { NoFlags; if (subtreeHasEffects || rootHasEffect) { + var prevTransition = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = 0; var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(DiscreteEventPriority); var prevExecutionContext = executionContext; @@ -19431,6 +19468,7 @@ function commitRootImpl(root, renderPriorityLevel) { executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value. setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; } else { // No effects. root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were @@ -19518,6 +19556,20 @@ function commitRootImpl(root, renderPriorityLevel) { // of the batch. return null; + } // If the passive effects are the result of a discrete render, flush them + // synchronously at the end of the current task so that the result is + // immediately observable. Otherwise, we assume that they are not + // order-dependent and do not need to be observed by external systems, so we + // can wait until after paint. + // TODO: We can optimize this by not scheduling the callback earlier. Since we + // currently schedule the callback in multiple places, will wait until those + // are consolidated. + + if ( + includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && + root.tag !== LegacyRoot + ) { + flushPassiveEffects(); } // If layout work was scheduled, flush it now. flushSyncCallbackQueue(); @@ -19527,18 +19579,24 @@ function commitRootImpl(root, renderPriorityLevel) { function flushPassiveEffects() { // Returns whether passive effects were flushed. - if (pendingPassiveEffectsLanes !== NoLanes) { - var priority = higherEventPriority( - DefaultEventPriority, - lanesToEventPriority(pendingPassiveEffectsLanes) - ); + // TODO: Combine this check with the one in flushPassiveEFfectsImpl. We should + // probably just combine the two functions. I believe they were only separate + // in the first place because we used to wrap it with + // `Scheduler.runWithPriority`, which accepts a function. But now we track the + // priority within React itself, so we can mutate the variable directly. + if (rootWithPendingPassiveEffects !== null) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); + var priority = lowerEventPriority(DefaultEventPriority, renderPriority); + var prevTransition = ReactCurrentBatchConfig$2.transition; var previousPriority = getCurrentUpdatePriority(); try { + ReactCurrentBatchConfig$2.transition = 0; setCurrentUpdatePriority(priority); return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; } } @@ -19552,7 +19610,10 @@ function flushPassiveEffectsImpl() { var root = rootWithPendingPassiveEffects; var lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; + rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects. + // Figure out why and fix it. It's not causing any known issues (probably + // because it's only used for profiling), but it's a refactor hazard. + pendingPassiveEffectsLanes = NoLanes; if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) { @@ -19583,7 +19644,10 @@ function flushPassiveEffectsImpl() { // exceeds the limit, we'll fire a warning. nestedPassiveUpdateCount = - rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1; + rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1; // TODO: Move to commitPassiveMountEffects + + onPostCommitRoot(root); + return true; } @@ -21228,7 +21292,10 @@ function createFiberFromFragment(elements, mode, lanes, key) { function createFiberFromProfiler(pendingProps, mode, lanes, key) { { if (typeof pendingProps.id !== "string") { - error('Profiler must specify an "id" as a prop'); + error( + 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', + typeof pendingProps.id + ); } } @@ -21642,10 +21709,10 @@ var setSuspenseHandler = null; { var copyWithDeleteImpl = function(obj, path, index) { var key = path[index]; - var updated = Array.isArray(obj) ? obj.slice() : Object.assign({}, obj); + var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); if (index + 1 === path.length) { - if (Array.isArray(updated)) { + if (isArray(updated)) { updated.splice(key, 1); } else { delete updated[key]; @@ -21664,14 +21731,14 @@ var setSuspenseHandler = null; var copyWithRenameImpl = function(obj, oldPath, newPath, index) { var oldKey = oldPath[index]; - var updated = Array.isArray(obj) ? obj.slice() : Object.assign({}, obj); + var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); if (index + 1 === oldPath.length) { var newKey = newPath[index]; // $FlowFixMe number or string is fine here updated[newKey] = updated[oldKey]; - if (Array.isArray(updated)) { + if (isArray(updated)) { updated.splice(oldKey, 1); } else { delete updated[oldKey]; @@ -21716,7 +21783,7 @@ var setSuspenseHandler = null; } var key = path[index]; - var updated = Array.isArray(obj) ? obj.slice() : Object.assign({}, obj); // $FlowFixMe number or string is fine here + var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); // $FlowFixMe number or string is fine here updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); return updated; @@ -21873,7 +21940,10 @@ function injectIntoDevTools(devToolsConfig) { scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, // Enables DevTools to append owner stacks to error messages in DEV mode. - getCurrentFiber: getCurrentFiberForDevTools + getCurrentFiber: getCurrentFiberForDevTools, + // Enables DevTools to detect reconciler version rather than renderer version + // which may not match for third party renderers. + reconcilerVersion: ReactVersion }); } diff --git a/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 9f53caacdd48fa..5175a2c7064cdc 100644 --- a/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<90d01c86a28a69abef2fe93114ca8dd8>> */ "use strict"; @@ -62,7 +62,8 @@ function invokeGuardedCallbackAndCatchFirstError( hasRethrowError || ((hasRethrowError = !0), (rethrowError = error)); } } -var getFiberCurrentPropsFromNode = null, +var isArrayImpl = Array.isArray, + getFiberCurrentPropsFromNode = null, getInstanceFromNode = null, getNodeFromInstance = null; function executeDispatch(event, listener, inst) { @@ -74,7 +75,7 @@ function executeDispatch(event, listener, inst) { function executeDirectDispatch(event) { var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - if (Array.isArray(dispatchListener)) + if (isArrayImpl(dispatchListener)) throw Error("executeDirectDispatch(...): Invalid `event`."); event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) @@ -335,9 +336,9 @@ function accumulate(current, next) { ); return null == current ? next - : Array.isArray(current) + : isArrayImpl(current) ? current.concat(next) - : Array.isArray(next) + : isArrayImpl(next) ? [current].concat(next) : [current, next]; } @@ -347,12 +348,12 @@ function accumulateInto(current, next) { "accumulateInto(...): Accumulated items must not be null or undefined." ); if (null == current) return next; - if (Array.isArray(current)) { - if (Array.isArray(next)) return current.push.apply(current, next), current; + if (isArrayImpl(current)) { + if (isArrayImpl(next)) return current.push.apply(current, next), current; current.push(next); return current; } - return Array.isArray(next) ? [current].concat(next) : [current, next]; + return isArrayImpl(next) ? [current].concat(next) : [current, next]; } function forEachAccumulated(arr, cb, scope) { Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); @@ -578,7 +579,7 @@ var ResponderEventPlugin = { b: { JSCompiler_temp = shouldSetEventType._dispatchListeners; targetInst = shouldSetEventType._dispatchInstances; - if (Array.isArray(JSCompiler_temp)) + if (isArrayImpl(JSCompiler_temp)) for ( depthA = 0; depthA < JSCompiler_temp.length && @@ -929,7 +930,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_214 = { +var injectedNamesToPlugins$jscomp$inline_215 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -964,34 +965,34 @@ var injectedNamesToPlugins$jscomp$inline_214 = { } } }, - isOrderingDirty$jscomp$inline_215 = !1, - pluginName$jscomp$inline_216; -for (pluginName$jscomp$inline_216 in injectedNamesToPlugins$jscomp$inline_214) + isOrderingDirty$jscomp$inline_216 = !1, + pluginName$jscomp$inline_217; +for (pluginName$jscomp$inline_217 in injectedNamesToPlugins$jscomp$inline_215) if ( - injectedNamesToPlugins$jscomp$inline_214.hasOwnProperty( - pluginName$jscomp$inline_216 + injectedNamesToPlugins$jscomp$inline_215.hasOwnProperty( + pluginName$jscomp$inline_217 ) ) { - var pluginModule$jscomp$inline_217 = - injectedNamesToPlugins$jscomp$inline_214[pluginName$jscomp$inline_216]; + var pluginModule$jscomp$inline_218 = + injectedNamesToPlugins$jscomp$inline_215[pluginName$jscomp$inline_217]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_216) || - namesToPlugins[pluginName$jscomp$inline_216] !== - pluginModule$jscomp$inline_217 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_217) || + namesToPlugins[pluginName$jscomp$inline_217] !== + pluginModule$jscomp$inline_218 ) { - if (namesToPlugins[pluginName$jscomp$inline_216]) + if (namesToPlugins[pluginName$jscomp$inline_217]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_216 + + pluginName$jscomp$inline_217 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_216 - ] = pluginModule$jscomp$inline_217; - isOrderingDirty$jscomp$inline_215 = !0; + pluginName$jscomp$inline_217 + ] = pluginModule$jscomp$inline_218; + isOrderingDirty$jscomp$inline_216 = !0; } } -isOrderingDirty$jscomp$inline_215 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_216 && recomputePluginOrdering(); function getInstanceFromInstance(instanceHandle) { return instanceHandle; } @@ -1006,7 +1007,8 @@ getNodeFromInstance = function(inst) { }; ResponderEventPlugin.injection.injectGlobalResponderHandler({ onChange: function(from, to, blockNativeResponder) { - (from || to).stateNode.canonical._internalInstanceHandle || + ((from = (from = from || to) && from.stateNode) && + from.canonical._internalInstanceHandle) || (null !== to ? ReactNativePrivateInterface.UIManager.setJSResponder( to.stateNode.canonical._nativeTag, @@ -1307,7 +1309,7 @@ function restoreDeletedValuesInNestedArray( node, validAttributes ) { - if (Array.isArray(node)) + if (isArrayImpl(node)) for (var i = node.length; i-- && 0 < removedKeyCount; ) restoreDeletedValuesInNestedArray( updatePayload, @@ -1353,9 +1355,9 @@ function diffNestedProperty( : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload; - if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) + if (!isArrayImpl(prevProp) && !isArrayImpl(nextProp)) return diffProperties(updatePayload, prevProp, nextProp, validAttributes); - if (Array.isArray(prevProp) && Array.isArray(nextProp)) { + if (isArrayImpl(prevProp) && isArrayImpl(nextProp)) { var minLength = prevProp.length < nextProp.length ? prevProp.length : nextProp.length, i; @@ -1380,7 +1382,7 @@ function diffNestedProperty( ); return updatePayload; } - return Array.isArray(prevProp) + return isArrayImpl(prevProp) ? diffProperties( updatePayload, ReactNativePrivateInterface.flattenStyle(prevProp), @@ -1396,7 +1398,7 @@ function diffNestedProperty( } function addNestedProperty(updatePayload, nextProp, validAttributes) { if (!nextProp) return updatePayload; - if (!Array.isArray(nextProp)) + if (!isArrayImpl(nextProp)) return diffProperties( updatePayload, emptyObject, @@ -1413,7 +1415,7 @@ function addNestedProperty(updatePayload, nextProp, validAttributes) { } function clearNestedProperty(updatePayload, prevProp, validAttributes) { if (!prevProp) return updatePayload; - if (!Array.isArray(prevProp)) + if (!isArrayImpl(prevProp)) return diffProperties( updatePayload, prevProp, @@ -1531,7 +1533,7 @@ function executeDispatchesAndReleaseTopLevel(e) { if (e) { var dispatchListeners = e._dispatchListeners, dispatchInstances = e._dispatchInstances; - if (Array.isArray(dispatchListeners)) + if (isArrayImpl(dispatchListeners)) for ( var i = 0; i < dispatchListeners.length && !e.isPropagationStopped(); @@ -1591,6 +1593,28 @@ function dispatchEvent(target, topLevelType, nativeEvent) { } }); } +var scheduleCallback = Scheduler.unstable_scheduleCallback, + cancelCallback = Scheduler.unstable_cancelCallback, + shouldYield = Scheduler.unstable_shouldYield, + requestPaint = Scheduler.unstable_requestPaint, + now = Scheduler.unstable_now, + ImmediatePriority = Scheduler.unstable_ImmediatePriority, + UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + NormalPriority = Scheduler.unstable_NormalPriority, + IdlePriority = Scheduler.unstable_IdlePriority, + rendererID = null, + injectedHook = null; +function onCommitRoot(root) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + root, + void 0, + 128 === (root.current.flags & 128) + ); + } catch (err) {} +} var nextTransitionLane = 64, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { @@ -1905,7 +1929,8 @@ function describeFunctionComponentFrame(fn, source) { ? describeComponentFrame(fn.displayName || fn.name || null, source, null) : ""; } -var valueStack = [], +var hasOwnProperty = Object.prototype.hasOwnProperty, + valueStack = [], index = -1; function createCursor(defaultValue) { return { current: defaultValue }; @@ -2001,28 +2026,6 @@ function invalidateContextProvider(workInProgress, type, didChange) { : pop(didPerformWorkStackCursor); push(didPerformWorkStackCursor, didChange); } -var scheduleCallback = Scheduler.unstable_scheduleCallback, - cancelCallback = Scheduler.unstable_cancelCallback, - shouldYield = Scheduler.unstable_shouldYield, - requestPaint = Scheduler.unstable_requestPaint, - now = Scheduler.unstable_now, - ImmediatePriority = Scheduler.unstable_ImmediatePriority, - UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, - NormalPriority = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority, - rendererID = null, - injectedHook = null; -function onCommitRoot(root) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - injectedHook.onCommitFiberRoot( - rendererID, - root, - void 0, - 128 === (root.current.flags & 128) - ); - } catch (err) {} -} var syncQueue = null, isFlushingSyncQueue = !1; function flushSyncCallbackQueue() { @@ -2053,8 +2056,7 @@ var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } -var objectIs = "function" === typeof Object.is ? Object.is : is, - hasOwnProperty = Object.prototype.hasOwnProperty; +var objectIs = "function" === typeof Object.is ? Object.is : is; function shallowEqual(objA, objB) { if (objectIs(objA, objB)) return !0; if ( @@ -2547,7 +2549,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { ? previousContext : contextStackCursor.current), (instance.context = getMaskedContext(workInProgress, contextType))); - processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; contextType = ctor.getDerivedStateFromProps; "function" === typeof contextType && @@ -2569,7 +2570,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4); } -var isArray = Array.isArray; function coerceRef(returnFiber, current, element) { returnFiber = element.ref; if ( @@ -2622,15 +2622,14 @@ function coerceRef(returnFiber, current, element) { return returnFiber; } function throwOnInvalidObjectType(returnFiber, newChild) { - if ("textarea" !== returnFiber.type) - throw ((returnFiber = Object.prototype.toString.call(newChild)), - Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - )); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." + ); } function ChildReconciler(shouldTrackSideEffects) { function deleteChild(returnFiber, childToDelete) { @@ -2792,7 +2791,7 @@ function ChildReconciler(shouldTrackSideEffects) { newChild ); } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( (newChild = createFiberFromFragment( newChild, @@ -2824,7 +2823,7 @@ function ChildReconciler(shouldTrackSideEffects) { ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null; } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null); @@ -2863,7 +2862,7 @@ function ChildReconciler(shouldTrackSideEffects) { updatePortal(returnFiber, existingChildren, newChild, lanes) ); } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( (existingChildren = existingChildren.get(newIdx) || null), updateFragment(returnFiber, existingChildren, newChild, lanes, null) @@ -3046,20 +3045,19 @@ function ChildReconciler(shouldTrackSideEffects) { newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key; isUnkeyedTopLevelFragment && (newChild = newChild.props.children); - var isObject = "object" === typeof newChild && null !== newChild; - if (isObject) + if ("object" === typeof newChild && null !== newChild) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: a: { - isObject = newChild.key; + var key = newChild.key; for ( isUnkeyedTopLevelFragment = currentFirstChild; null !== isUnkeyedTopLevelFragment; ) { - if (isUnkeyedTopLevelFragment.key === isObject) { - isObject = newChild.type; - if (isObject === REACT_FRAGMENT_TYPE) { + if (isUnkeyedTopLevelFragment.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { if (7 === isUnkeyedTopLevelFragment.tag) { deleteRemainingChildren( returnFiber, @@ -3073,7 +3071,7 @@ function ChildReconciler(shouldTrackSideEffects) { returnFiber = currentFirstChild; break a; } - } else if (isUnkeyedTopLevelFragment.elementType === isObject) { + } else if (isUnkeyedTopLevelFragment.elementType === key) { deleteRemainingChildren( returnFiber, isUnkeyedTopLevelFragment.sibling @@ -3165,6 +3163,22 @@ function ChildReconciler(shouldTrackSideEffects) { } return placeSingleChild(returnFiber); } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } if ("string" === typeof newChild || "number" === typeof newChild) return ( (newChild = "" + newChild), @@ -3183,21 +3197,6 @@ function ChildReconciler(shouldTrackSideEffects) { (returnFiber = currentFirstChild)), placeSingleChild(returnFiber) ); - if (isArray(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - isObject && throwOnInvalidObjectType(returnFiber, newChild); if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment) switch (returnFiber.tag) { case 1: @@ -3662,7 +3661,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { hook.memoizedState = pushEffect(1 | hookFlags, create, destroy, deps); } function mountEffect(create, deps) { - return mountEffectImpl(263168, 4, create, deps); + return mountEffectImpl(1049600, 4, create, deps); } function updateEffect(create, deps) { return updateEffectImpl(1024, 4, create, deps); @@ -4655,7 +4654,7 @@ function updateSuspenseFallbackChildren( (primaryChildren.pendingProps = primaryChildProps), (workInProgress.deletions = null)) : ((primaryChildren = createWorkInProgress(current, primaryChildProps)), - (primaryChildren.subtreeFlags = current.subtreeFlags & 262144)); + (primaryChildren.subtreeFlags = current.subtreeFlags & 1835008)); null !== currentFallbackChildFragment ? (fallbackChildren = createWorkInProgress( currentFallbackChildFragment, @@ -5015,14 +5014,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$62 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$62 = lastTailNode), + for (var lastTailNode$64 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$64 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$62 + null === lastTailNode$64 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$62.sibling = null); + : (lastTailNode$64.sibling = null); } } function bubbleProperties(completedWork) { @@ -5032,19 +5031,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$63 = completedWork.child; null !== child$63; ) - (newChildLanes |= child$63.lanes | child$63.childLanes), - (subtreeFlags |= child$63.subtreeFlags & 262144), - (subtreeFlags |= child$63.flags & 262144), - (child$63.return = completedWork), - (child$63 = child$63.sibling); + for (var child$65 = completedWork.child; null !== child$65; ) + (newChildLanes |= child$65.lanes | child$65.childLanes), + (subtreeFlags |= child$65.subtreeFlags & 1835008), + (subtreeFlags |= child$65.flags & 1835008), + (child$65.return = completedWork), + (child$65 = child$65.sibling); else - for (child$63 = completedWork.child; null !== child$63; ) - (newChildLanes |= child$63.lanes | child$63.childLanes), - (subtreeFlags |= child$63.subtreeFlags), - (subtreeFlags |= child$63.flags), - (child$63.return = completedWork), - (child$63 = child$63.sibling); + for (child$65 = completedWork.child; null !== child$65; ) + (newChildLanes |= child$65.lanes | child$65.childLanes), + (subtreeFlags |= child$65.subtreeFlags), + (subtreeFlags |= child$65.flags), + (child$65.return = completedWork), + (child$65 = child$65.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -5241,7 +5240,7 @@ function completeWork(current, workInProgress, renderLanes) { for (newProps = workInProgress.child; null !== newProps; ) (renderLanes = newProps), (type = current), - (renderLanes.flags &= 262146), + (renderLanes.flags &= 1835010), (updatePayload = renderLanes.alternate), null === updatePayload ? ((renderLanes.childLanes = 0), @@ -5615,8 +5614,8 @@ function commitHookEffectListMount(tag, finishedWork) { var effect = (finishedWork = finishedWork.next); do { if ((effect.tag & tag) === tag) { - var create$80 = effect.create; - effect.destroy = create$80(); + var create$82 = effect.create; + effect.destroy = create$82(); } effect = effect.next; } while (effect !== finishedWork); @@ -5868,8 +5867,8 @@ function commitLayoutEffects(finishedWork) { commitUpdateQueue(firstChild, updateQueue, instance); break; case 3: - var updateQueue$81 = firstChild.updateQueue; - if (null !== updateQueue$81) { + var updateQueue$83 = firstChild.updateQueue; + if (null !== updateQueue$83) { current = null; if (null !== firstChild.child) switch (firstChild.child.tag) { @@ -5879,7 +5878,7 @@ function commitLayoutEffects(finishedWork) { case 1: current = firstChild.child.stateNode; } - commitUpdateQueue(firstChild, updateQueue$81, current); + commitUpdateQueue(firstChild, updateQueue$83, current); } break; case 5: @@ -5942,6 +5941,7 @@ function commitLayoutEffects(finishedWork) { var ceil = Math.ceil, ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, executionContext = 0, workInProgressRoot = null, workInProgress = null, @@ -6393,15 +6393,15 @@ function handleError(root$jscomp$0, thrownValue) { } var hasInvisibleParentBoundary = 0 !== (suspenseStackCursor.current & 1), - workInProgress$75 = returnFiber; + workInProgress$77 = returnFiber; do { var JSCompiler_temp; - if ((JSCompiler_temp = 13 === workInProgress$75.tag)) { - var nextState = workInProgress$75.memoizedState; + if ((JSCompiler_temp = 13 === workInProgress$77.tag)) { + var nextState = workInProgress$77.memoizedState; if (null !== nextState) JSCompiler_temp = null !== nextState.dehydrated ? !0 : !1; else { - var props = workInProgress$75.memoizedProps; + var props = workInProgress$77.memoizedProps; JSCompiler_temp = void 0 === props.fallback ? !1 @@ -6413,17 +6413,17 @@ function handleError(root$jscomp$0, thrownValue) { } } if (JSCompiler_temp) { - var wakeables = workInProgress$75.updateQueue; + var wakeables = workInProgress$77.updateQueue; if (null === wakeables) { var updateQueue = new Set(); updateQueue.add(wakeable); - workInProgress$75.updateQueue = updateQueue; + workInProgress$77.updateQueue = updateQueue; } else wakeables.add(wakeable); if ( - 0 === (workInProgress$75.mode & 1) && - workInProgress$75 !== returnFiber + 0 === (workInProgress$77.mode & 1) && + workInProgress$77 !== returnFiber ) { - workInProgress$75.flags |= 128; + workInProgress$77.flags |= 128; sourceFiber.flags |= 32768; sourceFiber.flags &= -10053; if (1 === sourceFiber.tag) @@ -6456,12 +6456,12 @@ function handleError(root$jscomp$0, thrownValue) { ); wakeable.then(ping, ping); } - workInProgress$75.flags |= 16384; - workInProgress$75.lanes = thrownValue; + workInProgress$77.flags |= 16384; + workInProgress$77.lanes = thrownValue; break a; } - workInProgress$75 = workInProgress$75.return; - } while (null !== workInProgress$75); + workInProgress$77 = workInProgress$77.return; + } while (null !== workInProgress$77); value = Error( (getComponentNameFromFiber(sourceFiber) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." @@ -6470,47 +6470,47 @@ function handleError(root$jscomp$0, thrownValue) { 5 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); value = createCapturedValue(value, sourceFiber); - workInProgress$75 = returnFiber; + workInProgress$77 = returnFiber; do { - switch (workInProgress$75.tag) { + switch (workInProgress$77.tag) { case 3: root = value; - workInProgress$75.flags |= 16384; + workInProgress$77.flags |= 16384; thrownValue &= -thrownValue; - workInProgress$75.lanes |= thrownValue; - var update$76 = createRootErrorUpdate( - workInProgress$75, + workInProgress$77.lanes |= thrownValue; + var update$78 = createRootErrorUpdate( + workInProgress$77, root, thrownValue ); - enqueueCapturedUpdate(workInProgress$75, update$76); + enqueueCapturedUpdate(workInProgress$77, update$78); break a; case 1: root = value; - var ctor = workInProgress$75.type, - instance = workInProgress$75.stateNode; + var ctor = workInProgress$77.type, + instance = workInProgress$77.stateNode; if ( - 0 === (workInProgress$75.flags & 128) && + 0 === (workInProgress$77.flags & 128) && ("function" === typeof ctor.getDerivedStateFromError || (null !== instance && "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) ) { - workInProgress$75.flags |= 16384; + workInProgress$77.flags |= 16384; thrownValue &= -thrownValue; - workInProgress$75.lanes |= thrownValue; - var update$79 = createClassErrorUpdate( - workInProgress$75, + workInProgress$77.lanes |= thrownValue; + var update$81 = createClassErrorUpdate( + workInProgress$77, root, thrownValue ); - enqueueCapturedUpdate(workInProgress$75, update$79); + enqueueCapturedUpdate(workInProgress$77, update$81); break a; } } - workInProgress$75 = workInProgress$75.return; - } while (null !== workInProgress$75); + workInProgress$77 = workInProgress$77.return; + } while (null !== workInProgress$77); } completeUnitOfWork(erroredWork); } catch (yetAnotherThrownValue) { @@ -6601,12 +6601,15 @@ function completeUnitOfWork(unitOfWork) { 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } function commitRoot(root) { - var previousUpdateLanePriority = currentUpdatePriority; + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig$2.transition; try { - (currentUpdatePriority = 1), + (ReactCurrentBatchConfig$2.transition = 0), + (currentUpdatePriority = 1), commitRootImpl(root, previousUpdateLanePriority); } finally { - currentUpdatePriority = previousUpdateLanePriority; + (ReactCurrentBatchConfig$2.transition = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); } return null; } @@ -6641,7 +6644,9 @@ function commitRootImpl(root, renderPriorityLevel) { })); remainingLanes = 0 !== (finishedWork.flags & 8054); if (0 !== (finishedWork.subtreeFlags & 8054) || remainingLanes) { - remainingLanes = currentUpdatePriority; + remainingLanes = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = 0; + var previousPriority = currentUpdatePriority; currentUpdatePriority = 1; var prevExecutionContext = executionContext; executionContext |= 16; @@ -6652,7 +6657,8 @@ function commitRootImpl(root, renderPriorityLevel) { commitLayoutEffects(finishedWork, root, lanes); requestPaint(); executionContext = prevExecutionContext; - currentUpdatePriority = remainingLanes; + currentUpdatePriority = previousPriority; + ReactCurrentBatchConfig$2.transition = remainingLanes; } else root.current = finishedWork; rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), @@ -6673,26 +6679,31 @@ function commitRootImpl(root, renderPriorityLevel) { (firstUncaughtError = null), root); if (0 !== (executionContext & 4)) return null; + 0 !== (pendingPassiveEffectsLanes & 1) && + 0 !== root.tag && + flushPassiveEffects(); flushSyncCallbackQueue(); return null; } function flushPassiveEffects() { - if (0 !== pendingPassiveEffectsLanes) { - var b = lanesToEventPriority(pendingPassiveEffectsLanes), + if (null !== rootWithPendingPassiveEffects) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$2.transition, previousPriority = currentUpdatePriority; try { - currentUpdatePriority = 16 < b ? 16 : b; + ReactCurrentBatchConfig$2.transition = 0; + currentUpdatePriority = 16 > renderPriority ? 16 : renderPriority; if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1; else { - var root = rootWithPendingPassiveEffects; + renderPriority = rootWithPendingPassiveEffects; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; if (0 !== (executionContext & 24)) throw Error("Cannot flush passive effects while already rendering."); - b = executionContext; + var prevExecutionContext = executionContext; executionContext |= 16; - for (nextEffect = root.current; null !== nextEffect; ) { + for (nextEffect = renderPriority.current; null !== nextEffect; ) { var fiber = nextEffect, child = fiber.child; if (0 !== (nextEffect.flags & 16)) { @@ -6767,7 +6778,7 @@ function flushPassiveEffects() { nextEffect = fiber.return; } } - var finishedWork = root.current; + var finishedWork = renderPriority.current; for (nextEffect = finishedWork; null !== nextEffect; ) { child = nextEffect; var firstChild = child.child; @@ -6800,13 +6811,21 @@ function flushPassiveEffects() { nextEffect = deletions.return; } } - executionContext = b; + executionContext = prevExecutionContext; flushSyncCallbackQueue(); + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} JSCompiler_inline_result = !0; } return JSCompiler_inline_result; } finally { - currentUpdatePriority = previousPriority; + (currentUpdatePriority = previousPriority), + (ReactCurrentBatchConfig$2.transition = prevTransition); } } return !1; @@ -7025,14 +7044,6 @@ beginWork$1 = function(current, workInProgress, renderLanes) { ? nextValue.state : null; initializeUpdateQueue(workInProgress); - var getDerivedStateFromProps = updateLanes.getDerivedStateFromProps; - "function" === typeof getDerivedStateFromProps && - applyDerivedStateFromProps( - workInProgress, - updateLanes, - getDerivedStateFromProps, - current - ); nextValue.updater = classComponentUpdater; workInProgress.stateNode = nextValue; nextValue._reactInternals = workInProgress; @@ -7247,11 +7258,11 @@ beginWork$1 = function(current, workInProgress, renderLanes) { updateLanes = workInProgress.type._context; nextValue = workInProgress.pendingProps; hasContext = workInProgress.memoizedProps; - getDerivedStateFromProps = nextValue.value; + var newValue = nextValue.value; push(valueCursor, updateLanes._currentValue2); - updateLanes._currentValue2 = getDerivedStateFromProps; + updateLanes._currentValue2 = newValue; if (null !== hasContext) - if (objectIs(hasContext.value, getDerivedStateFromProps)) { + if (objectIs(hasContext.value, newValue)) { if ( hasContext.children === nextValue.children && !didPerformWorkStackCursor.current @@ -7265,25 +7276,24 @@ beginWork$1 = function(current, workInProgress, renderLanes) { } } else for ( - getDerivedStateFromProps = workInProgress.child, - null !== getDerivedStateFromProps && - (getDerivedStateFromProps.return = workInProgress); - null !== getDerivedStateFromProps; + newValue = workInProgress.child, + null !== newValue && (newValue.return = workInProgress); + null !== newValue; ) { - var list = getDerivedStateFromProps.dependencies; + var list = newValue.dependencies; if (null !== list) { - hasContext = getDerivedStateFromProps.child; + hasContext = newValue.child; for ( var dependency = list.firstContext; null !== dependency; ) { if (dependency.context === updateLanes) { - if (1 === getDerivedStateFromProps.tag) { + if (1 === newValue.tag) { dependency = createUpdate(-1, renderLanes & -renderLanes); dependency.tag = 2; - var updateQueue = getDerivedStateFromProps.updateQueue; + var updateQueue = newValue.updateQueue; if (null !== updateQueue) { updateQueue = updateQueue.shared; var pending = updateQueue.pending; @@ -7294,13 +7304,10 @@ beginWork$1 = function(current, workInProgress, renderLanes) { updateQueue.pending = dependency; } } - getDerivedStateFromProps.lanes |= renderLanes; - dependency = getDerivedStateFromProps.alternate; + newValue.lanes |= renderLanes; + dependency = newValue.alternate; null !== dependency && (dependency.lanes |= renderLanes); - scheduleWorkOnParentPath( - getDerivedStateFromProps.return, - renderLanes - ); + scheduleWorkOnParentPath(newValue.return, renderLanes); list.lanes |= renderLanes; break; } @@ -7308,32 +7315,27 @@ beginWork$1 = function(current, workInProgress, renderLanes) { } } else hasContext = - 10 === getDerivedStateFromProps.tag - ? getDerivedStateFromProps.type === workInProgress.type + 10 === newValue.tag + ? newValue.type === workInProgress.type ? null - : getDerivedStateFromProps.child - : getDerivedStateFromProps.child; - if (null !== hasContext) - hasContext.return = getDerivedStateFromProps; + : newValue.child + : newValue.child; + if (null !== hasContext) hasContext.return = newValue; else - for ( - hasContext = getDerivedStateFromProps; - null !== hasContext; - - ) { + for (hasContext = newValue; null !== hasContext; ) { if (hasContext === workInProgress) { hasContext = null; break; } - getDerivedStateFromProps = hasContext.sibling; - if (null !== getDerivedStateFromProps) { - getDerivedStateFromProps.return = hasContext.return; - hasContext = getDerivedStateFromProps; + newValue = hasContext.sibling; + if (null !== newValue) { + newValue.return = hasContext.return; + hasContext = newValue; break; } hasContext = hasContext.return; } - getDerivedStateFromProps = hasContext; + newValue = hasContext; } reconcileChildren( current, @@ -7472,7 +7474,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 262144; + workInProgress.flags = current.flags & 1835008; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -7736,7 +7738,7 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_940 = { + devToolsConfig$jscomp$inline_941 = { findFiberByHostInstance: getInstanceFromInstance, bundleType: 0, version: "17.0.3", @@ -7754,11 +7756,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1171 = { - bundleType: devToolsConfig$jscomp$inline_940.bundleType, - version: devToolsConfig$jscomp$inline_940.version, - rendererPackageName: devToolsConfig$jscomp$inline_940.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_940.rendererConfig, +var internals$jscomp$inline_1175 = { + bundleType: devToolsConfig$jscomp$inline_941.bundleType, + version: devToolsConfig$jscomp$inline_941.version, + rendererPackageName: devToolsConfig$jscomp$inline_941.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_941.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -7773,25 +7775,26 @@ var internals$jscomp$inline_1171 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_940.findFiberByHostInstance || + devToolsConfig$jscomp$inline_941.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, - getCurrentFiber: null + getCurrentFiber: null, + reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1172 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1176 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1172.isDisabled && - hook$jscomp$inline_1172.supportsFiber + !hook$jscomp$inline_1176.isDisabled && + hook$jscomp$inline_1176.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1172.inject( - internals$jscomp$inline_1171 + (rendererID = hook$jscomp$inline_1176.inject( + internals$jscomp$inline_1175 )), - (injectedHook = hook$jscomp$inline_1172); + (injectedHook = hook$jscomp$inline_1176); } catch (err) {} } exports.createPortal = function(children, containerTag) { diff --git a/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index 5bb2ff1d2b3b06..5cea7d0c632ca5 100644 --- a/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -63,7 +63,8 @@ function invokeGuardedCallbackAndCatchFirstError( hasRethrowError || ((hasRethrowError = !0), (rethrowError = error)); } } -var getFiberCurrentPropsFromNode = null, +var isArrayImpl = Array.isArray, + getFiberCurrentPropsFromNode = null, getInstanceFromNode = null, getNodeFromInstance = null; function executeDispatch(event, listener, inst) { @@ -75,7 +76,7 @@ function executeDispatch(event, listener, inst) { function executeDirectDispatch(event) { var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - if (Array.isArray(dispatchListener)) + if (isArrayImpl(dispatchListener)) throw Error("executeDirectDispatch(...): Invalid `event`."); event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) @@ -336,9 +337,9 @@ function accumulate(current, next) { ); return null == current ? next - : Array.isArray(current) + : isArrayImpl(current) ? current.concat(next) - : Array.isArray(next) + : isArrayImpl(next) ? [current].concat(next) : [current, next]; } @@ -348,12 +349,12 @@ function accumulateInto(current, next) { "accumulateInto(...): Accumulated items must not be null or undefined." ); if (null == current) return next; - if (Array.isArray(current)) { - if (Array.isArray(next)) return current.push.apply(current, next), current; + if (isArrayImpl(current)) { + if (isArrayImpl(next)) return current.push.apply(current, next), current; current.push(next); return current; } - return Array.isArray(next) ? [current].concat(next) : [current, next]; + return isArrayImpl(next) ? [current].concat(next) : [current, next]; } function forEachAccumulated(arr, cb, scope) { Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); @@ -579,7 +580,7 @@ var ResponderEventPlugin = { b: { JSCompiler_temp = shouldSetEventType._dispatchListeners; targetInst = shouldSetEventType._dispatchInstances; - if (Array.isArray(JSCompiler_temp)) + if (isArrayImpl(JSCompiler_temp)) for ( depthA = 0; depthA < JSCompiler_temp.length && @@ -930,7 +931,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_220 = { +var injectedNamesToPlugins$jscomp$inline_221 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -965,34 +966,34 @@ var injectedNamesToPlugins$jscomp$inline_220 = { } } }, - isOrderingDirty$jscomp$inline_221 = !1, - pluginName$jscomp$inline_222; -for (pluginName$jscomp$inline_222 in injectedNamesToPlugins$jscomp$inline_220) + isOrderingDirty$jscomp$inline_222 = !1, + pluginName$jscomp$inline_223; +for (pluginName$jscomp$inline_223 in injectedNamesToPlugins$jscomp$inline_221) if ( - injectedNamesToPlugins$jscomp$inline_220.hasOwnProperty( - pluginName$jscomp$inline_222 + injectedNamesToPlugins$jscomp$inline_221.hasOwnProperty( + pluginName$jscomp$inline_223 ) ) { - var pluginModule$jscomp$inline_223 = - injectedNamesToPlugins$jscomp$inline_220[pluginName$jscomp$inline_222]; + var pluginModule$jscomp$inline_224 = + injectedNamesToPlugins$jscomp$inline_221[pluginName$jscomp$inline_223]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_222) || - namesToPlugins[pluginName$jscomp$inline_222] !== - pluginModule$jscomp$inline_223 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_223) || + namesToPlugins[pluginName$jscomp$inline_223] !== + pluginModule$jscomp$inline_224 ) { - if (namesToPlugins[pluginName$jscomp$inline_222]) + if (namesToPlugins[pluginName$jscomp$inline_223]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_222 + + pluginName$jscomp$inline_223 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_222 - ] = pluginModule$jscomp$inline_223; - isOrderingDirty$jscomp$inline_221 = !0; + pluginName$jscomp$inline_223 + ] = pluginModule$jscomp$inline_224; + isOrderingDirty$jscomp$inline_222 = !0; } } -isOrderingDirty$jscomp$inline_221 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_222 && recomputePluginOrdering(); function getInstanceFromInstance(instanceHandle) { return instanceHandle; } @@ -1007,7 +1008,8 @@ getNodeFromInstance = function(inst) { }; ResponderEventPlugin.injection.injectGlobalResponderHandler({ onChange: function(from, to, blockNativeResponder) { - (from || to).stateNode.canonical._internalInstanceHandle || + ((from = (from = from || to) && from.stateNode) && + from.canonical._internalInstanceHandle) || (null !== to ? ReactNativePrivateInterface.UIManager.setJSResponder( to.stateNode.canonical._nativeTag, @@ -1308,7 +1310,7 @@ function restoreDeletedValuesInNestedArray( node, validAttributes ) { - if (Array.isArray(node)) + if (isArrayImpl(node)) for (var i = node.length; i-- && 0 < removedKeyCount; ) restoreDeletedValuesInNestedArray( updatePayload, @@ -1354,9 +1356,9 @@ function diffNestedProperty( : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload; - if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) + if (!isArrayImpl(prevProp) && !isArrayImpl(nextProp)) return diffProperties(updatePayload, prevProp, nextProp, validAttributes); - if (Array.isArray(prevProp) && Array.isArray(nextProp)) { + if (isArrayImpl(prevProp) && isArrayImpl(nextProp)) { var minLength = prevProp.length < nextProp.length ? prevProp.length : nextProp.length, i; @@ -1381,7 +1383,7 @@ function diffNestedProperty( ); return updatePayload; } - return Array.isArray(prevProp) + return isArrayImpl(prevProp) ? diffProperties( updatePayload, ReactNativePrivateInterface.flattenStyle(prevProp), @@ -1397,7 +1399,7 @@ function diffNestedProperty( } function addNestedProperty(updatePayload, nextProp, validAttributes) { if (!nextProp) return updatePayload; - if (!Array.isArray(nextProp)) + if (!isArrayImpl(nextProp)) return diffProperties( updatePayload, emptyObject, @@ -1414,7 +1416,7 @@ function addNestedProperty(updatePayload, nextProp, validAttributes) { } function clearNestedProperty(updatePayload, prevProp, validAttributes) { if (!prevProp) return updatePayload; - if (!Array.isArray(prevProp)) + if (!isArrayImpl(prevProp)) return diffProperties( updatePayload, prevProp, @@ -1532,7 +1534,7 @@ function executeDispatchesAndReleaseTopLevel(e) { if (e) { var dispatchListeners = e._dispatchListeners, dispatchInstances = e._dispatchInstances; - if (Array.isArray(dispatchListeners)) + if (isArrayImpl(dispatchListeners)) for ( var i = 0; i < dispatchListeners.length && !e.isPropagationStopped(); @@ -1592,6 +1594,53 @@ function dispatchEvent(target, topLevelType, nativeEvent) { } }); } +var scheduleCallback = Scheduler.unstable_scheduleCallback, + cancelCallback = Scheduler.unstable_cancelCallback, + shouldYield = Scheduler.unstable_shouldYield, + requestPaint = Scheduler.unstable_requestPaint, + now = Scheduler.unstable_now, + ImmediatePriority = Scheduler.unstable_ImmediatePriority, + UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + NormalPriority = Scheduler.unstable_NormalPriority, + IdlePriority = Scheduler.unstable_IdlePriority; +if ( + null == tracing.__interactionsRef || + null == tracing.__interactionsRef.current +) + throw Error( + "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" + ); +var rendererID = null, + injectedHook = null, + isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; +function onCommitRoot(root, eventPriority) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (root.current.flags & 128); + switch (eventPriority) { + case 1: + var schedulerPriority = ImmediatePriority; + break; + case 4: + schedulerPriority = UserBlockingPriority; + break; + case 16: + schedulerPriority = NormalPriority; + break; + case 536870912: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) {} +} var nextTransitionLane = 64, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { @@ -1906,7 +1955,8 @@ function describeFunctionComponentFrame(fn, source) { ? describeComponentFrame(fn.displayName || fn.name || null, source, null) : ""; } -var valueStack = [], +var hasOwnProperty = Object.prototype.hasOwnProperty, + valueStack = [], index = -1; function createCursor(defaultValue) { return { current: defaultValue }; @@ -2002,53 +2052,6 @@ function invalidateContextProvider(workInProgress, type, didChange) { : pop(didPerformWorkStackCursor); push(didPerformWorkStackCursor, didChange); } -var scheduleCallback = Scheduler.unstable_scheduleCallback, - cancelCallback = Scheduler.unstable_cancelCallback, - shouldYield = Scheduler.unstable_shouldYield, - requestPaint = Scheduler.unstable_requestPaint, - now = Scheduler.unstable_now, - ImmediatePriority = Scheduler.unstable_ImmediatePriority, - UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, - NormalPriority = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority; -if ( - null == tracing.__interactionsRef || - null == tracing.__interactionsRef.current -) - throw Error( - "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" - ); -var rendererID = null, - injectedHook = null, - isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; -function onCommitRoot(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case 1: - var schedulerPriority = ImmediatePriority; - break; - case 4: - schedulerPriority = UserBlockingPriority; - break; - case 16: - schedulerPriority = NormalPriority; - break; - case 536870912: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) {} -} var syncQueue = null, isFlushingSyncQueue = !1; function flushSyncCallbackQueue() { @@ -2079,8 +2082,7 @@ var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } -var objectIs = "function" === typeof Object.is ? Object.is : is, - hasOwnProperty = Object.prototype.hasOwnProperty; +var objectIs = "function" === typeof Object.is ? Object.is : is; function shallowEqual(objA, objB) { if (objectIs(objA, objB)) return !0; if ( @@ -2573,7 +2575,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { ? previousContext : contextStackCursor.current), (instance.context = getMaskedContext(workInProgress, contextType))); - processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; contextType = ctor.getDerivedStateFromProps; "function" === typeof contextType && @@ -2595,7 +2596,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4); } -var isArray = Array.isArray; function coerceRef(returnFiber, current, element) { returnFiber = element.ref; if ( @@ -2648,15 +2648,14 @@ function coerceRef(returnFiber, current, element) { return returnFiber; } function throwOnInvalidObjectType(returnFiber, newChild) { - if ("textarea" !== returnFiber.type) - throw ((returnFiber = Object.prototype.toString.call(newChild)), - Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - )); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." + ); } function ChildReconciler(shouldTrackSideEffects) { function deleteChild(returnFiber, childToDelete) { @@ -2818,7 +2817,7 @@ function ChildReconciler(shouldTrackSideEffects) { newChild ); } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( (newChild = createFiberFromFragment( newChild, @@ -2850,7 +2849,7 @@ function ChildReconciler(shouldTrackSideEffects) { ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null; } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null); @@ -2889,7 +2888,7 @@ function ChildReconciler(shouldTrackSideEffects) { updatePortal(returnFiber, existingChildren, newChild, lanes) ); } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( (existingChildren = existingChildren.get(newIdx) || null), updateFragment(returnFiber, existingChildren, newChild, lanes, null) @@ -3072,20 +3071,19 @@ function ChildReconciler(shouldTrackSideEffects) { newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key; isUnkeyedTopLevelFragment && (newChild = newChild.props.children); - var isObject = "object" === typeof newChild && null !== newChild; - if (isObject) + if ("object" === typeof newChild && null !== newChild) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: a: { - isObject = newChild.key; + var key = newChild.key; for ( isUnkeyedTopLevelFragment = currentFirstChild; null !== isUnkeyedTopLevelFragment; ) { - if (isUnkeyedTopLevelFragment.key === isObject) { - isObject = newChild.type; - if (isObject === REACT_FRAGMENT_TYPE) { + if (isUnkeyedTopLevelFragment.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { if (7 === isUnkeyedTopLevelFragment.tag) { deleteRemainingChildren( returnFiber, @@ -3099,7 +3097,7 @@ function ChildReconciler(shouldTrackSideEffects) { returnFiber = currentFirstChild; break a; } - } else if (isUnkeyedTopLevelFragment.elementType === isObject) { + } else if (isUnkeyedTopLevelFragment.elementType === key) { deleteRemainingChildren( returnFiber, isUnkeyedTopLevelFragment.sibling @@ -3191,6 +3189,22 @@ function ChildReconciler(shouldTrackSideEffects) { } return placeSingleChild(returnFiber); } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } if ("string" === typeof newChild || "number" === typeof newChild) return ( (newChild = "" + newChild), @@ -3209,21 +3223,6 @@ function ChildReconciler(shouldTrackSideEffects) { (returnFiber = currentFirstChild)), placeSingleChild(returnFiber) ); - if (isArray(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - isObject && throwOnInvalidObjectType(returnFiber, newChild); if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment) switch (returnFiber.tag) { case 1: @@ -3688,7 +3687,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { hook.memoizedState = pushEffect(1 | hookFlags, create, destroy, deps); } function mountEffect(create, deps) { - return mountEffectImpl(263168, 4, create, deps); + return mountEffectImpl(1049600, 4, create, deps); } function updateEffect(create, deps) { return updateEffectImpl(1024, 4, create, deps); @@ -4712,7 +4711,7 @@ function updateSuspenseFallbackChildren( (primaryChildren.treeBaseDuration = current.treeBaseDuration)), (workInProgress.deletions = null)) : ((primaryChildren = createWorkInProgress(current, primaryChildProps)), - (primaryChildren.subtreeFlags = current.subtreeFlags & 262144)); + (primaryChildren.subtreeFlags = current.subtreeFlags & 1835008)); null !== currentFallbackChildFragment ? (fallbackChildren = createWorkInProgress( currentFallbackChildFragment, @@ -5073,14 +5072,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$63 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$63 = lastTailNode), + for (var lastTailNode$65 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$65 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$63 + null === lastTailNode$65 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$63.sibling = null); + : (lastTailNode$65.sibling = null); } } function bubbleProperties(completedWork) { @@ -5092,53 +5091,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$65 = completedWork.selfBaseDuration, - child$66 = completedWork.child; - null !== child$66; + var treeBaseDuration$67 = completedWork.selfBaseDuration, + child$68 = completedWork.child; + null !== child$68; ) - (newChildLanes |= child$66.lanes | child$66.childLanes), - (subtreeFlags |= child$66.subtreeFlags & 262144), - (subtreeFlags |= child$66.flags & 262144), - (treeBaseDuration$65 += child$66.treeBaseDuration), - (child$66 = child$66.sibling); - completedWork.treeBaseDuration = treeBaseDuration$65; + (newChildLanes |= child$68.lanes | child$68.childLanes), + (subtreeFlags |= child$68.subtreeFlags & 1835008), + (subtreeFlags |= child$68.flags & 1835008), + (treeBaseDuration$67 += child$68.treeBaseDuration), + (child$68 = child$68.sibling); + completedWork.treeBaseDuration = treeBaseDuration$67; } else for ( - treeBaseDuration$65 = completedWork.child; - null !== treeBaseDuration$65; + treeBaseDuration$67 = completedWork.child; + null !== treeBaseDuration$67; ) (newChildLanes |= - treeBaseDuration$65.lanes | treeBaseDuration$65.childLanes), - (subtreeFlags |= treeBaseDuration$65.subtreeFlags & 262144), - (subtreeFlags |= treeBaseDuration$65.flags & 262144), - (treeBaseDuration$65.return = completedWork), - (treeBaseDuration$65 = treeBaseDuration$65.sibling); + treeBaseDuration$67.lanes | treeBaseDuration$67.childLanes), + (subtreeFlags |= treeBaseDuration$67.subtreeFlags & 1835008), + (subtreeFlags |= treeBaseDuration$67.flags & 1835008), + (treeBaseDuration$67.return = completedWork), + (treeBaseDuration$67 = treeBaseDuration$67.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$65 = completedWork.actualDuration; - child$66 = completedWork.selfBaseDuration; + treeBaseDuration$67 = completedWork.actualDuration; + child$68 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$65 += child.actualDuration), - (child$66 += child.treeBaseDuration), + (treeBaseDuration$67 += child.actualDuration), + (child$68 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$65; - completedWork.treeBaseDuration = child$66; + completedWork.actualDuration = treeBaseDuration$67; + completedWork.treeBaseDuration = child$68; } else for ( - treeBaseDuration$65 = completedWork.child; - null !== treeBaseDuration$65; + treeBaseDuration$67 = completedWork.child; + null !== treeBaseDuration$67; ) (newChildLanes |= - treeBaseDuration$65.lanes | treeBaseDuration$65.childLanes), - (subtreeFlags |= treeBaseDuration$65.subtreeFlags), - (subtreeFlags |= treeBaseDuration$65.flags), - (treeBaseDuration$65.return = completedWork), - (treeBaseDuration$65 = treeBaseDuration$65.sibling); + treeBaseDuration$67.lanes | treeBaseDuration$67.childLanes), + (subtreeFlags |= treeBaseDuration$67.subtreeFlags), + (subtreeFlags |= treeBaseDuration$67.flags), + (treeBaseDuration$67.return = completedWork), + (treeBaseDuration$67 = treeBaseDuration$67.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -5345,7 +5344,7 @@ function completeWork(current, workInProgress, renderLanes) { for (newProps = workInProgress.child; null !== newProps; ) (renderLanes = newProps), (updatePayload = current), - (renderLanes.flags &= 262146), + (renderLanes.flags &= 1835010), (type = renderLanes.alternate), null === type ? ((renderLanes.childLanes = 0), @@ -5729,8 +5728,8 @@ function commitHookEffectListMount(tag, finishedWork) { var effect = (finishedWork = finishedWork.next); do { if ((effect.tag & tag) === tag) { - var create$84 = effect.create; - effect.destroy = create$84(); + var create$86 = effect.create; + effect.destroy = create$86(); } effect = effect.next; } while (effect !== finishedWork); @@ -5986,8 +5985,8 @@ function commitLayoutEffects(finishedWork, root) { commitUpdateQueue(fiber$jscomp$0, updateQueue, instance); break; case 3: - var updateQueue$85 = fiber$jscomp$0.updateQueue; - if (null !== updateQueue$85) { + var updateQueue$87 = fiber$jscomp$0.updateQueue; + if (null !== updateQueue$87) { finishedRoot = null; if (null !== fiber$jscomp$0.child) switch (fiber$jscomp$0.child.tag) { @@ -6000,7 +5999,7 @@ function commitLayoutEffects(finishedWork, root) { } commitUpdateQueue( fiber$jscomp$0, - updateQueue$85, + updateQueue$87, finishedRoot ); } @@ -6014,7 +6013,7 @@ function commitLayoutEffects(finishedWork, root) { break; case 12: var onRender = fiber$jscomp$0.memoizedProps.onRender, - commitTime$88 = commitTime; + commitTime$90 = commitTime; current = null === current ? "mount" : "update"; "function" === typeof onRender && onRender( @@ -6023,7 +6022,7 @@ function commitLayoutEffects(finishedWork, root) { fiber$jscomp$0.actualDuration, fiber$jscomp$0.treeBaseDuration, fiber$jscomp$0.actualStartTime, - commitTime$88, + commitTime$90, finishedRoot.memoizedInteractions ); break; @@ -6082,6 +6081,7 @@ function commitLayoutEffects(finishedWork, root) { var ceil = Math.ceil, ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, executionContext = 0, workInProgressRoot = null, workInProgress = null, @@ -6542,15 +6542,15 @@ function handleError(root$jscomp$0, thrownValue) { } var hasInvisibleParentBoundary = 0 !== (suspenseStackCursor.current & 1), - workInProgress$79 = returnFiber; + workInProgress$81 = returnFiber; do { var JSCompiler_temp; - if ((JSCompiler_temp = 13 === workInProgress$79.tag)) { - var nextState = workInProgress$79.memoizedState; + if ((JSCompiler_temp = 13 === workInProgress$81.tag)) { + var nextState = workInProgress$81.memoizedState; if (null !== nextState) JSCompiler_temp = null !== nextState.dehydrated ? !0 : !1; else { - var props = workInProgress$79.memoizedProps; + var props = workInProgress$81.memoizedProps; JSCompiler_temp = void 0 === props.fallback ? !1 @@ -6562,17 +6562,17 @@ function handleError(root$jscomp$0, thrownValue) { } } if (JSCompiler_temp) { - var wakeables = workInProgress$79.updateQueue; + var wakeables = workInProgress$81.updateQueue; if (null === wakeables) { var updateQueue = new Set(); updateQueue.add(wakeable); - workInProgress$79.updateQueue = updateQueue; + workInProgress$81.updateQueue = updateQueue; } else wakeables.add(wakeable); if ( - 0 === (workInProgress$79.mode & 1) && - workInProgress$79 !== returnFiber + 0 === (workInProgress$81.mode & 1) && + workInProgress$81 !== returnFiber ) { - workInProgress$79.flags |= 128; + workInProgress$81.flags |= 128; sourceFiber.flags |= 32768; sourceFiber.flags &= -10053; if (1 === sourceFiber.tag) @@ -6605,12 +6605,12 @@ function handleError(root$jscomp$0, thrownValue) { ); wakeable.then(ping, ping); } - workInProgress$79.flags |= 16384; - workInProgress$79.lanes = thrownValue; + workInProgress$81.flags |= 16384; + workInProgress$81.lanes = thrownValue; break a; } - workInProgress$79 = workInProgress$79.return; - } while (null !== workInProgress$79); + workInProgress$81 = workInProgress$81.return; + } while (null !== workInProgress$81); value = Error( (getComponentNameFromFiber(sourceFiber) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." @@ -6619,47 +6619,47 @@ function handleError(root$jscomp$0, thrownValue) { 5 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); value = createCapturedValue(value, sourceFiber); - workInProgress$79 = returnFiber; + workInProgress$81 = returnFiber; do { - switch (workInProgress$79.tag) { + switch (workInProgress$81.tag) { case 3: root = value; - workInProgress$79.flags |= 16384; + workInProgress$81.flags |= 16384; thrownValue &= -thrownValue; - workInProgress$79.lanes |= thrownValue; - var update$80 = createRootErrorUpdate( - workInProgress$79, + workInProgress$81.lanes |= thrownValue; + var update$82 = createRootErrorUpdate( + workInProgress$81, root, thrownValue ); - enqueueCapturedUpdate(workInProgress$79, update$80); + enqueueCapturedUpdate(workInProgress$81, update$82); break a; case 1: root = value; - var ctor = workInProgress$79.type, - instance = workInProgress$79.stateNode; + var ctor = workInProgress$81.type, + instance = workInProgress$81.stateNode; if ( - 0 === (workInProgress$79.flags & 128) && + 0 === (workInProgress$81.flags & 128) && ("function" === typeof ctor.getDerivedStateFromError || (null !== instance && "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) ) { - workInProgress$79.flags |= 16384; + workInProgress$81.flags |= 16384; thrownValue &= -thrownValue; - workInProgress$79.lanes |= thrownValue; - var update$83 = createClassErrorUpdate( - workInProgress$79, + workInProgress$81.lanes |= thrownValue; + var update$85 = createClassErrorUpdate( + workInProgress$81, root, thrownValue ); - enqueueCapturedUpdate(workInProgress$79, update$83); + enqueueCapturedUpdate(workInProgress$81, update$85); break a; } } - workInProgress$79 = workInProgress$79.return; - } while (null !== workInProgress$79); + workInProgress$81 = workInProgress$81.return; + } while (null !== workInProgress$81); } completeUnitOfWork(erroredWork); } catch (yetAnotherThrownValue) { @@ -6778,12 +6778,15 @@ function completeUnitOfWork(unitOfWork) { 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } function commitRoot(root) { - var previousUpdateLanePriority = currentUpdatePriority; + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig$2.transition; try { - (currentUpdatePriority = 1), + (ReactCurrentBatchConfig$2.transition = 0), + (currentUpdatePriority = 1), commitRootImpl(root, previousUpdateLanePriority); } finally { - currentUpdatePriority = previousUpdateLanePriority; + (ReactCurrentBatchConfig$2.transition = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); } return null; } @@ -6818,7 +6821,9 @@ function commitRootImpl(root, renderPriorityLevel) { })); remainingLanes = 0 !== (finishedWork.flags & 8054); if (0 !== (finishedWork.subtreeFlags & 8054) || remainingLanes) { - remainingLanes = currentUpdatePriority; + remainingLanes = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = 0; + var previousPriority = currentUpdatePriority; currentUpdatePriority = 1; var prevExecutionContext = executionContext; executionContext |= 16; @@ -6832,27 +6837,31 @@ function commitRootImpl(root, renderPriorityLevel) { requestPaint(); tracing.__interactionsRef.current = prevInteractions; executionContext = prevExecutionContext; - currentUpdatePriority = remainingLanes; + currentUpdatePriority = previousPriority; + ReactCurrentBatchConfig$2.transition = remainingLanes; } else (root.current = finishedWork), (commitTime = now$1()); - if ((prevExecutionContext = rootDoesHavePassiveEffects)) + if ((previousPriority = rootDoesHavePassiveEffects)) (rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes); remainingLanes = root.pendingLanes; if (0 !== remainingLanes) { - if (null !== spawnedWorkDuringRender) { - prevInteractions = spawnedWorkDuringRender; - spawnedWorkDuringRender = null; - for (var i = 0; i < prevInteractions.length; i++) + if (null !== spawnedWorkDuringRender) + for ( + prevExecutionContext = spawnedWorkDuringRender, + spawnedWorkDuringRender = null, + prevInteractions = 0; + prevInteractions < prevExecutionContext.length; + prevInteractions++ + ) scheduleInteractions( root, - prevInteractions[i], + prevExecutionContext[prevInteractions], root.memoizedInteractions ); - } schedulePendingInteractions(root, remainingLanes); } else legacyErrorBoundariesThatAlreadyFailed = null; - prevExecutionContext || finishPendingInteractions(root, lanes); + previousPriority || finishPendingInteractions(root, lanes); 0 !== (remainingLanes & 1) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -6866,19 +6875,24 @@ function commitRootImpl(root, renderPriorityLevel) { (firstUncaughtError = null), root); if (0 !== (executionContext & 4)) return null; + 0 !== (pendingPassiveEffectsLanes & 1) && + 0 !== root.tag && + flushPassiveEffects(); flushSyncCallbackQueue(); return null; } function flushPassiveEffects() { - if (0 !== pendingPassiveEffectsLanes) { - var b = lanesToEventPriority(pendingPassiveEffectsLanes), + if (null !== rootWithPendingPassiveEffects) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$2.transition, previousPriority = currentUpdatePriority; try { - currentUpdatePriority = 16 < b ? 16 : b; + ReactCurrentBatchConfig$2.transition = 0; + currentUpdatePriority = 16 > renderPriority ? 16 : renderPriority; if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1; else { - b = rootWithPendingPassiveEffects; + renderPriority = rootWithPendingPassiveEffects; var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; @@ -6886,8 +6900,8 @@ function flushPassiveEffects() { throw Error("Cannot flush passive effects while already rendering."); var prevExecutionContext = executionContext; executionContext |= 16; - var prevInteractions = pushInteractions(b); - for (nextEffect = b.current; null !== nextEffect; ) { + var prevInteractions = pushInteractions(renderPriority); + for (nextEffect = renderPriority.current; null !== nextEffect; ) { var fiber = nextEffect, child = fiber.child; if (0 !== (nextEffect.flags & 16)) { @@ -6962,7 +6976,7 @@ function flushPassiveEffects() { nextEffect = fiber.return; } } - var finishedWork = b.current; + var finishedWork = renderPriority.current; for (nextEffect = finishedWork; null !== nextEffect; ) { child = nextEffect; var firstChild = child.child; @@ -6996,14 +7010,22 @@ function flushPassiveEffects() { } } tracing.__interactionsRef.current = prevInteractions; - finishPendingInteractions(b, lanes); + finishPendingInteractions(renderPriority, lanes); executionContext = prevExecutionContext; flushSyncCallbackQueue(); + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} JSCompiler_inline_result = !0; } return JSCompiler_inline_result; } finally { - currentUpdatePriority = previousPriority; + (currentUpdatePriority = previousPriority), + (ReactCurrentBatchConfig$2.transition = prevTransition); } } return !1; @@ -7230,14 +7252,6 @@ beginWork$1 = function(current, workInProgress, renderLanes) { ? nextValue.state : null; initializeUpdateQueue(workInProgress); - var getDerivedStateFromProps = updateLanes.getDerivedStateFromProps; - "function" === typeof getDerivedStateFromProps && - applyDerivedStateFromProps( - workInProgress, - updateLanes, - getDerivedStateFromProps, - current - ); nextValue.updater = classComponentUpdater; workInProgress.stateNode = nextValue; nextValue._reactInternals = workInProgress; @@ -7453,11 +7467,11 @@ beginWork$1 = function(current, workInProgress, renderLanes) { updateLanes = workInProgress.type._context; nextValue = workInProgress.pendingProps; hasContext = workInProgress.memoizedProps; - getDerivedStateFromProps = nextValue.value; + var newValue = nextValue.value; push(valueCursor, updateLanes._currentValue2); - updateLanes._currentValue2 = getDerivedStateFromProps; + updateLanes._currentValue2 = newValue; if (null !== hasContext) - if (objectIs(hasContext.value, getDerivedStateFromProps)) { + if (objectIs(hasContext.value, newValue)) { if ( hasContext.children === nextValue.children && !didPerformWorkStackCursor.current @@ -7471,25 +7485,24 @@ beginWork$1 = function(current, workInProgress, renderLanes) { } } else for ( - getDerivedStateFromProps = workInProgress.child, - null !== getDerivedStateFromProps && - (getDerivedStateFromProps.return = workInProgress); - null !== getDerivedStateFromProps; + newValue = workInProgress.child, + null !== newValue && (newValue.return = workInProgress); + null !== newValue; ) { - var list = getDerivedStateFromProps.dependencies; + var list = newValue.dependencies; if (null !== list) { - hasContext = getDerivedStateFromProps.child; + hasContext = newValue.child; for ( var dependency = list.firstContext; null !== dependency; ) { if (dependency.context === updateLanes) { - if (1 === getDerivedStateFromProps.tag) { + if (1 === newValue.tag) { dependency = createUpdate(-1, renderLanes & -renderLanes); dependency.tag = 2; - var updateQueue = getDerivedStateFromProps.updateQueue; + var updateQueue = newValue.updateQueue; if (null !== updateQueue) { updateQueue = updateQueue.shared; var pending = updateQueue.pending; @@ -7500,13 +7513,10 @@ beginWork$1 = function(current, workInProgress, renderLanes) { updateQueue.pending = dependency; } } - getDerivedStateFromProps.lanes |= renderLanes; - dependency = getDerivedStateFromProps.alternate; + newValue.lanes |= renderLanes; + dependency = newValue.alternate; null !== dependency && (dependency.lanes |= renderLanes); - scheduleWorkOnParentPath( - getDerivedStateFromProps.return, - renderLanes - ); + scheduleWorkOnParentPath(newValue.return, renderLanes); list.lanes |= renderLanes; break; } @@ -7514,32 +7524,27 @@ beginWork$1 = function(current, workInProgress, renderLanes) { } } else hasContext = - 10 === getDerivedStateFromProps.tag - ? getDerivedStateFromProps.type === workInProgress.type + 10 === newValue.tag + ? newValue.type === workInProgress.type ? null - : getDerivedStateFromProps.child - : getDerivedStateFromProps.child; - if (null !== hasContext) - hasContext.return = getDerivedStateFromProps; + : newValue.child + : newValue.child; + if (null !== hasContext) hasContext.return = newValue; else - for ( - hasContext = getDerivedStateFromProps; - null !== hasContext; - - ) { + for (hasContext = newValue; null !== hasContext; ) { if (hasContext === workInProgress) { hasContext = null; break; } - getDerivedStateFromProps = hasContext.sibling; - if (null !== getDerivedStateFromProps) { - getDerivedStateFromProps.return = hasContext.return; - hasContext = getDerivedStateFromProps; + newValue = hasContext.sibling; + if (null !== newValue) { + newValue.return = hasContext.return; + hasContext = newValue; break; } hasContext = hasContext.return; } - getDerivedStateFromProps = hasContext; + newValue = hasContext; } reconcileChildren( current, @@ -7706,9 +7711,9 @@ function finishPendingInteractions(root, committedLanes) { if (null !== subscriber && 0 === interaction.__count) try { subscriber.onInteractionScheduledWorkCompleted(interaction); - } catch (error$95) { + } catch (error$97) { scheduleCallback(ImmediatePriority, function() { - throw error$95; + throw error$97; }); } })); @@ -7770,7 +7775,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.deletions = null), (workInProgress.actualDuration = 0), (workInProgress.actualStartTime = -1)); - workInProgress.flags = current.flags & 262144; + workInProgress.flags = current.flags & 1835008; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -8040,7 +8045,7 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_968 = { + devToolsConfig$jscomp$inline_969 = { findFiberByHostInstance: getInstanceFromInstance, bundleType: 0, version: "17.0.3", @@ -8058,11 +8063,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1212 = { - bundleType: devToolsConfig$jscomp$inline_968.bundleType, - version: devToolsConfig$jscomp$inline_968.version, - rendererPackageName: devToolsConfig$jscomp$inline_968.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_968.rendererConfig, +var internals$jscomp$inline_1216 = { + bundleType: devToolsConfig$jscomp$inline_969.bundleType, + version: devToolsConfig$jscomp$inline_969.version, + rendererPackageName: devToolsConfig$jscomp$inline_969.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_969.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8077,25 +8082,26 @@ var internals$jscomp$inline_1212 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_968.findFiberByHostInstance || + devToolsConfig$jscomp$inline_969.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, - getCurrentFiber: null + getCurrentFiber: null, + reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1213 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1217 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1213.isDisabled && - hook$jscomp$inline_1213.supportsFiber + !hook$jscomp$inline_1217.isDisabled && + hook$jscomp$inline_1217.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1213.inject( - internals$jscomp$inline_1212 + (rendererID = hook$jscomp$inline_1217.inject( + internals$jscomp$inline_1216 )), - (injectedHook = hook$jscomp$inline_1213); + (injectedHook = hook$jscomp$inline_1217); } catch (err) {} } exports.createPortal = function(children, containerTag) { diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index c9d6478d841574..0b7623b228ca6e 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<31b307087773581fd58a1b6ae0a24ae9>> + * @generated SignedSource<> */ 'use strict'; @@ -380,6 +380,12 @@ function clearCaughtError() { } } +var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + +function isArray(a) { + return isArrayImpl(a); +} + var getFiberCurrentPropsFromNode = null; var getInstanceFromNode = null; var getNodeFromInstance = null; @@ -407,13 +413,13 @@ var validateEventDispatches; validateEventDispatches = function(event) { var dispatchListeners = event._dispatchListeners; var dispatchInstances = event._dispatchInstances; - var listenersIsArr = Array.isArray(dispatchListeners); + var listenersIsArr = isArray(dispatchListeners); var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; - var instancesIsArr = Array.isArray(dispatchInstances); + var instancesIsArr = isArray(dispatchInstances); var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances @@ -450,7 +456,7 @@ function executeDispatchesInOrder(event) { validateEventDispatches(event); } - if (Array.isArray(dispatchListeners)) { + if (isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; @@ -481,7 +487,7 @@ function executeDispatchesInOrderStopAtTrueImpl(event) { validateEventDispatches(event); } - if (Array.isArray(dispatchListeners)) { + if (isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; @@ -527,7 +533,7 @@ function executeDirectDispatch(event) { var dispatchListener = event._dispatchListeners; var dispatchInstance = event._dispatchInstances; - if (!!Array.isArray(dispatchListener)) { + if (!!isArray(dispatchListener)) { throw Error("executeDirectDispatch(...): Invalid `event`."); } @@ -1154,11 +1160,11 @@ function accumulate(current, next) { } // Both are not empty. Warning: Never call x.concat(y) when you are not // certain that x is an Array (x could be a string with concat method). - if (Array.isArray(current)) { + if (isArray(current)) { return current.concat(next); } - if (Array.isArray(next)) { + if (isArray(next)) { return [current].concat(next); } @@ -1190,8 +1196,8 @@ function accumulateInto(current, next) { } // Both are not empty. Warning: Never call x.concat(y) when you are not // certain that x is an Array (x could be a string with concat method). - if (Array.isArray(current)) { - if (Array.isArray(next)) { + if (isArray(current)) { + if (isArray(next)) { current.push.apply(current, next); return current; } @@ -1200,7 +1206,7 @@ function accumulateInto(current, next) { return current; } - if (Array.isArray(next)) { + if (isArray(next)) { // A bit too dangerous to mutate `next`. return [current].concat(next); } @@ -3120,7 +3126,7 @@ var enableLazyElements = false; var warnAboutStringRefs = false; var enableNewReconciler = false; var deferRenderPhaseUpdateToNextBatch = true; -var enableLazyContextPropagation = false; // Flow magic to verify the exports of this file match the original version. +var enableLazyContextPropagation = false; // Don't change these two values. They're used by React Dev Tools. var NoFlags = @@ -3189,9 +3195,15 @@ var ForceUpdateForLegacySuspense = // since we can defer traversing the tree during layout to look for Passive effects, // and instead rely on the static flag as a signal that there may be cleanup work. +var RefStatic = + /* */ + 262144; +var LayoutStatic = + /* */ + 524288; var PassiveStatic = /* */ - 262144; // These flags allow us to traverse to fibers that have effects on mount + 1048576; // These flags allow us to traverse to fibers that have effects on mount // don't contain effects, by checking subtreeFlags. var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visiblity @@ -3211,7 +3223,7 @@ var PassiveMask = Passive | ChildDeletion; // Union of tags that don't get reset // This allows certain concepts to persist without recalculting them, // e.g. whether a subtree contains passive effects or portals. -var StaticMask = PassiveStatic; +var StaticMask = LayoutStatic | PassiveStatic | RefStatic; var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function getNearestMountedFiber(fiber) { @@ -3528,7 +3540,7 @@ function restoreDeletedValuesInNestedArray( node, validAttributes ) { - if (Array.isArray(node)) { + if (isArray(node)) { var i = node.length; while (i-- && removedKeyCount > 0) { @@ -3653,12 +3665,12 @@ function diffNestedProperty( return updatePayload; } - if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) { + if (!isArray(prevProp) && !isArray(nextProp)) { // Both are leaves, we can diff the leaves. return diffProperties(updatePayload, prevProp, nextProp, validAttributes); } - if (Array.isArray(prevProp) && Array.isArray(nextProp)) { + if (isArray(prevProp) && isArray(nextProp)) { // Both are arrays, we can diff the arrays. return diffNestedArrayProperty( updatePayload, @@ -3668,7 +3680,7 @@ function diffNestedProperty( ); } - if (Array.isArray(prevProp)) { + if (isArray(prevProp)) { return diffProperties( updatePayload, // $FlowFixMe - We know that this is always an object when the input is. ReactNativePrivateInterface.flattenStyle(prevProp), // $FlowFixMe - We know that this isn't an array because of above flow. @@ -3695,7 +3707,7 @@ function addNestedProperty(updatePayload, nextProp, validAttributes) { return updatePayload; } - if (!Array.isArray(nextProp)) { + if (!isArray(nextProp)) { // Add each property of the leaf. return addProperties(updatePayload, nextProp, validAttributes); } @@ -3721,7 +3733,7 @@ function clearNestedProperty(updatePayload, prevProp, validAttributes) { return updatePayload; } - if (!Array.isArray(prevProp)) { + if (!isArray(prevProp)) { // Add each property of the leaf. return clearProperties(updatePayload, prevProp, validAttributes); } @@ -4093,6 +4105,179 @@ var ReactNativeFiberHostComponent = /*#__PURE__*/ (function() { return ReactNativeFiberHostComponent; })(); // eslint-disable-next-line no-unused-expressions +// This module only exists as an ESM wrapper around the external CommonJS +var scheduleCallback = Scheduler.unstable_scheduleCallback; +var cancelCallback = Scheduler.unstable_cancelCallback; +var shouldYield = Scheduler.unstable_shouldYield; +var requestPaint = Scheduler.unstable_requestPaint; +var now = Scheduler.unstable_now; +var ImmediatePriority = Scheduler.unstable_ImmediatePriority; +var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; +var NormalPriority = Scheduler.unstable_NormalPriority; +var IdlePriority = Scheduler.unstable_IdlePriority; + +{ + // Provide explicit error message when production+profiling bundle of e.g. + // react-dom is used with production (non-profiling) bundle of + // scheduler/tracing + if ( + !( + tracing.__interactionsRef != null && + tracing.__interactionsRef.current != null + ) + ) { + throw Error( + "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" + ); + } +} + +var rendererID = null; +var injectedHook = null; +var hasLoggedError = false; +var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined"; +function injectInternals(internals) { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") { + // No DevTools + return false; + } + + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + + if (hook.isDisabled) { + // This isn't a real property on the hook, but it can be set to opt out + // of DevTools integration and associated warnings and logs. + // https://github.com/facebook/react/issues/3877 + return true; + } + + if (!hook.supportsFiber) { + { + error( + "The installed version of React DevTools is too old and will not work " + + "with the current version of React. Please update React DevTools. " + + "https://reactjs.org/link/react-devtools" + ); + } // DevTools exists, even though it doesn't support Fiber. + + return true; + } + + try { + rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. + + injectedHook = hook; + } catch (err) { + // Catch all errors because it is unsafe to throw during initialization. + { + error("React instrumentation encountered an error: %s.", err); + } + } // DevTools exists + + return true; +} +function onScheduleRoot(root, children) { + { + if ( + injectedHook && + typeof injectedHook.onScheduleFiberRoot === "function" + ) { + try { + injectedHook.onScheduleFiberRoot(rendererID, root, children); + } catch (err) { + if (!hasLoggedError) { + hasLoggedError = true; + + error("React instrumentation encountered an error: %s", err); + } + } + } + } +} +function onCommitRoot(root, eventPriority) { + if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") { + try { + var didError = (root.current.flags & DidCapture) === DidCapture; + + if (enableProfilerTimer) { + var schedulerPriority; + + switch (eventPriority) { + case DiscreteEventPriority: + schedulerPriority = ImmediatePriority; + break; + + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + + case DefaultEventPriority: + schedulerPriority = NormalPriority; + break; + + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + + default: + schedulerPriority = NormalPriority; + break; + } + + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } else { + injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError); + } + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + + error("React instrumentation encountered an error: %s", err); + } + } + } + } +} +function onPostCommitRoot(root) { + if ( + injectedHook && + typeof injectedHook.onPostCommitFiberRoot === "function" + ) { + try { + injectedHook.onPostCommitFiberRoot(rendererID, root); + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + + error("React instrumentation encountered an error: %s", err); + } + } + } + } +} +function onCommitUnmount(fiber) { + if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") { + try { + injectedHook.onCommitFiberUnmount(rendererID, fiber); + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + + error("React instrumentation encountered an error: %s", err); + } + } + } + } +} + // If those values are changed that package should be rebuilt and redeployed. var TotalLanes = 31; @@ -4106,7 +4291,7 @@ var SyncLane = /* */ 1; var InputContinuousHydrationLane = - /* */ + /* */ 2; var InputContinuousLane = /* */ @@ -4740,6 +4925,9 @@ function setCurrentUpdatePriority(newPriority) { function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } +function lowerEventPriority(a, b) { + return a === 0 || a > b ? a : b; +} function isHigherEventPriority(a, b) { return a !== 0 && a < b; } @@ -5360,6 +5548,8 @@ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { return ""; } +var hasOwnProperty = Object.prototype.hasOwnProperty; + var loggedTypeFailures = {}; var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; @@ -5382,7 +5572,7 @@ function setCurrentlyValidatingElement(element) { function checkPropTypes(typeSpecs, values, location, componentName, element) { { // $FlowFixMe This is okay but Flow doesn't know it. - var has = Function.call.bind(Object.prototype.hasOwnProperty); + var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { @@ -5782,161 +5972,6 @@ function findCurrentUnmaskedContext(fiber) { var LegacyRoot = 0; var ConcurrentRoot = 1; -// This module only exists as an ESM wrapper around the external CommonJS -var scheduleCallback = Scheduler.unstable_scheduleCallback; -var cancelCallback = Scheduler.unstable_cancelCallback; -var shouldYield = Scheduler.unstable_shouldYield; -var requestPaint = Scheduler.unstable_requestPaint; -var now = Scheduler.unstable_now; -var ImmediatePriority = Scheduler.unstable_ImmediatePriority; -var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; -var NormalPriority = Scheduler.unstable_NormalPriority; -var IdlePriority = Scheduler.unstable_IdlePriority; - -{ - // Provide explicit error message when production+profiling bundle of e.g. - // react-dom is used with production (non-profiling) bundle of - // scheduler/tracing - if ( - !( - tracing.__interactionsRef != null && - tracing.__interactionsRef.current != null - ) - ) { - throw Error( - "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" - ); - } -} - -var rendererID = null; -var injectedHook = null; -var hasLoggedError = false; -var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined"; -function injectInternals(internals) { - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") { - // No DevTools - return false; - } - - var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; - - if (hook.isDisabled) { - // This isn't a real property on the hook, but it can be set to opt out - // of DevTools integration and associated warnings and logs. - // https://github.com/facebook/react/issues/3877 - return true; - } - - if (!hook.supportsFiber) { - { - error( - "The installed version of React DevTools is too old and will not work " + - "with the current version of React. Please update React DevTools. " + - "https://reactjs.org/link/react-devtools" - ); - } // DevTools exists, even though it doesn't support Fiber. - - return true; - } - - try { - rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. - - injectedHook = hook; - } catch (err) { - // Catch all errors because it is unsafe to throw during initialization. - { - error("React instrumentation encountered an error: %s.", err); - } - } // DevTools exists - - return true; -} -function onScheduleRoot(root, children) { - { - if ( - injectedHook && - typeof injectedHook.onScheduleFiberRoot === "function" - ) { - try { - injectedHook.onScheduleFiberRoot(rendererID, root, children); - } catch (err) { - if (!hasLoggedError) { - hasLoggedError = true; - - error("React instrumentation encountered an error: %s", err); - } - } - } - } -} -function onCommitRoot(root, eventPriority) { - if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") { - try { - var didError = (root.current.flags & DidCapture) === DidCapture; - - if (enableProfilerTimer) { - var schedulerPriority; - - switch (eventPriority) { - case DiscreteEventPriority: - schedulerPriority = ImmediatePriority; - break; - - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - - case DefaultEventPriority: - schedulerPriority = NormalPriority; - break; - - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - - default: - schedulerPriority = NormalPriority; - break; - } - - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } else { - injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError); - } - } catch (err) { - { - if (!hasLoggedError) { - hasLoggedError = true; - - error("React instrumentation encountered an error: %s", err); - } - } - } - } -} -function onCommitUnmount(fiber) { - if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") { - try { - injectedHook.onCommitFiberUnmount(rendererID, fiber); - } catch (err) { - { - if (!hasLoggedError) { - hasLoggedError = true; - - error("React instrumentation encountered an error: %s", err); - } - } - } - } -} - var syncQueue = null; var isFlushingSyncQueue = false; function scheduleSyncCallback(callback) { @@ -6047,7 +6082,6 @@ function is(x, y) { var objectIs = typeof Object.is === "function" ? Object.is : is; -var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. @@ -7405,8 +7439,7 @@ function commitUpdateQueue(finishedWork, finishedQueue, instance) { } } -var fakeInternalInstance = {}; -var isArray = Array.isArray; // React.Component uses a shared frozen object by default. +var fakeInternalInstance = {}; // React.Component uses a shared frozen object by default. // We'll use it to determine whether we need to initialize legacy refs. var emptyRefsObject = new React.Component().refs; @@ -7524,6 +7557,7 @@ function applyDerivedStateFromProps( updateQueue.baseState = memoizedState; } } + var classComponentUpdater = { isMounted: isMounted, enqueueSetState: function(inst, payload, callback) { @@ -8173,7 +8207,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { } } - processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; var getDerivedStateFromProps = ctor.getDerivedStateFromProps; @@ -8202,9 +8235,9 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { } if (typeof instance.componentDidMount === "function") { - { - workInProgress.flags |= Update; - } + var fiberFlags = Update; + + workInProgress.flags |= fiberFlags; } } @@ -8266,9 +8299,9 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === "function") { - { - workInProgress.flags |= Update; - } + var fiberFlags = Update; + + workInProgress.flags |= fiberFlags; } return false; @@ -8314,17 +8347,17 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { } if (typeof instance.componentDidMount === "function") { - { - workInProgress.flags |= Update; - } + var _fiberFlags = Update; + + workInProgress.flags |= _fiberFlags; } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === "function") { - { - workInProgress.flags |= Update; - } + var _fiberFlags2 = Update; + + workInProgress.flags |= _fiberFlags2; } // If shouldComponentUpdate returned false, we should still update the // memoized state to indicate that this work can be reused. @@ -8565,8 +8598,6 @@ var warnForMissingKey = function(child, returnFiber) {}; }; } -var isArray$1 = Array.isArray; - function coerceRef(returnFiber, current, element) { var mixedRef = element.ref; @@ -8681,18 +8712,16 @@ function coerceRef(returnFiber, current, element) { } function throwOnInvalidObjectType(returnFiber, newChild) { - if (returnFiber.type !== "textarea") { - var childString = Object.prototype.toString.call(newChild); + var childString = Object.prototype.toString.call(newChild); - { - throw Error( - "Objects are not valid as a React child (found: " + - (childString === "[object Object]" - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : childString) + - "). If you meant to render a collection of children, use an array instead." - ); - } + { + throw Error( + "Objects are not valid as a React child (found: " + + (childString === "[object Object]" + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : childString) + + "). If you meant to render a collection of children, use an array instead." + ); } } @@ -8948,7 +8977,7 @@ function ChildReconciler(shouldTrackSideEffects) { } } - if (isArray$1(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild)) { var _created3 = createFiberFromFragment( newChild, returnFiber.mode, @@ -9006,7 +9035,7 @@ function ChildReconciler(shouldTrackSideEffects) { } } - if (isArray$1(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild)) { if (key !== null) { return null; } @@ -9061,7 +9090,7 @@ function ChildReconciler(shouldTrackSideEffects) { } } - if (isArray$1(newChild) || getIteratorFn(newChild)) { + if (isArray(newChild) || getIteratorFn(newChild)) { var _matchedFiber3 = existingChildren.get(newIdx) || null; return updateFragment( @@ -9671,9 +9700,7 @@ function ChildReconciler(shouldTrackSideEffects) { newChild = newChild.props.children; } // Handle object types - var isObject = typeof newChild === "object" && newChild !== null; - - if (isObject) { + if (typeof newChild === "object" && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: return placeSingleChild( @@ -9695,6 +9722,26 @@ function ChildReconciler(shouldTrackSideEffects) { ) ); } + + if (isArray(newChild)) { + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + + if (getIteratorFn(newChild)) { + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + + throwOnInvalidObjectType(returnFiber, newChild); } if (typeof newChild === "string" || typeof newChild === "number") { @@ -9708,28 +9755,6 @@ function ChildReconciler(shouldTrackSideEffects) { ); } - if (isArray$1(newChild)) { - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - } - - if (getIteratorFn(newChild)) { - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - } - - if (isObject) { - throwOnInvalidObjectType(returnFiber, newChild); - } - { if (typeof newChild === "function") { warnOnFunctionType(returnFiber); @@ -10181,7 +10206,7 @@ function updateHookTypesDev() { function checkDepsAreArrayDev(deps) { { - if (deps !== undefined && deps !== null && !Array.isArray(deps)) { + if (deps !== undefined && deps !== null && !isArray(deps)) { // Verify deps, but only on mount to avoid extra checks. // It's unlikely their type would change as usually you define them inline. error( @@ -10401,7 +10426,7 @@ function renderWithHooks( if ( current !== null && - (current.flags & PassiveStatic) !== (workInProgress.flags & PassiveStatic) + (current.flags & StaticMask) !== (workInProgress.flags & StaticMask) ) { error( "Internal React error: Expected static flag was missing. Please " + @@ -11229,9 +11254,9 @@ function updateEffect(create, deps) { } function mountLayoutEffect(create, deps) { - { - return mountEffectImpl(Update, Layout, create, deps); - } + var fiberFlags = Update; + + return mountEffectImpl(fiberFlags, Layout, create, deps); } function updateLayoutEffect(create, deps) { @@ -11283,15 +11308,14 @@ function mountImperativeHandle(ref, create, deps) { var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + var fiberFlags = Update; - { - return mountEffectImpl( - Update, - Layout, - imperativeHandleEffect.bind(null, create, ref), - effectDeps - ); - } + return mountEffectImpl( + fiberFlags, + Layout, + imperativeHandleEffect.bind(null, create, ref), + effectDeps + ); } function updateImperativeHandle(ref, create, deps) { @@ -13671,17 +13695,6 @@ function mountIndeterminateComponent( workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; initializeUpdateQueue(workInProgress); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - - if (typeof getDerivedStateFromProps === "function") { - applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - props - ); - } - adoptClassInstance(workInProgress, value); mountClassInstance(workInProgress, Component, props, renderLanes); return finishClassComponent( @@ -14441,11 +14454,12 @@ function validateTailOptions(tailMode, revealOrder) { function validateSuspenseListNestedChild(childSlot, index) { { - var isArray = Array.isArray(childSlot); - var isIterable = !isArray && typeof getIteratorFn(childSlot) === "function"; + var isAnArray = isArray(childSlot); + var isIterable = + !isAnArray && typeof getIteratorFn(childSlot) === "function"; - if (isArray || isIterable) { - var type = isArray ? "array" : "iterable"; + if (isAnArray || isIterable) { + var type = isAnArray ? "array" : "iterable"; error( "A nested %s was passed to row #%s in . Wrap it in " + @@ -14473,7 +14487,7 @@ function validateSuspenseListChildren(children, revealOrder) { children !== null && children !== false ) { - if (Array.isArray(children)) { + if (isArray(children)) { for (var i = 0; i < children.length; i++) { if (!validateSuspenseListNestedChild(children[i], i)) { return; @@ -15854,7 +15868,7 @@ function completeWork(current, workInProgress, renderLanes) { var _primaryChildFragment2 = workInProgress.child; if (_primaryChildFragment2 !== null) { - // $FlowFixMe Flow doens't support type casting in combiation with the -= operator + // $FlowFixMe Flow doesn't support type casting in combination with the -= operator workInProgress.treeBaseDuration -= _primaryChildFragment2.treeBaseDuration; } @@ -16522,6 +16536,7 @@ function attachPingListener(root, wakeable, lanes) { // Memoize using the thread ID to prevent redundant listeners. threadIDs.add(lanes); var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); + wakeable.then(ping, ping); } } @@ -16755,10 +16770,9 @@ var didWarnAboutUndefinedSnapshotBeforeUpdate = null; { didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); -} - +} // Used during the commit phase to track the state of the Offscreen component stack. var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set; -var nextEffect = null; +var nextEffect = null; // Used for Profiling builds to track updaters. var callComponentWillUnmountWithTimer = function(current, instance) { instance.props = current.memoizedProps; @@ -16767,7 +16781,7 @@ var callComponentWillUnmountWithTimer = function(current, instance) { { instance.componentWillUnmount(); } -}; // Capture errors so they don't interrupt unmounting. +}; // Capture errors so they don't interrupt mounting. function safelyCallComponentWillUnmount( current, @@ -16788,7 +16802,7 @@ function safelyCallComponentWillUnmount( captureCommitPhaseError(current, nearestMountedAncestor, unmountError); } } -} +} // Capture errors so they don't interrupt mounting. function safelyDetachRef(current, nearestMountedAncestor) { var ref = current.ref; @@ -17363,6 +17377,11 @@ function commitLayoutEffectOnFiber( } function hideOrUnhideAllChildren(finishedWork, isHidden) { + // Suspense layout effects semantics don't change for legacy roots. + var isModernRoot = (finishedWork.mode & ConcurrentMode) !== NoMode; + var current = finishedWork.alternate; + var wasHidden = current !== null && current.memoizedState !== null; + { // We only have the top Fiber that was inserted but we need to recurse down its // children to find all the terminal nodes. @@ -17764,7 +17783,7 @@ function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { var isHost = tag === HostComponent || tag === HostText; if (isHost) { - var stateNode = isHost ? node.stateNode : node.stateNode.instance; + var stateNode = node.stateNode; if (before) { insertInContainerBefore(parent); @@ -17792,7 +17811,7 @@ function insertOrAppendPlacementNode(node, before, parent) { var isHost = tag === HostComponent || tag === HostText; if (isHost) { - var stateNode = isHost ? node.stateNode : node.stateNode.instance; + var stateNode = node.stateNode; if (before) { insertBefore(parent, stateNode, before); @@ -18082,6 +18101,7 @@ function attachSuspenseRetryListeners(finishedWork) { } retryCache.add(wakeable); + wakeable.then(retry, retry); } }); @@ -18107,7 +18127,7 @@ function commitResetTextContent(current) { resetTextContent(current.stateNode); } -function commitMutationEffects(root, firstChild) { +function commitMutationEffects(root, firstChild, committedLanes) { nextEffect = firstChild; commitMutationEffects_begin(root); } @@ -18255,6 +18275,9 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { } function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { + // Suspense layout effects semantics don't change for legacy roots. + var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; + while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; @@ -18269,6 +18292,9 @@ function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { } function commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) { + // Suspense layout effects semantics don't change for legacy roots. + var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; + while (nextEffect !== null) { var fiber = nextEffect; @@ -18597,6 +18623,7 @@ if (typeof Symbol === "function" && Symbol.for) { var ceil = Math.ceil; var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing; var NoContext = /* */ @@ -18760,6 +18787,7 @@ function requestUpdateLane(fiber) { // TODO: Move this type conversion to the event priority module. var eventLane = getCurrentEventPriority(); + return eventLane; } @@ -18785,7 +18813,7 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { if (root === null) { warnAboutUpdateOnUnmountedFiberInDEV(fiber); return null; - } // Mark that the root has a pending update. + } markRootUpdated(root, lane, eventTime); @@ -19304,7 +19332,10 @@ function performSyncWorkOnRoot(root) { var finishedWork = root.current.alternate; root.finishedWork = finishedWork; root.finishedLanes = lanes; - commitRoot(root); // Before exiting, make sure there's a callback scheduled for the next + + { + commitRoot(root); + } // Before exiting, make sure there's a callback scheduled for the next // pending level. ensureRootIsScheduled(root, now()); @@ -19329,9 +19360,11 @@ function batchedUpdates$1(fn, a) { function flushSync(fn, a) { var prevExecutionContext = executionContext; executionContext |= BatchedContext; + var prevTransition = ReactCurrentBatchConfig$2.transition; var previousPriority = getCurrentUpdatePriority(); try { + ReactCurrentBatchConfig$2.transition = 0; setCurrentUpdatePriority(DiscreteEventPriority); if (fn) { @@ -19341,6 +19374,7 @@ function flushSync(fn, a) { } } finally { setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. // Note that this will happen even if batchedUpdates is higher up // the stack. @@ -19786,11 +19820,14 @@ function commitRoot(root) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); + var prevTransition = ReactCurrentBatchConfig$2.transition; try { + ReactCurrentBatchConfig$2.transition = 0; setCurrentUpdatePriority(DiscreteEventPriority); commitRootImpl(root, previousUpdateLanePriority); } finally { + ReactCurrentBatchConfig$2.transition = prevTransition; setCurrentUpdatePriority(previousUpdateLanePriority); } @@ -19876,6 +19913,8 @@ function commitRootImpl(root, renderPriorityLevel) { NoFlags; if (subtreeHasEffects || rootHasEffect) { + var prevTransition = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = 0; var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(DiscreteEventPriority); var prevExecutionContext = executionContext; @@ -19921,6 +19960,7 @@ function commitRootImpl(root, renderPriorityLevel) { executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value. setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; } else { // No effects. root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were @@ -20008,6 +20048,20 @@ function commitRootImpl(root, renderPriorityLevel) { // of the batch. return null; + } // If the passive effects are the result of a discrete render, flush them + // synchronously at the end of the current task so that the result is + // immediately observable. Otherwise, we assume that they are not + // order-dependent and do not need to be observed by external systems, so we + // can wait until after paint. + // TODO: We can optimize this by not scheduling the callback earlier. Since we + // currently schedule the callback in multiple places, will wait until those + // are consolidated. + + if ( + includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && + root.tag !== LegacyRoot + ) { + flushPassiveEffects(); } // If layout work was scheduled, flush it now. flushSyncCallbackQueue(); @@ -20017,18 +20071,24 @@ function commitRootImpl(root, renderPriorityLevel) { function flushPassiveEffects() { // Returns whether passive effects were flushed. - if (pendingPassiveEffectsLanes !== NoLanes) { - var priority = higherEventPriority( - DefaultEventPriority, - lanesToEventPriority(pendingPassiveEffectsLanes) - ); + // TODO: Combine this check with the one in flushPassiveEFfectsImpl. We should + // probably just combine the two functions. I believe they were only separate + // in the first place because we used to wrap it with + // `Scheduler.runWithPriority`, which accepts a function. But now we track the + // priority within React itself, so we can mutate the variable directly. + if (rootWithPendingPassiveEffects !== null) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); + var priority = lowerEventPriority(DefaultEventPriority, renderPriority); + var prevTransition = ReactCurrentBatchConfig$2.transition; var previousPriority = getCurrentUpdatePriority(); try { + ReactCurrentBatchConfig$2.transition = 0; setCurrentUpdatePriority(priority); return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; } } @@ -20042,7 +20102,10 @@ function flushPassiveEffectsImpl() { var root = rootWithPendingPassiveEffects; var lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; + rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects. + // Figure out why and fix it. It's not causing any known issues (probably + // because it's only used for profiling), but it's a refactor hazard. + pendingPassiveEffectsLanes = NoLanes; if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) { @@ -20073,7 +20136,10 @@ function flushPassiveEffectsImpl() { // exceeds the limit, we'll fire a warning. nestedPassiveUpdateCount = - rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1; + rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1; // TODO: Move to commitPassiveMountEffects + + onPostCommitRoot(root); + return true; } @@ -21819,7 +21885,10 @@ function createFiberFromFragment(elements, mode, lanes, key) { function createFiberFromProfiler(pendingProps, mode, lanes, key) { { if (typeof pendingProps.id !== "string") { - error('Profiler must specify an "id" as a prop'); + error( + 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', + typeof pendingProps.id + ); } } @@ -22234,10 +22303,10 @@ var setSuspenseHandler = null; { var copyWithDeleteImpl = function(obj, path, index) { var key = path[index]; - var updated = Array.isArray(obj) ? obj.slice() : Object.assign({}, obj); + var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); if (index + 1 === path.length) { - if (Array.isArray(updated)) { + if (isArray(updated)) { updated.splice(key, 1); } else { delete updated[key]; @@ -22256,14 +22325,14 @@ var setSuspenseHandler = null; var copyWithRenameImpl = function(obj, oldPath, newPath, index) { var oldKey = oldPath[index]; - var updated = Array.isArray(obj) ? obj.slice() : Object.assign({}, obj); + var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); if (index + 1 === oldPath.length) { var newKey = newPath[index]; // $FlowFixMe number or string is fine here updated[newKey] = updated[oldKey]; - if (Array.isArray(updated)) { + if (isArray(updated)) { updated.splice(oldKey, 1); } else { delete updated[oldKey]; @@ -22308,7 +22377,7 @@ var setSuspenseHandler = null; } var key = path[index]; - var updated = Array.isArray(obj) ? obj.slice() : Object.assign({}, obj); // $FlowFixMe number or string is fine here + var updated = isArray(obj) ? obj.slice() : Object.assign({}, obj); // $FlowFixMe number or string is fine here updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); return updated; @@ -22465,7 +22534,10 @@ function injectIntoDevTools(devToolsConfig) { scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, // Enables DevTools to append owner stacks to error messages in DEV mode. - getCurrentFiber: getCurrentFiberForDevTools + getCurrentFiber: getCurrentFiberForDevTools, + // Enables DevTools to detect reconciler version rather than renderer version + // which may not match for third party renderers. + reconcilerVersion: ReactVersion }); } diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index cf61e99d065c63..dadafbe97165b6 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<9a93ce433eed65e2405523253a760a3a>> + * @generated SignedSource<<67d6e303f1823e73e6e16508519f4668>> */ "use strict"; @@ -62,7 +62,8 @@ function invokeGuardedCallbackAndCatchFirstError( hasRethrowError || ((hasRethrowError = !0), (rethrowError = error)); } } -var getFiberCurrentPropsFromNode = null, +var isArrayImpl = Array.isArray, + getFiberCurrentPropsFromNode = null, getInstanceFromNode = null, getNodeFromInstance = null; function executeDispatch(event, listener, inst) { @@ -74,7 +75,7 @@ function executeDispatch(event, listener, inst) { function executeDirectDispatch(event) { var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - if (Array.isArray(dispatchListener)) + if (isArrayImpl(dispatchListener)) throw Error("executeDirectDispatch(...): Invalid `event`."); event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) @@ -335,9 +336,9 @@ function accumulate(current, next) { ); return null == current ? next - : Array.isArray(current) + : isArrayImpl(current) ? current.concat(next) - : Array.isArray(next) + : isArrayImpl(next) ? [current].concat(next) : [current, next]; } @@ -347,12 +348,12 @@ function accumulateInto(current, next) { "accumulateInto(...): Accumulated items must not be null or undefined." ); if (null == current) return next; - if (Array.isArray(current)) { - if (Array.isArray(next)) return current.push.apply(current, next), current; + if (isArrayImpl(current)) { + if (isArrayImpl(next)) return current.push.apply(current, next), current; current.push(next); return current; } - return Array.isArray(next) ? [current].concat(next) : [current, next]; + return isArrayImpl(next) ? [current].concat(next) : [current, next]; } function forEachAccumulated(arr, cb, scope) { Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); @@ -578,7 +579,7 @@ var ResponderEventPlugin = { b: { JSCompiler_temp = shouldSetEventType._dispatchListeners; targetInst = shouldSetEventType._dispatchInstances; - if (Array.isArray(JSCompiler_temp)) + if (isArrayImpl(JSCompiler_temp)) for ( depthA = 0; depthA < JSCompiler_temp.length && @@ -929,7 +930,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_217 = { +var injectedNamesToPlugins$jscomp$inline_218 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -964,34 +965,34 @@ var injectedNamesToPlugins$jscomp$inline_217 = { } } }, - isOrderingDirty$jscomp$inline_218 = !1, - pluginName$jscomp$inline_219; -for (pluginName$jscomp$inline_219 in injectedNamesToPlugins$jscomp$inline_217) + isOrderingDirty$jscomp$inline_219 = !1, + pluginName$jscomp$inline_220; +for (pluginName$jscomp$inline_220 in injectedNamesToPlugins$jscomp$inline_218) if ( - injectedNamesToPlugins$jscomp$inline_217.hasOwnProperty( - pluginName$jscomp$inline_219 + injectedNamesToPlugins$jscomp$inline_218.hasOwnProperty( + pluginName$jscomp$inline_220 ) ) { - var pluginModule$jscomp$inline_220 = - injectedNamesToPlugins$jscomp$inline_217[pluginName$jscomp$inline_219]; + var pluginModule$jscomp$inline_221 = + injectedNamesToPlugins$jscomp$inline_218[pluginName$jscomp$inline_220]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_219) || - namesToPlugins[pluginName$jscomp$inline_219] !== - pluginModule$jscomp$inline_220 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_220) || + namesToPlugins[pluginName$jscomp$inline_220] !== + pluginModule$jscomp$inline_221 ) { - if (namesToPlugins[pluginName$jscomp$inline_219]) + if (namesToPlugins[pluginName$jscomp$inline_220]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_219 + + pluginName$jscomp$inline_220 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_219 - ] = pluginModule$jscomp$inline_220; - isOrderingDirty$jscomp$inline_218 = !0; + pluginName$jscomp$inline_220 + ] = pluginModule$jscomp$inline_221; + isOrderingDirty$jscomp$inline_219 = !0; } } -isOrderingDirty$jscomp$inline_218 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_219 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -1015,7 +1016,7 @@ function executeDispatchesAndReleaseTopLevel(e) { if (e) { var dispatchListeners = e._dispatchListeners, dispatchInstances = e._dispatchInstances; - if (Array.isArray(dispatchListeners)) + if (isArrayImpl(dispatchListeners)) for ( var i = 0; i < dispatchListeners.length && !e.isPropagationStopped(); @@ -1416,7 +1417,7 @@ function restoreDeletedValuesInNestedArray( node, validAttributes ) { - if (Array.isArray(node)) + if (isArrayImpl(node)) for (var i = node.length; i-- && 0 < removedKeyCount; ) restoreDeletedValuesInNestedArray( updatePayload, @@ -1462,9 +1463,9 @@ function diffNestedProperty( : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload; - if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) + if (!isArrayImpl(prevProp) && !isArrayImpl(nextProp)) return diffProperties(updatePayload, prevProp, nextProp, validAttributes); - if (Array.isArray(prevProp) && Array.isArray(nextProp)) { + if (isArrayImpl(prevProp) && isArrayImpl(nextProp)) { var minLength = prevProp.length < nextProp.length ? prevProp.length : nextProp.length, i; @@ -1489,7 +1490,7 @@ function diffNestedProperty( ); return updatePayload; } - return Array.isArray(prevProp) + return isArrayImpl(prevProp) ? diffProperties( updatePayload, ReactNativePrivateInterface.flattenStyle(prevProp), @@ -1505,7 +1506,7 @@ function diffNestedProperty( } function addNestedProperty(updatePayload, nextProp, validAttributes) { if (!nextProp) return updatePayload; - if (!Array.isArray(nextProp)) + if (!isArrayImpl(nextProp)) return diffProperties( updatePayload, emptyObject, @@ -1522,7 +1523,7 @@ function addNestedProperty(updatePayload, nextProp, validAttributes) { } function clearNestedProperty(updatePayload, prevProp, validAttributes) { if (!prevProp) return updatePayload; - if (!Array.isArray(prevProp)) + if (!isArrayImpl(prevProp)) return diffProperties( updatePayload, prevProp, @@ -1686,7 +1687,29 @@ var ReactNativeFiberHostComponent = (function() { }; return ReactNativeFiberHostComponent; })(), - nextTransitionLane = 64, + scheduleCallback = Scheduler.unstable_scheduleCallback, + cancelCallback = Scheduler.unstable_cancelCallback, + shouldYield = Scheduler.unstable_shouldYield, + requestPaint = Scheduler.unstable_requestPaint, + now = Scheduler.unstable_now, + ImmediatePriority = Scheduler.unstable_ImmediatePriority, + UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + NormalPriority = Scheduler.unstable_NormalPriority, + IdlePriority = Scheduler.unstable_IdlePriority, + rendererID = null, + injectedHook = null; +function onCommitRoot(root) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + root, + void 0, + 128 === (root.current.flags & 128) + ); + } catch (err) {} +} +var nextTransitionLane = 64, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { switch (lanes & -lanes) { @@ -1930,7 +1953,8 @@ function describeFunctionComponentFrame(fn, source) { ? describeComponentFrame(fn.displayName || fn.name || null, source, null) : ""; } -var valueStack = [], +var hasOwnProperty = Object.prototype.hasOwnProperty, + valueStack = [], index = -1; function createCursor(defaultValue) { return { current: defaultValue }; @@ -2026,28 +2050,6 @@ function invalidateContextProvider(workInProgress, type, didChange) { : pop(didPerformWorkStackCursor); push(didPerformWorkStackCursor, didChange); } -var scheduleCallback = Scheduler.unstable_scheduleCallback, - cancelCallback = Scheduler.unstable_cancelCallback, - shouldYield = Scheduler.unstable_shouldYield, - requestPaint = Scheduler.unstable_requestPaint, - now = Scheduler.unstable_now, - ImmediatePriority = Scheduler.unstable_ImmediatePriority, - UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, - NormalPriority = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority, - rendererID = null, - injectedHook = null; -function onCommitRoot(root) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - injectedHook.onCommitFiberRoot( - rendererID, - root, - void 0, - 128 === (root.current.flags & 128) - ); - } catch (err) {} -} var syncQueue = null, isFlushingSyncQueue = !1; function flushSyncCallbackQueue() { @@ -2078,8 +2080,7 @@ var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } -var objectIs = "function" === typeof Object.is ? Object.is : is, - hasOwnProperty = Object.prototype.hasOwnProperty; +var objectIs = "function" === typeof Object.is ? Object.is : is; function shallowEqual(objA, objB) { if (objectIs(objA, objB)) return !0; if ( @@ -2584,7 +2585,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { ? previousContext : contextStackCursor.current), (instance.context = getMaskedContext(workInProgress, contextType))); - processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; contextType = ctor.getDerivedStateFromProps; "function" === typeof contextType && @@ -2606,7 +2606,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4); } -var isArray = Array.isArray; function coerceRef(returnFiber, current, element) { returnFiber = element.ref; if ( @@ -2659,15 +2658,14 @@ function coerceRef(returnFiber, current, element) { return returnFiber; } function throwOnInvalidObjectType(returnFiber, newChild) { - if ("textarea" !== returnFiber.type) - throw ((returnFiber = Object.prototype.toString.call(newChild)), - Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - )); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." + ); } function ChildReconciler(shouldTrackSideEffects) { function deleteChild(returnFiber, childToDelete) { @@ -2829,7 +2827,7 @@ function ChildReconciler(shouldTrackSideEffects) { newChild ); } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( (newChild = createFiberFromFragment( newChild, @@ -2861,7 +2859,7 @@ function ChildReconciler(shouldTrackSideEffects) { ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null; } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null); @@ -2900,7 +2898,7 @@ function ChildReconciler(shouldTrackSideEffects) { updatePortal(returnFiber, existingChildren, newChild, lanes) ); } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( (existingChildren = existingChildren.get(newIdx) || null), updateFragment(returnFiber, existingChildren, newChild, lanes, null) @@ -3083,20 +3081,19 @@ function ChildReconciler(shouldTrackSideEffects) { newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key; isUnkeyedTopLevelFragment && (newChild = newChild.props.children); - var isObject = "object" === typeof newChild && null !== newChild; - if (isObject) + if ("object" === typeof newChild && null !== newChild) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: a: { - isObject = newChild.key; + var key = newChild.key; for ( isUnkeyedTopLevelFragment = currentFirstChild; null !== isUnkeyedTopLevelFragment; ) { - if (isUnkeyedTopLevelFragment.key === isObject) { - isObject = newChild.type; - if (isObject === REACT_FRAGMENT_TYPE) { + if (isUnkeyedTopLevelFragment.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { if (7 === isUnkeyedTopLevelFragment.tag) { deleteRemainingChildren( returnFiber, @@ -3110,7 +3107,7 @@ function ChildReconciler(shouldTrackSideEffects) { returnFiber = currentFirstChild; break a; } - } else if (isUnkeyedTopLevelFragment.elementType === isObject) { + } else if (isUnkeyedTopLevelFragment.elementType === key) { deleteRemainingChildren( returnFiber, isUnkeyedTopLevelFragment.sibling @@ -3202,6 +3199,22 @@ function ChildReconciler(shouldTrackSideEffects) { } return placeSingleChild(returnFiber); } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } if ("string" === typeof newChild || "number" === typeof newChild) return ( (newChild = "" + newChild), @@ -3220,21 +3233,6 @@ function ChildReconciler(shouldTrackSideEffects) { (returnFiber = currentFirstChild)), placeSingleChild(returnFiber) ); - if (isArray(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - isObject && throwOnInvalidObjectType(returnFiber, newChild); if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment) switch (returnFiber.tag) { case 1: @@ -3699,7 +3697,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { hook.memoizedState = pushEffect(1 | hookFlags, create, destroy, deps); } function mountEffect(create, deps) { - return mountEffectImpl(263168, 4, create, deps); + return mountEffectImpl(1049600, 4, create, deps); } function updateEffect(create, deps) { return updateEffectImpl(1024, 4, create, deps); @@ -4692,7 +4690,7 @@ function updateSuspenseFallbackChildren( (primaryChildren.pendingProps = primaryChildProps), (workInProgress.deletions = null)) : ((primaryChildren = createWorkInProgress(current, primaryChildProps)), - (primaryChildren.subtreeFlags = current.subtreeFlags & 262144)); + (primaryChildren.subtreeFlags = current.subtreeFlags & 1835008)); null !== currentFallbackChildFragment ? (fallbackChildren = createWorkInProgress( currentFallbackChildFragment, @@ -4893,14 +4891,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$62 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$62 = lastTailNode), + for (var lastTailNode$64 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$64 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$62 + null === lastTailNode$64 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$62.sibling = null); + : (lastTailNode$64.sibling = null); } } function bubbleProperties(completedWork) { @@ -4910,19 +4908,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$63 = completedWork.child; null !== child$63; ) - (newChildLanes |= child$63.lanes | child$63.childLanes), - (subtreeFlags |= child$63.subtreeFlags & 262144), - (subtreeFlags |= child$63.flags & 262144), - (child$63.return = completedWork), - (child$63 = child$63.sibling); + for (var child$65 = completedWork.child; null !== child$65; ) + (newChildLanes |= child$65.lanes | child$65.childLanes), + (subtreeFlags |= child$65.subtreeFlags & 1835008), + (subtreeFlags |= child$65.flags & 1835008), + (child$65.return = completedWork), + (child$65 = child$65.sibling); else - for (child$63 = completedWork.child; null !== child$63; ) - (newChildLanes |= child$63.lanes | child$63.childLanes), - (subtreeFlags |= child$63.subtreeFlags), - (subtreeFlags |= child$63.flags), - (child$63.return = completedWork), - (child$63 = child$63.sibling); + for (child$65 = completedWork.child; null !== child$65; ) + (newChildLanes |= child$65.lanes | child$65.childLanes), + (subtreeFlags |= child$65.subtreeFlags), + (subtreeFlags |= child$65.flags), + (child$65.return = completedWork), + (child$65 = child$65.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -5124,7 +5122,7 @@ function completeWork(current, workInProgress, renderLanes) { for (newProps = workInProgress.child; null !== newProps; ) (renderLanes = newProps), (type = current), - (renderLanes.flags &= 262146), + (renderLanes.flags &= 1835010), (updatePayload = renderLanes.alternate), null === updatePayload ? ((renderLanes.childLanes = 0), @@ -5492,8 +5490,8 @@ function commitHookEffectListMount(tag, finishedWork) { var effect = (finishedWork = finishedWork.next); do { if ((effect.tag & tag) === tag) { - var create$80 = effect.create; - effect.destroy = create$80(); + var create$82 = effect.create; + effect.destroy = create$82(); } effect = effect.next; } while (effect !== finishedWork); @@ -5698,10 +5696,9 @@ function commitPlacement(finishedWork) { : insertOrAppendPlacementNode(finishedWork, parentFiber, parent); } function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag, - isHost = 5 === tag || 6 === tag; - if (isHost) - if (((node = isHost ? node.stateNode : node.stateNode.instance), before)) { + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { if ("number" === typeof parent) throw Error("Container does not support insertBefore operation"); } else @@ -5719,58 +5716,57 @@ function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { (node = node.sibling); } function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag, - isHost = 5 === tag || 6 === tag; - if (isHost) - (node = isHost ? node.stateNode : node.stateNode.instance), - before - ? ((tag = parent._children), - (isHost = tag.indexOf(node)), - 0 <= isHost - ? (tag.splice(isHost, 1), - (before = tag.indexOf(before)), - tag.splice(before, 0, node), - ReactNativePrivateInterface.UIManager.manageChildren( - parent._nativeTag, - [isHost], - [before], - [], - [], - [] - )) - : ((before = tag.indexOf(before)), - tag.splice(before, 0, node), - ReactNativePrivateInterface.UIManager.manageChildren( - parent._nativeTag, - [], - [], - ["number" === typeof node ? node : node._nativeTag], - [before], - [] - ))) - : ((before = "number" === typeof node ? node : node._nativeTag), - (tag = parent._children), - (isHost = tag.indexOf(node)), - 0 <= isHost - ? (tag.splice(isHost, 1), - tag.push(node), - ReactNativePrivateInterface.UIManager.manageChildren( - parent._nativeTag, - [isHost], - [tag.length - 1], - [], - [], - [] - )) - : (tag.push(node), - ReactNativePrivateInterface.UIManager.manageChildren( - parent._nativeTag, - [], - [], - [before], - [tag.length - 1], - [] - ))); + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { + tag = parent._children; + var index = tag.indexOf(node); + 0 <= index + ? (tag.splice(index, 1), + (before = tag.indexOf(before)), + tag.splice(before, 0, node), + ReactNativePrivateInterface.UIManager.manageChildren( + parent._nativeTag, + [index], + [before], + [], + [], + [] + )) + : ((before = tag.indexOf(before)), + tag.splice(before, 0, node), + ReactNativePrivateInterface.UIManager.manageChildren( + parent._nativeTag, + [], + [], + ["number" === typeof node ? node : node._nativeTag], + [before], + [] + )); + } else + (before = "number" === typeof node ? node : node._nativeTag), + (tag = parent._children), + (index = tag.indexOf(node)), + 0 <= index + ? (tag.splice(index, 1), + tag.push(node), + ReactNativePrivateInterface.UIManager.manageChildren( + parent._nativeTag, + [index], + [tag.length - 1], + [], + [], + [] + )) + : (tag.push(node), + ReactNativePrivateInterface.UIManager.manageChildren( + parent._nativeTag, + [], + [], + [before], + [tag.length - 1], + [] + )); else if (4 !== tag && ((node = node.child), null !== node)) for ( insertOrAppendPlacementNode(node, before, parent), node = node.sibling; @@ -6092,8 +6088,8 @@ function commitLayoutEffects(finishedWork) { commitUpdateQueue(firstChild, updateQueue, instance); break; case 3: - var updateQueue$81 = firstChild.updateQueue; - if (null !== updateQueue$81) { + var updateQueue$83 = firstChild.updateQueue; + if (null !== updateQueue$83) { current = null; if (null !== firstChild.child) switch (firstChild.child.tag) { @@ -6103,7 +6099,7 @@ function commitLayoutEffects(finishedWork) { case 1: current = firstChild.child.stateNode; } - commitUpdateQueue(firstChild, updateQueue$81, current); + commitUpdateQueue(firstChild, updateQueue$83, current); } break; case 5: @@ -6165,6 +6161,7 @@ function commitLayoutEffects(finishedWork) { var ceil = Math.ceil, ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, executionContext = 0, workInProgressRoot = null, workInProgress = null, @@ -6616,15 +6613,15 @@ function handleError(root$jscomp$0, thrownValue) { } var hasInvisibleParentBoundary = 0 !== (suspenseStackCursor.current & 1), - workInProgress$75 = returnFiber; + workInProgress$77 = returnFiber; do { var JSCompiler_temp; - if ((JSCompiler_temp = 13 === workInProgress$75.tag)) { - var nextState = workInProgress$75.memoizedState; + if ((JSCompiler_temp = 13 === workInProgress$77.tag)) { + var nextState = workInProgress$77.memoizedState; if (null !== nextState) JSCompiler_temp = null !== nextState.dehydrated ? !0 : !1; else { - var props = workInProgress$75.memoizedProps; + var props = workInProgress$77.memoizedProps; JSCompiler_temp = void 0 === props.fallback ? !1 @@ -6636,17 +6633,17 @@ function handleError(root$jscomp$0, thrownValue) { } } if (JSCompiler_temp) { - var wakeables = workInProgress$75.updateQueue; + var wakeables = workInProgress$77.updateQueue; if (null === wakeables) { var updateQueue = new Set(); updateQueue.add(wakeable); - workInProgress$75.updateQueue = updateQueue; + workInProgress$77.updateQueue = updateQueue; } else wakeables.add(wakeable); if ( - 0 === (workInProgress$75.mode & 1) && - workInProgress$75 !== returnFiber + 0 === (workInProgress$77.mode & 1) && + workInProgress$77 !== returnFiber ) { - workInProgress$75.flags |= 128; + workInProgress$77.flags |= 128; sourceFiber.flags |= 32768; sourceFiber.flags &= -10053; if (1 === sourceFiber.tag) @@ -6679,12 +6676,12 @@ function handleError(root$jscomp$0, thrownValue) { ); wakeable.then(ping, ping); } - workInProgress$75.flags |= 16384; - workInProgress$75.lanes = thrownValue; + workInProgress$77.flags |= 16384; + workInProgress$77.lanes = thrownValue; break a; } - workInProgress$75 = workInProgress$75.return; - } while (null !== workInProgress$75); + workInProgress$77 = workInProgress$77.return; + } while (null !== workInProgress$77); value = Error( (getComponentNameFromFiber(sourceFiber) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." @@ -6693,47 +6690,47 @@ function handleError(root$jscomp$0, thrownValue) { 5 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); value = createCapturedValue(value, sourceFiber); - workInProgress$75 = returnFiber; + workInProgress$77 = returnFiber; do { - switch (workInProgress$75.tag) { + switch (workInProgress$77.tag) { case 3: root = value; - workInProgress$75.flags |= 16384; + workInProgress$77.flags |= 16384; thrownValue &= -thrownValue; - workInProgress$75.lanes |= thrownValue; - var update$76 = createRootErrorUpdate( - workInProgress$75, + workInProgress$77.lanes |= thrownValue; + var update$78 = createRootErrorUpdate( + workInProgress$77, root, thrownValue ); - enqueueCapturedUpdate(workInProgress$75, update$76); + enqueueCapturedUpdate(workInProgress$77, update$78); break a; case 1: root = value; - var ctor = workInProgress$75.type, - instance = workInProgress$75.stateNode; + var ctor = workInProgress$77.type, + instance = workInProgress$77.stateNode; if ( - 0 === (workInProgress$75.flags & 128) && + 0 === (workInProgress$77.flags & 128) && ("function" === typeof ctor.getDerivedStateFromError || (null !== instance && "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) ) { - workInProgress$75.flags |= 16384; + workInProgress$77.flags |= 16384; thrownValue &= -thrownValue; - workInProgress$75.lanes |= thrownValue; - var update$79 = createClassErrorUpdate( - workInProgress$75, + workInProgress$77.lanes |= thrownValue; + var update$81 = createClassErrorUpdate( + workInProgress$77, root, thrownValue ); - enqueueCapturedUpdate(workInProgress$75, update$79); + enqueueCapturedUpdate(workInProgress$77, update$81); break a; } } - workInProgress$75 = workInProgress$75.return; - } while (null !== workInProgress$75); + workInProgress$77 = workInProgress$77.return; + } while (null !== workInProgress$77); } completeUnitOfWork(erroredWork); } catch (yetAnotherThrownValue) { @@ -6824,12 +6821,15 @@ function completeUnitOfWork(unitOfWork) { 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } function commitRoot(root) { - var previousUpdateLanePriority = currentUpdatePriority; + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig$2.transition; try { - (currentUpdatePriority = 1), + (ReactCurrentBatchConfig$2.transition = 0), + (currentUpdatePriority = 1), commitRootImpl(root, previousUpdateLanePriority); } finally { - currentUpdatePriority = previousUpdateLanePriority; + (ReactCurrentBatchConfig$2.transition = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); } return null; } @@ -6864,7 +6864,9 @@ function commitRootImpl(root, renderPriorityLevel) { })); remainingLanes = 0 !== (finishedWork.flags & 8054); if (0 !== (finishedWork.subtreeFlags & 8054) || remainingLanes) { - remainingLanes = currentUpdatePriority; + remainingLanes = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = 0; + var previousPriority = currentUpdatePriority; currentUpdatePriority = 1; var prevExecutionContext = executionContext; executionContext |= 16; @@ -6875,7 +6877,8 @@ function commitRootImpl(root, renderPriorityLevel) { commitLayoutEffects(finishedWork, root, lanes); requestPaint(); executionContext = prevExecutionContext; - currentUpdatePriority = remainingLanes; + currentUpdatePriority = previousPriority; + ReactCurrentBatchConfig$2.transition = remainingLanes; } else root.current = finishedWork; rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), @@ -6896,26 +6899,31 @@ function commitRootImpl(root, renderPriorityLevel) { (firstUncaughtError = null), root); if (0 !== (executionContext & 4)) return null; + 0 !== (pendingPassiveEffectsLanes & 1) && + 0 !== root.tag && + flushPassiveEffects(); flushSyncCallbackQueue(); return null; } function flushPassiveEffects() { - if (0 !== pendingPassiveEffectsLanes) { - var b = lanesToEventPriority(pendingPassiveEffectsLanes), + if (null !== rootWithPendingPassiveEffects) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$2.transition, previousPriority = currentUpdatePriority; try { - currentUpdatePriority = 16 < b ? 16 : b; + ReactCurrentBatchConfig$2.transition = 0; + currentUpdatePriority = 16 > renderPriority ? 16 : renderPriority; if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1; else { - var root = rootWithPendingPassiveEffects; + renderPriority = rootWithPendingPassiveEffects; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; if (0 !== (executionContext & 24)) throw Error("Cannot flush passive effects while already rendering."); - b = executionContext; + var prevExecutionContext = executionContext; executionContext |= 16; - for (nextEffect = root.current; null !== nextEffect; ) { + for (nextEffect = renderPriority.current; null !== nextEffect; ) { var fiber = nextEffect, child = fiber.child; if (0 !== (nextEffect.flags & 16)) { @@ -6990,7 +6998,7 @@ function flushPassiveEffects() { nextEffect = fiber.return; } } - var finishedWork = root.current; + var finishedWork = renderPriority.current; for (nextEffect = finishedWork; null !== nextEffect; ) { child = nextEffect; var firstChild = child.child; @@ -7023,13 +7031,21 @@ function flushPassiveEffects() { nextEffect = deletions.return; } } - executionContext = b; + executionContext = prevExecutionContext; flushSyncCallbackQueue(); + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} JSCompiler_inline_result = !0; } return JSCompiler_inline_result; } finally { - currentUpdatePriority = previousPriority; + (currentUpdatePriority = previousPriority), + (ReactCurrentBatchConfig$2.transition = prevTransition); } } return !1; @@ -7248,14 +7264,6 @@ beginWork$1 = function(current, workInProgress, renderLanes) { ? nextValue.state : null; initializeUpdateQueue(workInProgress); - var getDerivedStateFromProps = updateLanes.getDerivedStateFromProps; - "function" === typeof getDerivedStateFromProps && - applyDerivedStateFromProps( - workInProgress, - updateLanes, - getDerivedStateFromProps, - current - ); nextValue.updater = classComponentUpdater; workInProgress.stateNode = nextValue; nextValue._reactInternals = workInProgress; @@ -7470,11 +7478,11 @@ beginWork$1 = function(current, workInProgress, renderLanes) { updateLanes = workInProgress.type._context; nextValue = workInProgress.pendingProps; hasContext = workInProgress.memoizedProps; - getDerivedStateFromProps = nextValue.value; + var newValue = nextValue.value; push(valueCursor, updateLanes._currentValue); - updateLanes._currentValue = getDerivedStateFromProps; + updateLanes._currentValue = newValue; if (null !== hasContext) - if (objectIs(hasContext.value, getDerivedStateFromProps)) { + if (objectIs(hasContext.value, newValue)) { if ( hasContext.children === nextValue.children && !didPerformWorkStackCursor.current @@ -7488,25 +7496,24 @@ beginWork$1 = function(current, workInProgress, renderLanes) { } } else for ( - getDerivedStateFromProps = workInProgress.child, - null !== getDerivedStateFromProps && - (getDerivedStateFromProps.return = workInProgress); - null !== getDerivedStateFromProps; + newValue = workInProgress.child, + null !== newValue && (newValue.return = workInProgress); + null !== newValue; ) { - var list = getDerivedStateFromProps.dependencies; + var list = newValue.dependencies; if (null !== list) { - hasContext = getDerivedStateFromProps.child; + hasContext = newValue.child; for ( var dependency = list.firstContext; null !== dependency; ) { if (dependency.context === updateLanes) { - if (1 === getDerivedStateFromProps.tag) { + if (1 === newValue.tag) { dependency = createUpdate(-1, renderLanes & -renderLanes); dependency.tag = 2; - var updateQueue = getDerivedStateFromProps.updateQueue; + var updateQueue = newValue.updateQueue; if (null !== updateQueue) { updateQueue = updateQueue.shared; var pending = updateQueue.pending; @@ -7517,13 +7524,10 @@ beginWork$1 = function(current, workInProgress, renderLanes) { updateQueue.pending = dependency; } } - getDerivedStateFromProps.lanes |= renderLanes; - dependency = getDerivedStateFromProps.alternate; + newValue.lanes |= renderLanes; + dependency = newValue.alternate; null !== dependency && (dependency.lanes |= renderLanes); - scheduleWorkOnParentPath( - getDerivedStateFromProps.return, - renderLanes - ); + scheduleWorkOnParentPath(newValue.return, renderLanes); list.lanes |= renderLanes; break; } @@ -7531,32 +7535,27 @@ beginWork$1 = function(current, workInProgress, renderLanes) { } } else hasContext = - 10 === getDerivedStateFromProps.tag - ? getDerivedStateFromProps.type === workInProgress.type + 10 === newValue.tag + ? newValue.type === workInProgress.type ? null - : getDerivedStateFromProps.child - : getDerivedStateFromProps.child; - if (null !== hasContext) - hasContext.return = getDerivedStateFromProps; + : newValue.child + : newValue.child; + if (null !== hasContext) hasContext.return = newValue; else - for ( - hasContext = getDerivedStateFromProps; - null !== hasContext; - - ) { + for (hasContext = newValue; null !== hasContext; ) { if (hasContext === workInProgress) { hasContext = null; break; } - getDerivedStateFromProps = hasContext.sibling; - if (null !== getDerivedStateFromProps) { - getDerivedStateFromProps.return = hasContext.return; - hasContext = getDerivedStateFromProps; + newValue = hasContext.sibling; + if (null !== newValue) { + newValue.return = hasContext.return; + hasContext = newValue; break; } hasContext = hasContext.return; } - getDerivedStateFromProps = hasContext; + newValue = hasContext; } reconcileChildren( current, @@ -7695,7 +7694,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 262144; + workInProgress.flags = current.flags & 1835008; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -7966,7 +7965,7 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_984 = { + devToolsConfig$jscomp$inline_985 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, version: "17.0.3", @@ -7984,11 +7983,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1234 = { - bundleType: devToolsConfig$jscomp$inline_984.bundleType, - version: devToolsConfig$jscomp$inline_984.version, - rendererPackageName: devToolsConfig$jscomp$inline_984.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_984.rendererConfig, +var internals$jscomp$inline_1238 = { + bundleType: devToolsConfig$jscomp$inline_985.bundleType, + version: devToolsConfig$jscomp$inline_985.version, + rendererPackageName: devToolsConfig$jscomp$inline_985.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_985.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8003,25 +8002,26 @@ var internals$jscomp$inline_1234 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_984.findFiberByHostInstance || + devToolsConfig$jscomp$inline_985.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, - getCurrentFiber: null + getCurrentFiber: null, + reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1235 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1239 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1235.isDisabled && - hook$jscomp$inline_1235.supportsFiber + !hook$jscomp$inline_1239.isDisabled && + hook$jscomp$inline_1239.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1235.inject( - internals$jscomp$inline_1234 + (rendererID = hook$jscomp$inline_1239.inject( + internals$jscomp$inline_1238 )), - (injectedHook = hook$jscomp$inline_1235); + (injectedHook = hook$jscomp$inline_1239); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index d46043b8138766..d809588b6b1fd1 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<1a7d2241ef385ad3a6cbcb1476a22147>> + * @generated SignedSource<> */ "use strict"; @@ -63,7 +63,8 @@ function invokeGuardedCallbackAndCatchFirstError( hasRethrowError || ((hasRethrowError = !0), (rethrowError = error)); } } -var getFiberCurrentPropsFromNode = null, +var isArrayImpl = Array.isArray, + getFiberCurrentPropsFromNode = null, getInstanceFromNode = null, getNodeFromInstance = null; function executeDispatch(event, listener, inst) { @@ -75,7 +76,7 @@ function executeDispatch(event, listener, inst) { function executeDirectDispatch(event) { var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - if (Array.isArray(dispatchListener)) + if (isArrayImpl(dispatchListener)) throw Error("executeDirectDispatch(...): Invalid `event`."); event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) @@ -336,9 +337,9 @@ function accumulate(current, next) { ); return null == current ? next - : Array.isArray(current) + : isArrayImpl(current) ? current.concat(next) - : Array.isArray(next) + : isArrayImpl(next) ? [current].concat(next) : [current, next]; } @@ -348,12 +349,12 @@ function accumulateInto(current, next) { "accumulateInto(...): Accumulated items must not be null or undefined." ); if (null == current) return next; - if (Array.isArray(current)) { - if (Array.isArray(next)) return current.push.apply(current, next), current; + if (isArrayImpl(current)) { + if (isArrayImpl(next)) return current.push.apply(current, next), current; current.push(next); return current; } - return Array.isArray(next) ? [current].concat(next) : [current, next]; + return isArrayImpl(next) ? [current].concat(next) : [current, next]; } function forEachAccumulated(arr, cb, scope) { Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); @@ -579,7 +580,7 @@ var ResponderEventPlugin = { b: { JSCompiler_temp = shouldSetEventType._dispatchListeners; targetInst = shouldSetEventType._dispatchInstances; - if (Array.isArray(JSCompiler_temp)) + if (isArrayImpl(JSCompiler_temp)) for ( depthA = 0; depthA < JSCompiler_temp.length && @@ -930,7 +931,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_223 = { +var injectedNamesToPlugins$jscomp$inline_224 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -965,34 +966,34 @@ var injectedNamesToPlugins$jscomp$inline_223 = { } } }, - isOrderingDirty$jscomp$inline_224 = !1, - pluginName$jscomp$inline_225; -for (pluginName$jscomp$inline_225 in injectedNamesToPlugins$jscomp$inline_223) + isOrderingDirty$jscomp$inline_225 = !1, + pluginName$jscomp$inline_226; +for (pluginName$jscomp$inline_226 in injectedNamesToPlugins$jscomp$inline_224) if ( - injectedNamesToPlugins$jscomp$inline_223.hasOwnProperty( - pluginName$jscomp$inline_225 + injectedNamesToPlugins$jscomp$inline_224.hasOwnProperty( + pluginName$jscomp$inline_226 ) ) { - var pluginModule$jscomp$inline_226 = - injectedNamesToPlugins$jscomp$inline_223[pluginName$jscomp$inline_225]; + var pluginModule$jscomp$inline_227 = + injectedNamesToPlugins$jscomp$inline_224[pluginName$jscomp$inline_226]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_225) || - namesToPlugins[pluginName$jscomp$inline_225] !== - pluginModule$jscomp$inline_226 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_226) || + namesToPlugins[pluginName$jscomp$inline_226] !== + pluginModule$jscomp$inline_227 ) { - if (namesToPlugins[pluginName$jscomp$inline_225]) + if (namesToPlugins[pluginName$jscomp$inline_226]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_225 + + pluginName$jscomp$inline_226 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_225 - ] = pluginModule$jscomp$inline_226; - isOrderingDirty$jscomp$inline_224 = !0; + pluginName$jscomp$inline_226 + ] = pluginModule$jscomp$inline_227; + isOrderingDirty$jscomp$inline_225 = !0; } } -isOrderingDirty$jscomp$inline_224 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_225 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -1016,7 +1017,7 @@ function executeDispatchesAndReleaseTopLevel(e) { if (e) { var dispatchListeners = e._dispatchListeners, dispatchInstances = e._dispatchInstances; - if (Array.isArray(dispatchListeners)) + if (isArrayImpl(dispatchListeners)) for ( var i = 0; i < dispatchListeners.length && !e.isPropagationStopped(); @@ -1417,7 +1418,7 @@ function restoreDeletedValuesInNestedArray( node, validAttributes ) { - if (Array.isArray(node)) + if (isArrayImpl(node)) for (var i = node.length; i-- && 0 < removedKeyCount; ) restoreDeletedValuesInNestedArray( updatePayload, @@ -1463,9 +1464,9 @@ function diffNestedProperty( : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload; - if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) + if (!isArrayImpl(prevProp) && !isArrayImpl(nextProp)) return diffProperties(updatePayload, prevProp, nextProp, validAttributes); - if (Array.isArray(prevProp) && Array.isArray(nextProp)) { + if (isArrayImpl(prevProp) && isArrayImpl(nextProp)) { var minLength = prevProp.length < nextProp.length ? prevProp.length : nextProp.length, i; @@ -1490,7 +1491,7 @@ function diffNestedProperty( ); return updatePayload; } - return Array.isArray(prevProp) + return isArrayImpl(prevProp) ? diffProperties( updatePayload, ReactNativePrivateInterface.flattenStyle(prevProp), @@ -1506,7 +1507,7 @@ function diffNestedProperty( } function addNestedProperty(updatePayload, nextProp, validAttributes) { if (!nextProp) return updatePayload; - if (!Array.isArray(nextProp)) + if (!isArrayImpl(nextProp)) return diffProperties( updatePayload, emptyObject, @@ -1523,7 +1524,7 @@ function addNestedProperty(updatePayload, nextProp, validAttributes) { } function clearNestedProperty(updatePayload, prevProp, validAttributes) { if (!prevProp) return updatePayload; - if (!Array.isArray(prevProp)) + if (!isArrayImpl(prevProp)) return diffProperties( updatePayload, prevProp, @@ -1687,7 +1688,54 @@ var ReactNativeFiberHostComponent = (function() { }; return ReactNativeFiberHostComponent; })(), - nextTransitionLane = 64, + scheduleCallback = Scheduler.unstable_scheduleCallback, + cancelCallback = Scheduler.unstable_cancelCallback, + shouldYield = Scheduler.unstable_shouldYield, + requestPaint = Scheduler.unstable_requestPaint, + now = Scheduler.unstable_now, + ImmediatePriority = Scheduler.unstable_ImmediatePriority, + UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + NormalPriority = Scheduler.unstable_NormalPriority, + IdlePriority = Scheduler.unstable_IdlePriority; +if ( + null == tracing.__interactionsRef || + null == tracing.__interactionsRef.current +) + throw Error( + "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" + ); +var rendererID = null, + injectedHook = null, + isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; +function onCommitRoot(root, eventPriority) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (root.current.flags & 128); + switch (eventPriority) { + case 1: + var schedulerPriority = ImmediatePriority; + break; + case 4: + schedulerPriority = UserBlockingPriority; + break; + case 16: + schedulerPriority = NormalPriority; + break; + case 536870912: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) {} +} +var nextTransitionLane = 64, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { switch (lanes & -lanes) { @@ -1931,7 +1979,8 @@ function describeFunctionComponentFrame(fn, source) { ? describeComponentFrame(fn.displayName || fn.name || null, source, null) : ""; } -var valueStack = [], +var hasOwnProperty = Object.prototype.hasOwnProperty, + valueStack = [], index = -1; function createCursor(defaultValue) { return { current: defaultValue }; @@ -2027,53 +2076,6 @@ function invalidateContextProvider(workInProgress, type, didChange) { : pop(didPerformWorkStackCursor); push(didPerformWorkStackCursor, didChange); } -var scheduleCallback = Scheduler.unstable_scheduleCallback, - cancelCallback = Scheduler.unstable_cancelCallback, - shouldYield = Scheduler.unstable_shouldYield, - requestPaint = Scheduler.unstable_requestPaint, - now = Scheduler.unstable_now, - ImmediatePriority = Scheduler.unstable_ImmediatePriority, - UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, - NormalPriority = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority; -if ( - null == tracing.__interactionsRef || - null == tracing.__interactionsRef.current -) - throw Error( - "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" - ); -var rendererID = null, - injectedHook = null, - isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; -function onCommitRoot(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case 1: - var schedulerPriority = ImmediatePriority; - break; - case 4: - schedulerPriority = UserBlockingPriority; - break; - case 16: - schedulerPriority = NormalPriority; - break; - case 536870912: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) {} -} var syncQueue = null, isFlushingSyncQueue = !1; function flushSyncCallbackQueue() { @@ -2104,8 +2106,7 @@ var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } -var objectIs = "function" === typeof Object.is ? Object.is : is, - hasOwnProperty = Object.prototype.hasOwnProperty; +var objectIs = "function" === typeof Object.is ? Object.is : is; function shallowEqual(objA, objB) { if (objectIs(objA, objB)) return !0; if ( @@ -2610,7 +2611,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { ? previousContext : contextStackCursor.current), (instance.context = getMaskedContext(workInProgress, contextType))); - processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; contextType = ctor.getDerivedStateFromProps; "function" === typeof contextType && @@ -2632,7 +2632,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4); } -var isArray = Array.isArray; function coerceRef(returnFiber, current, element) { returnFiber = element.ref; if ( @@ -2685,15 +2684,14 @@ function coerceRef(returnFiber, current, element) { return returnFiber; } function throwOnInvalidObjectType(returnFiber, newChild) { - if ("textarea" !== returnFiber.type) - throw ((returnFiber = Object.prototype.toString.call(newChild)), - Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - )); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." + ); } function ChildReconciler(shouldTrackSideEffects) { function deleteChild(returnFiber, childToDelete) { @@ -2855,7 +2853,7 @@ function ChildReconciler(shouldTrackSideEffects) { newChild ); } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( (newChild = createFiberFromFragment( newChild, @@ -2887,7 +2885,7 @@ function ChildReconciler(shouldTrackSideEffects) { ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null; } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null); @@ -2926,7 +2924,7 @@ function ChildReconciler(shouldTrackSideEffects) { updatePortal(returnFiber, existingChildren, newChild, lanes) ); } - if (isArray(newChild) || getIteratorFn(newChild)) + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( (existingChildren = existingChildren.get(newIdx) || null), updateFragment(returnFiber, existingChildren, newChild, lanes, null) @@ -3109,20 +3107,19 @@ function ChildReconciler(shouldTrackSideEffects) { newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key; isUnkeyedTopLevelFragment && (newChild = newChild.props.children); - var isObject = "object" === typeof newChild && null !== newChild; - if (isObject) + if ("object" === typeof newChild && null !== newChild) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: a: { - isObject = newChild.key; + var key = newChild.key; for ( isUnkeyedTopLevelFragment = currentFirstChild; null !== isUnkeyedTopLevelFragment; ) { - if (isUnkeyedTopLevelFragment.key === isObject) { - isObject = newChild.type; - if (isObject === REACT_FRAGMENT_TYPE) { + if (isUnkeyedTopLevelFragment.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { if (7 === isUnkeyedTopLevelFragment.tag) { deleteRemainingChildren( returnFiber, @@ -3136,7 +3133,7 @@ function ChildReconciler(shouldTrackSideEffects) { returnFiber = currentFirstChild; break a; } - } else if (isUnkeyedTopLevelFragment.elementType === isObject) { + } else if (isUnkeyedTopLevelFragment.elementType === key) { deleteRemainingChildren( returnFiber, isUnkeyedTopLevelFragment.sibling @@ -3228,6 +3225,22 @@ function ChildReconciler(shouldTrackSideEffects) { } return placeSingleChild(returnFiber); } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } if ("string" === typeof newChild || "number" === typeof newChild) return ( (newChild = "" + newChild), @@ -3246,21 +3259,6 @@ function ChildReconciler(shouldTrackSideEffects) { (returnFiber = currentFirstChild)), placeSingleChild(returnFiber) ); - if (isArray(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - isObject && throwOnInvalidObjectType(returnFiber, newChild); if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment) switch (returnFiber.tag) { case 1: @@ -3725,7 +3723,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { hook.memoizedState = pushEffect(1 | hookFlags, create, destroy, deps); } function mountEffect(create, deps) { - return mountEffectImpl(263168, 4, create, deps); + return mountEffectImpl(1049600, 4, create, deps); } function updateEffect(create, deps) { return updateEffectImpl(1024, 4, create, deps); @@ -4749,7 +4747,7 @@ function updateSuspenseFallbackChildren( (primaryChildren.treeBaseDuration = current.treeBaseDuration)), (workInProgress.deletions = null)) : ((primaryChildren = createWorkInProgress(current, primaryChildProps)), - (primaryChildren.subtreeFlags = current.subtreeFlags & 262144)); + (primaryChildren.subtreeFlags = current.subtreeFlags & 1835008)); null !== currentFallbackChildFragment ? (fallbackChildren = createWorkInProgress( currentFallbackChildFragment, @@ -4951,14 +4949,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$63 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$63 = lastTailNode), + for (var lastTailNode$65 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$65 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$63 + null === lastTailNode$65 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$63.sibling = null); + : (lastTailNode$65.sibling = null); } } function bubbleProperties(completedWork) { @@ -4970,53 +4968,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$65 = completedWork.selfBaseDuration, - child$66 = completedWork.child; - null !== child$66; + var treeBaseDuration$67 = completedWork.selfBaseDuration, + child$68 = completedWork.child; + null !== child$68; ) - (newChildLanes |= child$66.lanes | child$66.childLanes), - (subtreeFlags |= child$66.subtreeFlags & 262144), - (subtreeFlags |= child$66.flags & 262144), - (treeBaseDuration$65 += child$66.treeBaseDuration), - (child$66 = child$66.sibling); - completedWork.treeBaseDuration = treeBaseDuration$65; + (newChildLanes |= child$68.lanes | child$68.childLanes), + (subtreeFlags |= child$68.subtreeFlags & 1835008), + (subtreeFlags |= child$68.flags & 1835008), + (treeBaseDuration$67 += child$68.treeBaseDuration), + (child$68 = child$68.sibling); + completedWork.treeBaseDuration = treeBaseDuration$67; } else for ( - treeBaseDuration$65 = completedWork.child; - null !== treeBaseDuration$65; + treeBaseDuration$67 = completedWork.child; + null !== treeBaseDuration$67; ) (newChildLanes |= - treeBaseDuration$65.lanes | treeBaseDuration$65.childLanes), - (subtreeFlags |= treeBaseDuration$65.subtreeFlags & 262144), - (subtreeFlags |= treeBaseDuration$65.flags & 262144), - (treeBaseDuration$65.return = completedWork), - (treeBaseDuration$65 = treeBaseDuration$65.sibling); + treeBaseDuration$67.lanes | treeBaseDuration$67.childLanes), + (subtreeFlags |= treeBaseDuration$67.subtreeFlags & 1835008), + (subtreeFlags |= treeBaseDuration$67.flags & 1835008), + (treeBaseDuration$67.return = completedWork), + (treeBaseDuration$67 = treeBaseDuration$67.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$65 = completedWork.actualDuration; - child$66 = completedWork.selfBaseDuration; + treeBaseDuration$67 = completedWork.actualDuration; + child$68 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$65 += child.actualDuration), - (child$66 += child.treeBaseDuration), + (treeBaseDuration$67 += child.actualDuration), + (child$68 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$65; - completedWork.treeBaseDuration = child$66; + completedWork.actualDuration = treeBaseDuration$67; + completedWork.treeBaseDuration = child$68; } else for ( - treeBaseDuration$65 = completedWork.child; - null !== treeBaseDuration$65; + treeBaseDuration$67 = completedWork.child; + null !== treeBaseDuration$67; ) (newChildLanes |= - treeBaseDuration$65.lanes | treeBaseDuration$65.childLanes), - (subtreeFlags |= treeBaseDuration$65.subtreeFlags), - (subtreeFlags |= treeBaseDuration$65.flags), - (treeBaseDuration$65.return = completedWork), - (treeBaseDuration$65 = treeBaseDuration$65.sibling); + treeBaseDuration$67.lanes | treeBaseDuration$67.childLanes), + (subtreeFlags |= treeBaseDuration$67.subtreeFlags), + (subtreeFlags |= treeBaseDuration$67.flags), + (treeBaseDuration$67.return = completedWork), + (treeBaseDuration$67 = treeBaseDuration$67.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -5228,7 +5226,7 @@ function completeWork(current, workInProgress, renderLanes) { for (newProps = workInProgress.child; null !== newProps; ) (renderLanes = newProps), (updatePayload = current), - (renderLanes.flags &= 262146), + (renderLanes.flags &= 1835010), (type = renderLanes.alternate), null === type ? ((renderLanes.childLanes = 0), @@ -5606,8 +5604,8 @@ function commitHookEffectListMount(tag, finishedWork) { var effect = (finishedWork = finishedWork.next); do { if ((effect.tag & tag) === tag) { - var create$84 = effect.create; - effect.destroy = create$84(); + var create$86 = effect.create; + effect.destroy = create$86(); } effect = effect.next; } while (effect !== finishedWork); @@ -5812,10 +5810,9 @@ function commitPlacement(finishedWork) { : insertOrAppendPlacementNode(finishedWork, parentFiber, parent); } function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag, - isHost = 5 === tag || 6 === tag; - if (isHost) - if (((node = isHost ? node.stateNode : node.stateNode.instance), before)) { + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { if ("number" === typeof parent) throw Error("Container does not support insertBefore operation"); } else @@ -5833,58 +5830,57 @@ function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { (node = node.sibling); } function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag, - isHost = 5 === tag || 6 === tag; - if (isHost) - (node = isHost ? node.stateNode : node.stateNode.instance), - before - ? ((tag = parent._children), - (isHost = tag.indexOf(node)), - 0 <= isHost - ? (tag.splice(isHost, 1), - (before = tag.indexOf(before)), - tag.splice(before, 0, node), - ReactNativePrivateInterface.UIManager.manageChildren( - parent._nativeTag, - [isHost], - [before], - [], - [], - [] - )) - : ((before = tag.indexOf(before)), - tag.splice(before, 0, node), - ReactNativePrivateInterface.UIManager.manageChildren( - parent._nativeTag, - [], - [], - ["number" === typeof node ? node : node._nativeTag], - [before], - [] - ))) - : ((before = "number" === typeof node ? node : node._nativeTag), - (tag = parent._children), - (isHost = tag.indexOf(node)), - 0 <= isHost - ? (tag.splice(isHost, 1), - tag.push(node), - ReactNativePrivateInterface.UIManager.manageChildren( - parent._nativeTag, - [isHost], - [tag.length - 1], - [], - [], - [] - )) - : (tag.push(node), - ReactNativePrivateInterface.UIManager.manageChildren( - parent._nativeTag, - [], - [], - [before], - [tag.length - 1], - [] - ))); + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { + tag = parent._children; + var index = tag.indexOf(node); + 0 <= index + ? (tag.splice(index, 1), + (before = tag.indexOf(before)), + tag.splice(before, 0, node), + ReactNativePrivateInterface.UIManager.manageChildren( + parent._nativeTag, + [index], + [before], + [], + [], + [] + )) + : ((before = tag.indexOf(before)), + tag.splice(before, 0, node), + ReactNativePrivateInterface.UIManager.manageChildren( + parent._nativeTag, + [], + [], + ["number" === typeof node ? node : node._nativeTag], + [before], + [] + )); + } else + (before = "number" === typeof node ? node : node._nativeTag), + (tag = parent._children), + (index = tag.indexOf(node)), + 0 <= index + ? (tag.splice(index, 1), + tag.push(node), + ReactNativePrivateInterface.UIManager.manageChildren( + parent._nativeTag, + [index], + [tag.length - 1], + [], + [], + [] + )) + : (tag.push(node), + ReactNativePrivateInterface.UIManager.manageChildren( + parent._nativeTag, + [], + [], + [before], + [tag.length - 1], + [] + )); else if (4 !== tag && ((node = node.child), null !== node)) for ( insertOrAppendPlacementNode(node, before, parent), node = node.sibling; @@ -6210,8 +6206,8 @@ function commitLayoutEffects(finishedWork, root) { commitUpdateQueue(fiber$jscomp$0, updateQueue, instance); break; case 3: - var updateQueue$85 = fiber$jscomp$0.updateQueue; - if (null !== updateQueue$85) { + var updateQueue$87 = fiber$jscomp$0.updateQueue; + if (null !== updateQueue$87) { finishedRoot = null; if (null !== fiber$jscomp$0.child) switch (fiber$jscomp$0.child.tag) { @@ -6223,7 +6219,7 @@ function commitLayoutEffects(finishedWork, root) { } commitUpdateQueue( fiber$jscomp$0, - updateQueue$85, + updateQueue$87, finishedRoot ); } @@ -6236,7 +6232,7 @@ function commitLayoutEffects(finishedWork, root) { break; case 12: var onRender = fiber$jscomp$0.memoizedProps.onRender, - commitTime$88 = commitTime; + commitTime$90 = commitTime; current = null === current ? "mount" : "update"; "function" === typeof onRender && onRender( @@ -6245,7 +6241,7 @@ function commitLayoutEffects(finishedWork, root) { fiber$jscomp$0.actualDuration, fiber$jscomp$0.treeBaseDuration, fiber$jscomp$0.actualStartTime, - commitTime$88, + commitTime$90, finishedRoot.memoizedInteractions ); break; @@ -6304,6 +6300,7 @@ function commitLayoutEffects(finishedWork, root) { var ceil = Math.ceil, ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, executionContext = 0, workInProgressRoot = null, workInProgress = null, @@ -6764,15 +6761,15 @@ function handleError(root$jscomp$0, thrownValue) { } var hasInvisibleParentBoundary = 0 !== (suspenseStackCursor.current & 1), - workInProgress$79 = returnFiber; + workInProgress$81 = returnFiber; do { var JSCompiler_temp; - if ((JSCompiler_temp = 13 === workInProgress$79.tag)) { - var nextState = workInProgress$79.memoizedState; + if ((JSCompiler_temp = 13 === workInProgress$81.tag)) { + var nextState = workInProgress$81.memoizedState; if (null !== nextState) JSCompiler_temp = null !== nextState.dehydrated ? !0 : !1; else { - var props = workInProgress$79.memoizedProps; + var props = workInProgress$81.memoizedProps; JSCompiler_temp = void 0 === props.fallback ? !1 @@ -6784,17 +6781,17 @@ function handleError(root$jscomp$0, thrownValue) { } } if (JSCompiler_temp) { - var wakeables = workInProgress$79.updateQueue; + var wakeables = workInProgress$81.updateQueue; if (null === wakeables) { var updateQueue = new Set(); updateQueue.add(wakeable); - workInProgress$79.updateQueue = updateQueue; + workInProgress$81.updateQueue = updateQueue; } else wakeables.add(wakeable); if ( - 0 === (workInProgress$79.mode & 1) && - workInProgress$79 !== returnFiber + 0 === (workInProgress$81.mode & 1) && + workInProgress$81 !== returnFiber ) { - workInProgress$79.flags |= 128; + workInProgress$81.flags |= 128; sourceFiber.flags |= 32768; sourceFiber.flags &= -10053; if (1 === sourceFiber.tag) @@ -6827,12 +6824,12 @@ function handleError(root$jscomp$0, thrownValue) { ); wakeable.then(ping, ping); } - workInProgress$79.flags |= 16384; - workInProgress$79.lanes = thrownValue; + workInProgress$81.flags |= 16384; + workInProgress$81.lanes = thrownValue; break a; } - workInProgress$79 = workInProgress$79.return; - } while (null !== workInProgress$79); + workInProgress$81 = workInProgress$81.return; + } while (null !== workInProgress$81); value = Error( (getComponentNameFromFiber(sourceFiber) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." @@ -6841,47 +6838,47 @@ function handleError(root$jscomp$0, thrownValue) { 5 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); value = createCapturedValue(value, sourceFiber); - workInProgress$79 = returnFiber; + workInProgress$81 = returnFiber; do { - switch (workInProgress$79.tag) { + switch (workInProgress$81.tag) { case 3: root = value; - workInProgress$79.flags |= 16384; + workInProgress$81.flags |= 16384; thrownValue &= -thrownValue; - workInProgress$79.lanes |= thrownValue; - var update$80 = createRootErrorUpdate( - workInProgress$79, + workInProgress$81.lanes |= thrownValue; + var update$82 = createRootErrorUpdate( + workInProgress$81, root, thrownValue ); - enqueueCapturedUpdate(workInProgress$79, update$80); + enqueueCapturedUpdate(workInProgress$81, update$82); break a; case 1: root = value; - var ctor = workInProgress$79.type, - instance = workInProgress$79.stateNode; + var ctor = workInProgress$81.type, + instance = workInProgress$81.stateNode; if ( - 0 === (workInProgress$79.flags & 128) && + 0 === (workInProgress$81.flags & 128) && ("function" === typeof ctor.getDerivedStateFromError || (null !== instance && "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) ) { - workInProgress$79.flags |= 16384; + workInProgress$81.flags |= 16384; thrownValue &= -thrownValue; - workInProgress$79.lanes |= thrownValue; - var update$83 = createClassErrorUpdate( - workInProgress$79, + workInProgress$81.lanes |= thrownValue; + var update$85 = createClassErrorUpdate( + workInProgress$81, root, thrownValue ); - enqueueCapturedUpdate(workInProgress$79, update$83); + enqueueCapturedUpdate(workInProgress$81, update$85); break a; } } - workInProgress$79 = workInProgress$79.return; - } while (null !== workInProgress$79); + workInProgress$81 = workInProgress$81.return; + } while (null !== workInProgress$81); } completeUnitOfWork(erroredWork); } catch (yetAnotherThrownValue) { @@ -7000,12 +6997,15 @@ function completeUnitOfWork(unitOfWork) { 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } function commitRoot(root) { - var previousUpdateLanePriority = currentUpdatePriority; + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig$2.transition; try { - (currentUpdatePriority = 1), + (ReactCurrentBatchConfig$2.transition = 0), + (currentUpdatePriority = 1), commitRootImpl(root, previousUpdateLanePriority); } finally { - currentUpdatePriority = previousUpdateLanePriority; + (ReactCurrentBatchConfig$2.transition = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); } return null; } @@ -7040,7 +7040,9 @@ function commitRootImpl(root, renderPriorityLevel) { })); remainingLanes = 0 !== (finishedWork.flags & 8054); if (0 !== (finishedWork.subtreeFlags & 8054) || remainingLanes) { - remainingLanes = currentUpdatePriority; + remainingLanes = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = 0; + var previousPriority = currentUpdatePriority; currentUpdatePriority = 1; var prevExecutionContext = executionContext; executionContext |= 16; @@ -7054,27 +7056,31 @@ function commitRootImpl(root, renderPriorityLevel) { requestPaint(); tracing.__interactionsRef.current = prevInteractions; executionContext = prevExecutionContext; - currentUpdatePriority = remainingLanes; + currentUpdatePriority = previousPriority; + ReactCurrentBatchConfig$2.transition = remainingLanes; } else (root.current = finishedWork), (commitTime = now$1()); - if ((prevExecutionContext = rootDoesHavePassiveEffects)) + if ((previousPriority = rootDoesHavePassiveEffects)) (rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes); remainingLanes = root.pendingLanes; if (0 !== remainingLanes) { - if (null !== spawnedWorkDuringRender) { - prevInteractions = spawnedWorkDuringRender; - spawnedWorkDuringRender = null; - for (var i = 0; i < prevInteractions.length; i++) + if (null !== spawnedWorkDuringRender) + for ( + prevExecutionContext = spawnedWorkDuringRender, + spawnedWorkDuringRender = null, + prevInteractions = 0; + prevInteractions < prevExecutionContext.length; + prevInteractions++ + ) scheduleInteractions( root, - prevInteractions[i], + prevExecutionContext[prevInteractions], root.memoizedInteractions ); - } schedulePendingInteractions(root, remainingLanes); } else legacyErrorBoundariesThatAlreadyFailed = null; - prevExecutionContext || finishPendingInteractions(root, lanes); + previousPriority || finishPendingInteractions(root, lanes); 0 !== (remainingLanes & 1) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -7088,19 +7094,24 @@ function commitRootImpl(root, renderPriorityLevel) { (firstUncaughtError = null), root); if (0 !== (executionContext & 4)) return null; + 0 !== (pendingPassiveEffectsLanes & 1) && + 0 !== root.tag && + flushPassiveEffects(); flushSyncCallbackQueue(); return null; } function flushPassiveEffects() { - if (0 !== pendingPassiveEffectsLanes) { - var b = lanesToEventPriority(pendingPassiveEffectsLanes), + if (null !== rootWithPendingPassiveEffects) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$2.transition, previousPriority = currentUpdatePriority; try { - currentUpdatePriority = 16 < b ? 16 : b; + ReactCurrentBatchConfig$2.transition = 0; + currentUpdatePriority = 16 > renderPriority ? 16 : renderPriority; if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1; else { - b = rootWithPendingPassiveEffects; + renderPriority = rootWithPendingPassiveEffects; var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; @@ -7108,8 +7119,8 @@ function flushPassiveEffects() { throw Error("Cannot flush passive effects while already rendering."); var prevExecutionContext = executionContext; executionContext |= 16; - var prevInteractions = pushInteractions(b); - for (nextEffect = b.current; null !== nextEffect; ) { + var prevInteractions = pushInteractions(renderPriority); + for (nextEffect = renderPriority.current; null !== nextEffect; ) { var fiber = nextEffect, child = fiber.child; if (0 !== (nextEffect.flags & 16)) { @@ -7184,7 +7195,7 @@ function flushPassiveEffects() { nextEffect = fiber.return; } } - var finishedWork = b.current; + var finishedWork = renderPriority.current; for (nextEffect = finishedWork; null !== nextEffect; ) { child = nextEffect; var firstChild = child.child; @@ -7218,14 +7229,22 @@ function flushPassiveEffects() { } } tracing.__interactionsRef.current = prevInteractions; - finishPendingInteractions(b, lanes); + finishPendingInteractions(renderPriority, lanes); executionContext = prevExecutionContext; flushSyncCallbackQueue(); + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} JSCompiler_inline_result = !0; } return JSCompiler_inline_result; } finally { - currentUpdatePriority = previousPriority; + (currentUpdatePriority = previousPriority), + (ReactCurrentBatchConfig$2.transition = prevTransition); } } return !1; @@ -7452,14 +7471,6 @@ beginWork$1 = function(current, workInProgress, renderLanes) { ? nextValue.state : null; initializeUpdateQueue(workInProgress); - var getDerivedStateFromProps = updateLanes.getDerivedStateFromProps; - "function" === typeof getDerivedStateFromProps && - applyDerivedStateFromProps( - workInProgress, - updateLanes, - getDerivedStateFromProps, - current - ); nextValue.updater = classComponentUpdater; workInProgress.stateNode = nextValue; nextValue._reactInternals = workInProgress; @@ -7675,11 +7686,11 @@ beginWork$1 = function(current, workInProgress, renderLanes) { updateLanes = workInProgress.type._context; nextValue = workInProgress.pendingProps; hasContext = workInProgress.memoizedProps; - getDerivedStateFromProps = nextValue.value; + var newValue = nextValue.value; push(valueCursor, updateLanes._currentValue); - updateLanes._currentValue = getDerivedStateFromProps; + updateLanes._currentValue = newValue; if (null !== hasContext) - if (objectIs(hasContext.value, getDerivedStateFromProps)) { + if (objectIs(hasContext.value, newValue)) { if ( hasContext.children === nextValue.children && !didPerformWorkStackCursor.current @@ -7693,25 +7704,24 @@ beginWork$1 = function(current, workInProgress, renderLanes) { } } else for ( - getDerivedStateFromProps = workInProgress.child, - null !== getDerivedStateFromProps && - (getDerivedStateFromProps.return = workInProgress); - null !== getDerivedStateFromProps; + newValue = workInProgress.child, + null !== newValue && (newValue.return = workInProgress); + null !== newValue; ) { - var list = getDerivedStateFromProps.dependencies; + var list = newValue.dependencies; if (null !== list) { - hasContext = getDerivedStateFromProps.child; + hasContext = newValue.child; for ( var dependency = list.firstContext; null !== dependency; ) { if (dependency.context === updateLanes) { - if (1 === getDerivedStateFromProps.tag) { + if (1 === newValue.tag) { dependency = createUpdate(-1, renderLanes & -renderLanes); dependency.tag = 2; - var updateQueue = getDerivedStateFromProps.updateQueue; + var updateQueue = newValue.updateQueue; if (null !== updateQueue) { updateQueue = updateQueue.shared; var pending = updateQueue.pending; @@ -7722,13 +7732,10 @@ beginWork$1 = function(current, workInProgress, renderLanes) { updateQueue.pending = dependency; } } - getDerivedStateFromProps.lanes |= renderLanes; - dependency = getDerivedStateFromProps.alternate; + newValue.lanes |= renderLanes; + dependency = newValue.alternate; null !== dependency && (dependency.lanes |= renderLanes); - scheduleWorkOnParentPath( - getDerivedStateFromProps.return, - renderLanes - ); + scheduleWorkOnParentPath(newValue.return, renderLanes); list.lanes |= renderLanes; break; } @@ -7736,32 +7743,27 @@ beginWork$1 = function(current, workInProgress, renderLanes) { } } else hasContext = - 10 === getDerivedStateFromProps.tag - ? getDerivedStateFromProps.type === workInProgress.type + 10 === newValue.tag + ? newValue.type === workInProgress.type ? null - : getDerivedStateFromProps.child - : getDerivedStateFromProps.child; - if (null !== hasContext) - hasContext.return = getDerivedStateFromProps; + : newValue.child + : newValue.child; + if (null !== hasContext) hasContext.return = newValue; else - for ( - hasContext = getDerivedStateFromProps; - null !== hasContext; - - ) { + for (hasContext = newValue; null !== hasContext; ) { if (hasContext === workInProgress) { hasContext = null; break; } - getDerivedStateFromProps = hasContext.sibling; - if (null !== getDerivedStateFromProps) { - getDerivedStateFromProps.return = hasContext.return; - hasContext = getDerivedStateFromProps; + newValue = hasContext.sibling; + if (null !== newValue) { + newValue.return = hasContext.return; + hasContext = newValue; break; } hasContext = hasContext.return; } - getDerivedStateFromProps = hasContext; + newValue = hasContext; } reconcileChildren( current, @@ -7928,9 +7930,9 @@ function finishPendingInteractions(root, committedLanes) { if (null !== subscriber && 0 === interaction.__count) try { subscriber.onInteractionScheduledWorkCompleted(interaction); - } catch (error$96) { + } catch (error$98) { scheduleCallback(ImmediatePriority, function() { - throw error$96; + throw error$98; }); } })); @@ -7992,7 +7994,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.deletions = null), (workInProgress.actualDuration = 0), (workInProgress.actualStartTime = -1)); - workInProgress.flags = current.flags & 262144; + workInProgress.flags = current.flags & 1835008; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -8269,7 +8271,7 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1012 = { + devToolsConfig$jscomp$inline_1013 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, version: "17.0.3", @@ -8287,11 +8289,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1275 = { - bundleType: devToolsConfig$jscomp$inline_1012.bundleType, - version: devToolsConfig$jscomp$inline_1012.version, - rendererPackageName: devToolsConfig$jscomp$inline_1012.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1012.rendererConfig, +var internals$jscomp$inline_1279 = { + bundleType: devToolsConfig$jscomp$inline_1013.bundleType, + version: devToolsConfig$jscomp$inline_1013.version, + rendererPackageName: devToolsConfig$jscomp$inline_1013.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1013.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8306,25 +8308,26 @@ var internals$jscomp$inline_1275 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1012.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1013.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, - getCurrentFiber: null + getCurrentFiber: null, + reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1276 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1280 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1276.isDisabled && - hook$jscomp$inline_1276.supportsFiber + !hook$jscomp$inline_1280.isDisabled && + hook$jscomp$inline_1280.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1276.inject( - internals$jscomp$inline_1275 + (rendererID = hook$jscomp$inline_1280.inject( + internals$jscomp$inline_1279 )), - (injectedHook = hook$jscomp$inline_1276); + (injectedHook = hook$jscomp$inline_1280); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { From 158e17f6a0c596623955e84af8d583ca1ecb6df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Tue, 20 Apr 2021 08:44:19 -0700 Subject: [PATCH 003/259] Fix incorrect warning on NativeEventEmitter when nativeModule is null Summary: Changelog: [Internal] Reviewed By: ShikaSD Differential Revision: D27881851 fbshipit-source-id: 3b1cba618a86aff1e1c7ffbc0ea5d7047713d30a --- Libraries/EventEmitter/NativeEventEmitter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/EventEmitter/NativeEventEmitter.js b/Libraries/EventEmitter/NativeEventEmitter.js index b3f7248071704a..5a00822edb4419 100644 --- a/Libraries/EventEmitter/NativeEventEmitter.js +++ b/Libraries/EventEmitter/NativeEventEmitter.js @@ -54,7 +54,7 @@ export default class NativeEventEmitter if (nativeModule && hasAddListener && hasRemoveListeners) { this._nativeModule = nativeModule; - } else { + } else if (nativeModule != null) { if (!hasAddListener) { console.warn( '`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.', From ed76719f2475860bd2b76853a5c611e320f8e958 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 20 Apr 2021 09:20:17 -0700 Subject: [PATCH 004/259] Pass hardcoded false argument to scheduled callbacks Summary: changelog: [internal] Callback function in React is expecting a boolean parameter indicating whether the callback timed out. React team is removing it, that's why we only pass in hardcoded false. Reviewed By: mdvacca Differential Revision: D27794562 fbshipit-source-id: b96a7b31560524b8f38ad3bb0dbdb3b3b32ac97b --- .../runtimescheduler/RuntimeScheduler.h | 5 ++ .../react/renderer/runtimescheduler/Task.cpp | 7 +- .../tests/RuntimeSchedulerTest.cpp | 68 ++++++++++++++++--- 3 files changed, 69 insertions(+), 11 deletions(-) diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h index ec7d0455a79fb3..5b1b65efd2f936 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h @@ -41,6 +41,11 @@ class RuntimeScheduler final { taskQueue_; RuntimeExecutor const runtimeExecutor_; std::atomic_bool shouldYield_{false}; + + /* + * Returns a time point representing the current point in time. May be called + * from multiple threads. + */ std::function now_; /* diff --git a/ReactCommon/react/renderer/runtimescheduler/Task.cpp b/ReactCommon/react/renderer/runtimescheduler/Task.cpp index 0316fa00ddfeae..066626ee0fd424 100644 --- a/ReactCommon/react/renderer/runtimescheduler/Task.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/Task.cpp @@ -33,9 +33,12 @@ void Task::cancel() { } void Task::operator()(jsi::Runtime &runtime) const { + // Cancelled task doesn't have a callback. if (callback_) { - // Cancelled task doesn't have a callback. - callback_.value().call(runtime, {}); + // Callback in JavaScript is expecting a single bool parameter. + // React team plans to remove it and it is safe to pass in + // hardcoded false value. + callback_.value().call(runtime, {false}); } } diff --git a/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp b/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp index 50e23594e0f465..a04b7955620514 100644 --- a/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp @@ -42,7 +42,8 @@ class RuntimeSchedulerTest : public testing::Test { std::make_unique(runtimeExecutor, stubNow); } - jsi::Function createHostFunctionFromLambda(std::function callback) { + jsi::Function createHostFunctionFromLambda( + std::function callback) { return jsi::Function::createFromHostFunction( *runtime_, jsi::PropNameID::forUtf8(*runtime_, ""), @@ -50,10 +51,11 @@ class RuntimeSchedulerTest : public testing::Test { [this, callback = std::move(callback)]( jsi::Runtime &, jsi::Value const &, - jsi::Value const *, + jsi::Value const *arguments, size_t) noexcept -> jsi::Value { ++hostFunctionCallCount_; - callback(); + auto didUserCallbackTimeout = arguments[0].getBool(); + callback(didUserCallbackTimeout); return jsi::Value::undefined(); }); } @@ -88,11 +90,59 @@ TEST_F(RuntimeSchedulerTest, getShouldYield) { TEST_F(RuntimeSchedulerTest, scheduleSingleTask) { bool didRunTask = false; auto callback = - createHostFunctionFromLambda([&didRunTask]() { didRunTask = true; }); + createHostFunctionFromLambda([&didRunTask](bool didUserCallbackTimeout) { + didRunTask = true; + EXPECT_FALSE(didUserCallbackTimeout); + }); + + runtimeScheduler_->scheduleTask( + SchedulerPriority::NormalPriority, std::move(callback)); + + EXPECT_FALSE(didRunTask); + EXPECT_EQ(stubQueue_->size(), 1); + + stubQueue_->tick(); + + EXPECT_TRUE(didRunTask); + EXPECT_EQ(stubQueue_->size(), 0); +} + +TEST_F(RuntimeSchedulerTest, scheduleImmediatePriorityTask) { + bool didRunTask = false; + auto callback = + createHostFunctionFromLambda([&didRunTask](bool didUserCallbackTimeout) { + didRunTask = true; + EXPECT_FALSE(didUserCallbackTimeout); + }); + + runtimeScheduler_->scheduleTask( + SchedulerPriority::ImmediatePriority, std::move(callback)); + + EXPECT_FALSE(didRunTask); + EXPECT_EQ(stubQueue_->size(), 1); + + stubQueue_->tick(); + + EXPECT_TRUE(didRunTask); + EXPECT_EQ(stubQueue_->size(), 0); +} + +TEST_F(RuntimeSchedulerTest, taskExpiration) { + bool didRunTask = false; + auto callback = + createHostFunctionFromLambda([&didRunTask](bool didUserCallbackTimeout) { + didRunTask = true; + // Task has timed out but the parameter is deprecated and `false` is + // hardcoded. + EXPECT_FALSE(didUserCallbackTimeout); + }); runtimeScheduler_->scheduleTask( SchedulerPriority::NormalPriority, std::move(callback)); + // Task with normal priority has 5s timeout. + stubClock_->advanceTimeBy(6s); + EXPECT_FALSE(didRunTask); EXPECT_EQ(stubQueue_->size(), 1); @@ -105,7 +155,7 @@ TEST_F(RuntimeSchedulerTest, scheduleSingleTask) { TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithSamePriority) { uint firstTaskCallOrder; auto callbackOne = - createHostFunctionFromLambda([this, &firstTaskCallOrder]() { + createHostFunctionFromLambda([this, &firstTaskCallOrder](bool) { firstTaskCallOrder = hostFunctionCallCount_; }); @@ -114,7 +164,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithSamePriority) { uint secondTaskCallOrder; auto callbackTwo = - createHostFunctionFromLambda([this, &secondTaskCallOrder]() { + createHostFunctionFromLambda([this, &secondTaskCallOrder](bool) { secondTaskCallOrder = hostFunctionCallCount_; }); @@ -136,7 +186,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithSamePriority) { TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithDifferentPriorities) { uint lowPriorityTaskCallOrder; auto callbackOne = - createHostFunctionFromLambda([this, &lowPriorityTaskCallOrder]() { + createHostFunctionFromLambda([this, &lowPriorityTaskCallOrder](bool) { lowPriorityTaskCallOrder = hostFunctionCallCount_; }); @@ -145,7 +195,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithDifferentPriorities) { uint userBlockingPriorityTaskCallOrder; auto callbackTwo = createHostFunctionFromLambda( - [this, &userBlockingPriorityTaskCallOrder]() { + [this, &userBlockingPriorityTaskCallOrder](bool) { userBlockingPriorityTaskCallOrder = hostFunctionCallCount_; }); @@ -167,7 +217,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithDifferentPriorities) { TEST_F(RuntimeSchedulerTest, cancelTask) { bool didRunTask = false; auto callback = - createHostFunctionFromLambda([&didRunTask]() { didRunTask = true; }); + createHostFunctionFromLambda([&didRunTask](bool) { didRunTask = true; }); auto task = runtimeScheduler_->scheduleTask( SchedulerPriority::NormalPriority, std::move(callback)); From a8d0dd6646194d88392566c96ac35d569642c434 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 20 Apr 2021 09:20:17 -0700 Subject: [PATCH 005/259] Implement task continuation Summary: Changelog: [internal] Scheduler's callback have option to add more work inside callback. This work stays on top of the priority queue and gives React ability to flush all work synchronously if need. This diff adds use of `shouldYield_` to the workLoop. For now, it always evaluates to false. In the future when we allow access to the scheduler to native, it will allow yielding. Relevant code in JavaScript: https://github.com/facebook/react/blob/master/packages/scheduler/src/forks/SchedulerNoDOM.js#L190 Reviewed By: mdvacca Differential Revision: D27823528 fbshipit-source-id: 016101e41eb7c41c2ac5abb55f803814867b8517 --- .../runtimescheduler/RuntimeScheduler.cpp | 21 ++++++-- .../react/renderer/runtimescheduler/Task.cpp | 28 +++-------- .../react/renderer/runtimescheduler/Task.h | 25 +++++----- .../tests/RuntimeSchedulerTest.cpp | 50 +++++++++++++++++-- 4 files changed, 82 insertions(+), 42 deletions(-) diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp index 88c04c7831811a..0c1942f102cd13 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp @@ -32,8 +32,23 @@ std::shared_ptr RuntimeScheduler::scheduleTask( while (!taskQueue_.empty()) { auto topPriority = taskQueue_.top(); - taskQueue_.pop(); - (*topPriority)(runtime); + auto now = now_(); + auto didUserCallbackTimeout = topPriority->expirationTime <= now; + + if (!didUserCallbackTimeout && shouldYield_) { + // This task hasn't expired and we need to yield. + break; + } + + auto result = topPriority->execute(runtime); + + if (result.isObject() && + result.getObject(runtime).isFunction(runtime)) { + topPriority->callback = + result.getObject(runtime).getFunction(runtime); + } else { + taskQueue_.pop(); + } } }); } @@ -42,7 +57,7 @@ std::shared_ptr RuntimeScheduler::scheduleTask( } void RuntimeScheduler::cancelTask(const std::shared_ptr &task) { - task->cancel(); + task->callback.reset(); } bool RuntimeScheduler::getShouldYield() const { diff --git a/ReactCommon/react/renderer/runtimescheduler/Task.cpp b/ReactCommon/react/renderer/runtimescheduler/Task.cpp index 066626ee0fd424..c0d9b2f1671e16 100644 --- a/ReactCommon/react/renderer/runtimescheduler/Task.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/Task.cpp @@ -13,33 +13,19 @@ Task::Task( SchedulerPriority priority, jsi::Function callback, std::chrono::steady_clock::time_point expirationTime) - : priority_(priority), - callback_(std::move(callback)), - expirationTime_(expirationTime) {} + : priority(priority), + callback(std::move(callback)), + expirationTime(expirationTime) {} -SchedulerPriority Task::getPriority() const { - return priority_; -} - -RuntimeSchedulerClock::time_point Task::getExpirationTime() const { - return expirationTime_; -} - -void Task::cancel() { - // Null out the callback to indicate the task has been canceled. (Can't - // remove from the priority_queue because you can't remove arbitrary nodes - // from an array based heap, only the first one.) - callback_.reset(); -} - -void Task::operator()(jsi::Runtime &runtime) const { +jsi::Value Task::execute(jsi::Runtime &runtime) const { // Cancelled task doesn't have a callback. - if (callback_) { + if (callback) { // Callback in JavaScript is expecting a single bool parameter. // React team plans to remove it and it is safe to pass in // hardcoded false value. - callback_.value().call(runtime, {false}); + return callback.value().call(runtime, {false}); } + return jsi::Value::undefined(); } } // namespace facebook::react diff --git a/ReactCommon/react/renderer/runtimescheduler/Task.h b/ReactCommon/react/renderer/runtimescheduler/Task.h index 2c750d7af4d925..0d97ea8e80b2f9 100644 --- a/ReactCommon/react/renderer/runtimescheduler/Task.h +++ b/ReactCommon/react/renderer/runtimescheduler/Task.h @@ -14,25 +14,24 @@ namespace facebook::react { -class Task final { - public: +class RuntimeScheduler; +class TaskPriorityComparer; + +struct Task final { Task( SchedulerPriority priority, jsi::Function callback, std::chrono::steady_clock::time_point expirationTime); - SchedulerPriority getPriority() const; - - RuntimeSchedulerClock::time_point getExpirationTime() const; - - void cancel(); + private: + friend RuntimeScheduler; + friend TaskPriorityComparer; - void operator()(jsi::Runtime &runtime) const; + SchedulerPriority priority; + better::optional callback; + RuntimeSchedulerClock::time_point expirationTime; - private: - SchedulerPriority priority_; - better::optional callback_; - RuntimeSchedulerClock::time_point expirationTime_; + jsi::Value execute(jsi::Runtime &runtime) const; }; class TaskPriorityComparer { @@ -40,7 +39,7 @@ class TaskPriorityComparer { inline bool operator()( std::shared_ptr const &lhs, std::shared_ptr const &rhs) { - return lhs->getExpirationTime() > rhs->getExpirationTime(); + return lhs->expirationTime > rhs->expirationTime; } }; diff --git a/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp b/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp index a04b7955620514..412dbeb093d29c 100644 --- a/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp @@ -43,7 +43,7 @@ class RuntimeSchedulerTest : public testing::Test { } jsi::Function createHostFunctionFromLambda( - std::function callback) { + std::function callback) { return jsi::Function::createFromHostFunction( *runtime_, jsi::PropNameID::forUtf8(*runtime_, ""), @@ -55,8 +55,7 @@ class RuntimeSchedulerTest : public testing::Test { size_t) noexcept -> jsi::Value { ++hostFunctionCallCount_; auto didUserCallbackTimeout = arguments[0].getBool(); - callback(didUserCallbackTimeout); - return jsi::Value::undefined(); + return callback(didUserCallbackTimeout); }); } @@ -93,6 +92,7 @@ TEST_F(RuntimeSchedulerTest, scheduleSingleTask) { createHostFunctionFromLambda([&didRunTask](bool didUserCallbackTimeout) { didRunTask = true; EXPECT_FALSE(didUserCallbackTimeout); + return jsi::Value::undefined(); }); runtimeScheduler_->scheduleTask( @@ -113,6 +113,7 @@ TEST_F(RuntimeSchedulerTest, scheduleImmediatePriorityTask) { createHostFunctionFromLambda([&didRunTask](bool didUserCallbackTimeout) { didRunTask = true; EXPECT_FALSE(didUserCallbackTimeout); + return jsi::Value::undefined(); }); runtimeScheduler_->scheduleTask( @@ -135,6 +136,7 @@ TEST_F(RuntimeSchedulerTest, taskExpiration) { // Task has timed out but the parameter is deprecated and `false` is // hardcoded. EXPECT_FALSE(didUserCallbackTimeout); + return jsi::Value::undefined(); }); runtimeScheduler_->scheduleTask( @@ -157,6 +159,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithSamePriority) { auto callbackOne = createHostFunctionFromLambda([this, &firstTaskCallOrder](bool) { firstTaskCallOrder = hostFunctionCallCount_; + return jsi::Value::undefined(); }); runtimeScheduler_->scheduleTask( @@ -166,6 +169,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithSamePriority) { auto callbackTwo = createHostFunctionFromLambda([this, &secondTaskCallOrder](bool) { secondTaskCallOrder = hostFunctionCallCount_; + return jsi::Value::undefined(); }); runtimeScheduler_->scheduleTask( @@ -188,6 +192,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithDifferentPriorities) { auto callbackOne = createHostFunctionFromLambda([this, &lowPriorityTaskCallOrder](bool) { lowPriorityTaskCallOrder = hostFunctionCallCount_; + return jsi::Value::undefined(); }); runtimeScheduler_->scheduleTask( @@ -197,6 +202,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithDifferentPriorities) { auto callbackTwo = createHostFunctionFromLambda( [this, &userBlockingPriorityTaskCallOrder](bool) { userBlockingPriorityTaskCallOrder = hostFunctionCallCount_; + return jsi::Value::undefined(); }); runtimeScheduler_->scheduleTask( @@ -216,8 +222,10 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithDifferentPriorities) { TEST_F(RuntimeSchedulerTest, cancelTask) { bool didRunTask = false; - auto callback = - createHostFunctionFromLambda([&didRunTask](bool) { didRunTask = true; }); + auto callback = createHostFunctionFromLambda([&didRunTask](bool) { + didRunTask = true; + return jsi::Value::undefined(); + }); auto task = runtimeScheduler_->scheduleTask( SchedulerPriority::NormalPriority, std::move(callback)); @@ -233,4 +241,36 @@ TEST_F(RuntimeSchedulerTest, cancelTask) { EXPECT_EQ(stubQueue_->size(), 0); } +TEST_F(RuntimeSchedulerTest, continuationTask) { + bool didRunTask = false; + bool didContinuationTask = false; + + auto callback = createHostFunctionFromLambda([&](bool) { + didRunTask = true; + return jsi::Function::createFromHostFunction( + *runtime_, + jsi::PropNameID::forUtf8(*runtime_, ""), + 1, + [&](jsi::Runtime &runtime, + jsi::Value const &, + jsi::Value const *arguments, + size_t) noexcept -> jsi::Value { + didContinuationTask = true; + return jsi::Value::undefined(); + }); + }); + + auto task = runtimeScheduler_->scheduleTask( + SchedulerPriority::NormalPriority, std::move(callback)); + + EXPECT_FALSE(didRunTask); + EXPECT_EQ(stubQueue_->size(), 1); + + stubQueue_->tick(); + + EXPECT_TRUE(didRunTask); + EXPECT_TRUE(didContinuationTask); + EXPECT_EQ(stubQueue_->size(), 0); +} + } // namespace facebook::react From 090ab0a08d237006ed5ae29e90fd14003abd0f1a Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 20 Apr 2021 09:20:17 -0700 Subject: [PATCH 006/259] Fix typo in runtime scheduler mobile config Summary: Changelog: [internal] Fix typo in runtime scheduler mobile config. Reviewed By: mdvacca Differential Revision: D27841843 fbshipit-source-id: fa76d5f49b37fa62a4b69e8e50a883aa98864e94 --- ReactCommon/react/renderer/scheduler/Scheduler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactCommon/react/renderer/scheduler/Scheduler.cpp b/ReactCommon/react/renderer/scheduler/Scheduler.cpp index d6e12dbae5ddc3..40a37fe1c23d33 100644 --- a/ReactCommon/react/renderer/scheduler/Scheduler.cpp +++ b/ReactCommon/react/renderer/scheduler/Scheduler.cpp @@ -89,10 +89,10 @@ Scheduler::Scheduler( #ifdef ANDROID auto enableRuntimeScheduler = reactNativeConfig_->getBool( - "react_fabric:enable_runtime_scheduler_android"); + "react_fabric:enable_runtimescheduler_android"); #else auto enableRuntimeScheduler = - reactNativeConfig_->getBool("react_fabric:enable_runtime_scheduler_ios"); + reactNativeConfig_->getBool("react_fabric:enable_runtimescheduler_ios"); #endif runtimeExecutor_([=](jsi::Runtime &runtime) { From e9016f8b73e3b07987378e04fdfe9a5ade9ccb3f Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 20 Apr 2021 09:20:17 -0700 Subject: [PATCH 007/259] Handle $$typeof call in RuntimeSchedulerBinding Summary: Changelog: [internal] Explicitly return undefined for `$$typeof` inside RuntimeSchedulerBinding. React calls `$$typeof` on RuntimeScheduler. To make sure assert only triggers if unsupported value is requested, it needs to be explicitly handled Reviewed By: mdvacca Differential Revision: D27854472 fbshipit-source-id: 515c68d92b291cc274f5370c45e49302534e6f9c --- .../renderer/runtimescheduler/RuntimeSchedulerBinding.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp index 9ceebc0e1f429a..749389b9bc0857 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp @@ -154,6 +154,10 @@ jsi::Value RuntimeSchedulerBinding::get( return jsi::Value(runtime, serialize(SchedulerPriority::IdlePriority)); } + if (propertyName == "$$typeof") { + return jsi::Value::undefined(); + } + react_native_assert(false && "undefined property"); return jsi::Value::undefined(); } From 49af5e7385adb61664f98a899043684e040bf996 Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Tue, 20 Apr 2021 09:23:46 -0700 Subject: [PATCH 008/259] Create and show DatePickerDialogFragment in UI thread Summary: Fix 'An Unexpected error occurred' in Messenger Kids caused by DatePickerDialog. Changelog: [Android][Fixed] - Create and show DatePickerDialogFragment in UI thread Differential Revision: D27882121 fbshipit-source-id: 2490a8178e5986222105bfbc16e7c0de471baa02 --- .../datepicker/DatePickerDialogModule.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java index 429fca866448ca..e6971464889241 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java @@ -101,7 +101,7 @@ public void onDismiss(DialogInterface dialog) { * If the action is dismiss, year, month and date are undefined. */ @Override - public void open(@Nullable final ReadableMap options, Promise promise) { + public void open(@Nullable final ReadableMap options, final Promise promise) { Activity raw_activity = getCurrentActivity(); if (raw_activity == null || !(raw_activity instanceof FragmentActivity)) { promise.reject( @@ -112,20 +112,26 @@ public void open(@Nullable final ReadableMap options, Promise promise) { FragmentActivity activity = (FragmentActivity) raw_activity; - FragmentManager fragmentManager = activity.getSupportFragmentManager(); + final FragmentManager fragmentManager = activity.getSupportFragmentManager(); DialogFragment oldFragment = (DialogFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG); if (oldFragment != null) { oldFragment.dismiss(); } - DatePickerDialogFragment fragment = new DatePickerDialogFragment(); - if (options != null) { - final Bundle args = createFragmentArguments(options); - fragment.setArguments(args); - } - final DatePickerDialogListener listener = new DatePickerDialogListener(promise); - fragment.setOnDismissListener(listener); - fragment.setOnDateSetListener(listener); - fragment.show(fragmentManager, FRAGMENT_TAG); + activity.runOnUiThread( + new Runnable() { + @Override + public void run() { + DatePickerDialogFragment fragment = new DatePickerDialogFragment(); + if (options != null) { + final Bundle args = createFragmentArguments(options); + fragment.setArguments(args); + } + final DatePickerDialogListener listener = new DatePickerDialogListener(promise); + fragment.setOnDismissListener(listener); + fragment.setOnDateSetListener(listener); + fragment.show(fragmentManager, FRAGMENT_TAG); + } + }); } private Bundle createFragmentArguments(ReadableMap options) { From 8b5ad95a30a4250a2b5959f1cad9330dcaefbcce Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 009/259] Use explicit initial values for internal data of MapBuffer Summary: Use explicit initial values for internal data of MapBuffer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27864308 fbshipit-source-id: f90fb34735ba190b9ca96da245f3c478640eb537 --- ReactCommon/react/renderer/mapbuffer/MapBuffer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ReactCommon/react/renderer/mapbuffer/MapBuffer.h b/ReactCommon/react/renderer/mapbuffer/MapBuffer.h index ebe2c3336fde28..28962317b7d187 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +++ b/ReactCommon/react/renderer/mapbuffer/MapBuffer.h @@ -33,13 +33,13 @@ namespace react { class MapBuffer { private: // Buffer and its size - const uint8_t *data_; + const uint8_t *data_ = nullptr; // amount of bytes in the MapBuffer - uint16_t dataSize_; + uint16_t dataSize_ = 0; // amount of items in the MapBuffer - uint16_t count_; + uint16_t count_ = 0; // returns the relative offset of the first byte of dynamic data int getDynamicDataOffset() const; From 4d9973fa59840229d0015632e4ce46b430ff00c8 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 010/259] Use explicit initial values for internal data of MapBufferBuilder Summary: Use explicit initial values for internal data of MapBufferBuilder changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27864311 fbshipit-source-id: 1e861d90da5ba52dfe560630b50aa4e1e741f66c --- .../react/renderer/mapbuffer/MapBufferBuilder.cpp | 12 ++++++++++-- .../react/renderer/mapbuffer/MapBufferBuilder.h | 12 ++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp index bed8ab88d5cb29..ae2db84ff7900c 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp @@ -182,8 +182,9 @@ MapBuffer MapBufferBuilder::build() { // TODO: we should invalidate the class once the build() method is // called. - // Reset internal data - delete[] keyValues_; + if (keyValues_ != nullptr) { + delete[] keyValues_; + } keyValues_ = nullptr; keyValuesSize_ = 0; keyValuesOffset_ = 0; @@ -194,6 +195,7 @@ MapBuffer MapBufferBuilder::build() { } dynamicDataSize_ = 0; dynamicDataOffset_ = 0; + _header = {ALIGNMENT, 0, 0}; return map; } @@ -205,6 +207,12 @@ MapBufferBuilder::~MapBufferBuilder() { if (dynamicDataValues_ != nullptr) { delete[] dynamicDataValues_; } + _header = {ALIGNMENT, 0, 0}; + keyValuesSize_ = 0; + keyValuesOffset_ = 0; + dynamicDataSize_ = 0; + dynamicDataOffset_ = 0; + minKeyToStore_ = 0; } } // namespace react diff --git a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h index 31bfea181982f3..d401606f8fd58e 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +++ b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h @@ -40,26 +40,26 @@ class MapBufferBuilder { // - Value is stored into 8 bytes. The 8 bytes of the value will contain the // actual value for the key or a pointer to the actual value (based on the // type) - uint8_t *keyValues_; + uint8_t *keyValues_ = nullptr; // Amount of bytes allocated on _keyValues - uint16_t keyValuesSize_; + uint16_t keyValuesSize_ = 0; // Relative offset on the _keyValues array. // This represents the first byte that can be written in _keyValues array - int keyValuesOffset_; + int keyValuesOffset_ = 0; // This array contains data for dynamic values in the MapBuffer. // A dynamic value is a String or another MapBuffer. - uint8_t *dynamicDataValues_; + uint8_t *dynamicDataValues_ = nullptr; // Amount of bytes allocated on _dynamicDataValues - uint16_t dynamicDataSize_; + uint16_t dynamicDataSize_ = 0; // Relative offset on the _dynamicDataValues array. // This represents the first byte that can be written in _dynamicDataValues // array - int dynamicDataOffset_; + int dynamicDataOffset_ = 0; // Minimmum key to store in the MapBuffer (this is used to guarantee // consistency) From e2b9c61998a932638dd693e68bfa12e41f30114e Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 011/259] Add assertion when building MapBuffer Summary: This diff adds an assertion when trying to build a MapBuffer with invalid data changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27864309 fbshipit-source-id: 6601388e56be18ded0675f92cce009a577828c16 --- ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp index ae2db84ff7900c..2aff6f0f48ffcf 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp @@ -160,6 +160,10 @@ void MapBufferBuilder::putMapBuffer(Key key, MapBuffer &map) { } MapBuffer MapBufferBuilder::build() { + react_native_assert( + (keyValues_ != nullptr) && + "Error when building mapbuffer with invalid datastructures."); + // Create buffer: [header] + [key, values] + [dynamic data] int bufferSize = keyValuesOffset_ + dynamicDataOffset_; From 7d326a98f69a11bdedaec1c860c6d349f34f6054 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 012/259] Refactor MapBuffer::getCount Summary: EZ refactor of MapBuffer::getCount and removal of TODO changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27864307 fbshipit-source-id: 14138090b3f2b45de8e0a3941abec990edb427ed --- ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp b/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp index e923fe1143212c..5dc05247f927c6 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp @@ -130,9 +130,8 @@ uint16_t MapBuffer::getCount() const { memcpy( reinterpret_cast(&size), - reinterpret_cast( - data_ + UINT16_SIZE), // TODO refactor this: + UINT16_SIZE describes - // the position in the header + reinterpret_cast(data_ + HEADER_COUNT_OFFSET), + UINT16_SIZE); return size; From 0bb05789b2951b4172de014d3fc07f9af95c3f5d Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 013/259] Add assert in constructor of MapBuffer Summary: This diff adds an assert in the constructor of MapBuffer to ensure that we always access valid memory changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27864310 fbshipit-source-id: bd3870b6df1dbc5181fc5d852eb0ccbc32a8a951 --- ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp | 3 +++ ReactCommon/react/renderer/mapbuffer/MapBuffer.h | 1 + 2 files changed, 4 insertions(+) diff --git a/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp b/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp index 5dc05247f927c6..b9cc514943be44 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp @@ -13,6 +13,9 @@ namespace facebook { namespace react { MapBuffer::MapBuffer(uint8_t *const data, uint16_t dataSize) { + react_native_assert( + (data != nullptr) && "Error trying to build an invalid MapBuffer"); + // Should we move the memory here or document it? data_ = data; diff --git a/ReactCommon/react/renderer/mapbuffer/MapBuffer.h b/ReactCommon/react/renderer/mapbuffer/MapBuffer.h index 28962317b7d187..6d7cb4ba000dfc 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +++ b/ReactCommon/react/renderer/mapbuffer/MapBuffer.h @@ -7,6 +7,7 @@ #pragma once +#include #include #include From a32a63690996ce45a01b82537e8608acc5eafc8e Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 014/259] Fix assert in mapbufferBuilder Summary: This diff fixes an assert in mapbufferBuilder changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27864306 fbshipit-source-id: fbeb812906441c50bf51ca71566fcd6f6e494322 --- ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp index 2aff6f0f48ffcf..01db575d58710f 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp @@ -34,8 +34,8 @@ MapBufferBuilder::MapBufferBuilder(uint16_t initialSize) { void MapBufferBuilder::ensureKeyValueSpace() { int oldKeyValuesSize = keyValuesSize_; react_native_assert( - (keyValuesSize_ >= std::numeric_limits::max() / 2) && - "Error trying to assign a value beyond the capacity of uint16_t"); + (keyValuesSize_ < std::numeric_limits::max() / 2) && + "Error trying to assign a value beyond the capacity of uint16_t: "); keyValuesSize_ *= 2; uint8_t *newKeyValues = new Byte[keyValuesSize_]; uint8_t *oldKeyValues = keyValues_; From 19d881d838b38b0f3df3cad8c1419cbfe3ac4f0f Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 015/259] integrate asserts in ReadableMapBuffer Summary: This diff integrates asserts in ReadableMapBuffer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27864305 fbshipit-source-id: 0e7802a33cbf5ccfb4b845fffd14f8517bed70ec --- .../src/main/java/com/facebook/react/common/mapbuffer/jni/BUCK | 1 + .../mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/BUCK index 465b1985449232..50560598d1088f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/BUCK @@ -28,6 +28,7 @@ rn_xplat_cxx_library( visibility = ["PUBLIC"], deps = [ react_native_xplat_target("react/renderer/mapbuffer:mapbuffer"), + react_native_xplat_target("react/debug:debug"), FBJNI_TARGET, ], ) diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.h b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.h index 555851199f563c..6ead62098e0f90 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.h +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include @@ -39,6 +40,8 @@ class ReadableMapBuffer : public jni::HybridClass { explicit ReadableMapBuffer(MapBuffer &&map) { _serializedDataSize = map.getBufferSize(); + react_native_assert( + (_serializedDataSize != 0) && "Error no content in map"); _serializedData = new Byte[_serializedDataSize]; map.copy(_serializedData); } From c9a69de962a97ae9746160633700ef71c9ff803f Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 016/259] Add TODOs and Tasks into TODOs Summary: Add TODOs and Tasks into TODOs changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27865470 fbshipit-source-id: fcc7f86b0e6b290bf9f691a2dafea18d8addf782 --- .../react/renderer/mapbuffer/MapBuffer.cpp | 15 ++++++++------- ReactCommon/react/renderer/mapbuffer/MapBuffer.h | 4 ++-- .../react/renderer/mapbuffer/MapBufferBuilder.cpp | 13 +++++++------ .../react/renderer/mapbuffer/MapBufferBuilder.h | 2 +- .../renderer/mapbuffer/tests/MapBufferTest.cpp | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp b/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp index b9cc514943be44..1821b146206f07 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp @@ -25,7 +25,8 @@ MapBuffer::MapBuffer(uint8_t *const data, uint16_t dataSize) { reinterpret_cast(data_ + HEADER_COUNT_OFFSET), UINT16_SIZE); - // TODO: extract memcpy calls into an inline function to simplify the code + // TODO T83483191: extract memcpy calls into an inline function to simplify + // the code dataSize_ = 0; memcpy( reinterpret_cast(&dataSize_), @@ -53,8 +54,8 @@ bool MapBuffer::getBool(Key key) const { } double MapBuffer::getDouble(Key key) const { - // TODO: extract this code into a "template method" and reuse it for other - // types + // TODO T83483191: extract this code into a "template method" and reuse it for + // other types double value = 0; memcpy( reinterpret_cast(&value), @@ -70,8 +71,8 @@ int MapBuffer::getDynamicDataOffset() const { } std::string MapBuffer::getString(Key key) const { - // TODO Add checks to verify that offsets are under the boundaries of the map - // buffer + // TODO T83483191:Add checks to verify that offsets are under the boundaries + // of the map buffer int dynamicDataOffset = getDynamicDataOffset(); int stringLength = 0; memcpy( @@ -92,8 +93,8 @@ std::string MapBuffer::getString(Key key) const { } MapBuffer MapBuffer::getMapBuffer(Key key) const { - // TODO Add checks to verify that offsets are under the boundaries of the map - // buffer + // TODO T83483191: Add checks to verify that offsets are under the boundaries + // of the map buffer int dynamicDataOffset = getDynamicDataOffset(); uint16_t mapBufferLength = 0; diff --git a/ReactCommon/react/renderer/mapbuffer/MapBuffer.h b/ReactCommon/react/renderer/mapbuffer/MapBuffer.h index 6d7cb4ba000dfc..e64b6a1c8b957a 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +++ b/ReactCommon/react/renderer/mapbuffer/MapBuffer.h @@ -58,12 +58,12 @@ class MapBuffer { std::string getString(Key key) const; - // TODO: review this declaration + // TODO T83483191: review this declaration MapBuffer getMapBuffer(Key key) const; uint16_t getBufferSize() const; - // TODO: review parameters of copy method + // TODO T83483191: review parameters of copy method void copy(uint8_t *output) const; bool isNull(Key key) const; diff --git a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp index 01db575d58710f..29933ac68e6a34 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp @@ -12,6 +12,7 @@ using namespace facebook::react; namespace facebook { namespace react { +// TODO T83483191: Add asserts to check overflowing on additions MapBufferBuilder::MapBufferBuilder() : MapBufferBuilder::MapBufferBuilder(INITIAL_KEY_VALUE_SIZE) {} @@ -54,8 +55,8 @@ void MapBufferBuilder::storeKeyValue(Key key, uint8_t *value, int valueSize) { << valueSize; abort(); } - // TODO: header.count points to the next index - // TODO: add test to verify storage of sparse keys + // TODO T83483191: header.count points to the next index + // TODO T83483191: add test to verify storage of sparse keys int keyOffset = getKeyOffset(_header.count); int valueOffset = keyOffset + KEY_SIZE; @@ -123,8 +124,8 @@ void MapBufferBuilder::putString(Key key, std::string value) { // format [lenght of string (int)] + [Array of Characters in the string] int sizeOfLength = INT_SIZE; - // TODO : review if map.getBufferSize() should be an int or long instead of an - // int16 (because strings can be longer than int16); + // TODO T83483191: review if map.getBufferSize() should be an int or long + // instead of an int16 (because strings can be longer than int16); int sizeOfDynamicData = sizeOfLength + strLength; ensureDynamicDataSpace(sizeOfDynamicData); @@ -180,10 +181,10 @@ MapBuffer MapBufferBuilder::build() { memcpy(buffer + keyValuesOffset_, dynamicDataValues_, dynamicDataOffset_); } - // TODO: should we use std::move here? + // TODO T83483191: should we use std::move here? auto map = MapBuffer(buffer, bufferSize); - // TODO: we should invalidate the class once the build() method is + // TODO T83483191: we should invalidate the class once the build() method is // called. if (keyValues_ != nullptr) { diff --git a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h index d401606f8fd58e..1e15569edf1520 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +++ b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h @@ -86,7 +86,7 @@ class MapBufferBuilder { void putMapBuffer(Key key, MapBuffer &map); - // TODO This should return MapBuffer! + // TODO T83483191: This should return MapBuffer! MapBuffer build(); }; diff --git a/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp b/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp index cb18889cf76f7b..2578a737401db1 100644 --- a/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +++ b/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp @@ -70,7 +70,7 @@ TEST(MapBufferTest, testNullEntries) { EXPECT_EQ(map.getCount(), 2); EXPECT_EQ(map.isNull(0), true); EXPECT_EQ(map.isNull(1), false); - // TODO: serialize null values to be distinguishable from '0' values + // TODO T83483191: serialize null values to be distinguishable from '0' values // EXPECT_EQ(map.isNull(1), false); // EXPECT_EQ(map.getBool(1), false); } From 69a48ec9d42f9ebccdea7b0d80b8e3d3693ddabd Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 20 Apr 2021 12:11:25 -0700 Subject: [PATCH 017/259] Fix importByteBufferAllocateDirect method Summary: This diff fixes the importByteBufferAllocateDirect method. This was tested enabling importByteBufferAllocateDirect in ReadableMapBuffer.java changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27867055 fbshipit-source-id: 9ef5e93ff6c7903782598dde1c499daa82cd467b --- .../jni/react/common/mapbuffer/ReadableMapBuffer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.cpp b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.cpp index 8f7cac20b28179..a04dfe9583796a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.cpp @@ -26,7 +26,10 @@ ReadableMapBuffer::importByteBufferAllocateDirect() { // steps: // - Validate perf of this method vs importByteBuffer // - Validate that there's no leaking of memory - return jni::JByteBuffer::allocateDirect(_serializedDataSize); + auto ret = jni::JByteBuffer::allocateDirect(_serializedDataSize); + std::memcpy( + ret->getDirectBytes(), (void *)_serializedData, _serializedDataSize); + return ret; } jni::JByteBuffer::javaobject ReadableMapBuffer::importByteBuffer() { From d90253da36da7323d0c96468d6926f2adc0cff48 Mon Sep 17 00:00:00 2001 From: Paige Sun Date: Tue, 20 Apr 2021 12:48:59 -0700 Subject: [PATCH 018/259] iOS: Fix InputAccessoryView disappearing when inputAccessoryViewID exists Summary: InputAccessoryView disappears on Fabric (not Paper) when the text prop changes. Changelog: [Fabric] [iOS] Fix InputAccessoryView disappearing when inputAccessoryViewID exists Differential Revision: D27721549 fbshipit-source-id: 163dfcf0a8d5226453f4de356650a6ba82bee10b --- .../TextInput/RCTTextInputComponentView.mm | 8 ++ .../TextInput/TextInputExample.ios.js | 101 +++++++++++++++++- 2 files changed, 106 insertions(+), 3 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index f5d280a59e9206..e9e59a9235aa78 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -435,6 +435,14 @@ - (void)setTextAndSelection:(NSInteger)eventCount - (void)setDefaultInputAccessoryView { + // InputAccessoryView component sets the inputAccessoryView when inputAccessoryViewID exists + if (_backedTextInputView.inputAccessoryViewID) { + if (_backedTextInputView.isFirstResponder) { + [_backedTextInputView reloadInputViews]; + } + return; + } + UIKeyboardType keyboardType = _backedTextInputView.keyboardType; // These keyboard types (all are number pads) don't have a "Done" button by default, diff --git a/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js b/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js index 218ad62d9f4e45..5a31407a0307cb 100644 --- a/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js +++ b/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js @@ -23,6 +23,7 @@ const { Switch, Alert, } = require('react-native'); +import type {KeyboardType} from 'react-native/Libraries/Components/TextInput/TextInput'; const TextInputSharedExamples = require('./TextInputSharedExamples.js'); @@ -41,7 +42,10 @@ class WithLabel extends React.Component<$FlowFixMeProps> { } } -class TextInputAccessoryViewExample extends React.Component<{...}, *> { +class TextInputAccessoryViewChangeTextExample extends React.Component< + {...}, + *, +> { constructor(props) { super(props); this.state = {text: 'Placeholder Text'}; @@ -51,6 +55,7 @@ class TextInputAccessoryViewExample extends React.Component<{...}, *> { const inputAccessoryViewID = 'inputAccessoryView1'; return ( + Set InputAccessoryView with ID & reset text: { } } +class TextInputAccessoryViewChangeKeyboardExample extends React.Component< + {...}, + *, +> { + constructor(props) { + super(props); + this.state = {text: '', keyboardType: 'default'}; + } + + _switchKeyboard = () => { + this.setState({ + keyboardType: + this.state.keyboardType === 'default' ? 'number-pad' : 'default', + }); + }; + + render() { + const inputAccessoryViewID = 'inputAccessoryView2'; + return ( + + Set InputAccessoryView with ID & switch keyboard: + this.setState({text})} + value={this.state.text} + keyboardType={this.state.keyboardType} + returnKeyType="done" + /> + + + + + + + + Animation Type + + + + + + {this.renderSwitch()} + {this.renderPickers()} + + + ); + } + renderPickers(): React.Node { + if (Platform.isTV) { + return null; + } + return ( + + + Presentation style + + this.setState({presentationStyle}) + } + itemStyle={styles.pickerItem}> + + + + + + + + + + Supported orientations + + this.setState({selectedSupportedOrientation: i.toString()}) + } + itemStyle={styles.pickerItem}> + + + + + + + + + + + Actions + {Platform.OS === 'ios' ? ( + this.setState({action})} + itemStyle={styles.pickerItem}> + + + + + ) : ( + this.setState({action})} + itemStyle={styles.pickerItem}> + + + + )} + + + ); + } +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + padding: 20, + }, + innerContainer: { + borderRadius: 10, + alignItems: 'center', + }, + row: { + alignItems: 'center', + flex: 1, + flexDirection: 'row', + marginBottom: 20, + }, + rowTitle: { + flex: 1, + fontWeight: 'bold', + }, + button: { + borderRadius: 5, + flexGrow: 1, + height: 44, + alignSelf: 'stretch', + justifyContent: 'center', + overflow: 'hidden', + }, + buttonText: { + fontSize: 18, + margin: 5, + textAlign: 'center', + }, + modalButton: { + marginTop: 10, + }, + pickerItem: { + fontSize: 16, + }, + ScrollView: { + paddingTop: 10, + paddingBottom: 100, + }, +}); + +export default ({ + title: 'Modal Presentation', + name: 'basic', + description: 'Modals can be presented with or without animation', + render: (): React.Node => , +}: RNTesterExampleModuleItem); diff --git a/packages/rn-tester/js/examples/Modal/ModalExample.js b/packages/rn-tester/js/examples/Modal/ModalExample.js index 1cfae6d4d93f25..1c0405029ff829 100644 --- a/packages/rn-tester/js/examples/Modal/ModalExample.js +++ b/packages/rn-tester/js/examples/Modal/ModalExample.js @@ -4,347 +4,21 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ -'use strict'; - -const React = require('react'); - -const { - Modal, - Picker, - Platform, - StyleSheet, - Switch, - Text, - TouchableHighlight, - View, - ScrollView, -} = require('react-native'); - -const Item = Picker.Item; - -exports.displayName = (undefined: ?string); -exports.framework = 'React'; -exports.title = 'Modal'; -exports.category = 'UI'; -exports.documentationURL = 'https://reactnative.dev/docs/modal'; -exports.description = 'Component for presenting modal views.'; - -class Button extends React.Component<$FlowFixMeProps, $FlowFixMeState> { - state = { - active: false, - }; - - _onHighlight = () => { - this.setState({active: true}); - }; - - _onUnhighlight = () => { - this.setState({active: false}); - }; - - render() { - const colorStyle = { - color: this.state.active ? '#fff' : '#000', - }; - return ( - - - {this.props.children} - - - ); - } -} - -const supportedOrientationsPickerValues = [ - ['portrait'], - ['landscape'], - ['landscape-left'], - ['portrait', 'landscape-right'], - ['portrait', 'landscape'], - [], -]; - -class ModalExample extends React.Component<{...}, $FlowFixMeState> { - state = { - animationType: 'none', - modalVisible: false, - transparent: false, - hardwareAccelerated: false, - statusBarTranslucent: false, - presentationStyle: 'fullScreen', - selectedSupportedOrientation: '0', - currentOrientation: 'unknown', - action: '', - }; - - _setModalVisible = visible => { - this.setState({modalVisible: visible}); - }; - - _setAnimationType = type => { - this.setState({animationType: type}); - }; - - _toggleTransparent = () => { - this.setState({transparent: !this.state.transparent}); - }; - - _toggleHardwareAccelerated = () => { - this.setState({hardwareAccelerated: !this.state.hardwareAccelerated}); - }; - - _toggleStatusBarTranslucent = () => { - this.setState({statusBarTranslucent: !this.state.statusBarTranslucent}); - }; - - renderSwitch() { - if (Platform.isTV) { - return null; - } - if (Platform.OS === 'android') { - return ( - <> - Hardware Accelerated - - Status Bar Translucent - - Transparent - - - ); - } - return ( - - ); - } - - render() { - const modalBackgroundStyle = { - backgroundColor: this.state.transparent - ? 'rgba(0, 0, 0, 0.5)' - : '#f5fcff', - }; - const innerContainerTransparentStyle = this.state.transparent - ? {backgroundColor: '#fff', padding: 20} - : null; - const activeButtonStyle = { - backgroundColor: '#ddd', - }; - - return ( - - this._setModalVisible(false)} - supportedOrientations={ - supportedOrientationsPickerValues[ - Number(this.state.selectedSupportedOrientation) - ] - } - onOrientationChange={evt => - this.setState({currentOrientation: evt.nativeEvent.orientation}) - } - onDismiss={() => { - if (this.state.action === 'onDismiss') alert(this.state.action); - }} - onShow={() => { - if (this.state.action === 'onShow') alert(this.state.action); - }}> - - - - This modal was presented{' '} - {this.state.animationType === 'none' ? 'without' : 'with'}{' '} - animation. - - - It is currently displayed in {this.state.currentOrientation}{' '} - mode. - - - - - - - Animation Type - - - - - - {this.renderSwitch()} - {this.renderPickers()} - - - ); - } - renderPickers() { - if (Platform.isTV) { - return null; - } - return ( - - - Presentation style - - this.setState({presentationStyle}) - } - itemStyle={styles.pickerItem}> - - - - - - - - - - Supported orientations - - this.setState({selectedSupportedOrientation: i.toString()}) - } - itemStyle={styles.pickerItem}> - - - - - - - - - - - Actions - {Platform.OS === 'ios' ? ( - this.setState({action})} - itemStyle={styles.pickerItem}> - - - - - ) : ( - this.setState({action})} - itemStyle={styles.pickerItem}> - - - - )} - - - ); - } -} - -exports.examples = [ - { - title: 'Modal Presentation', - name: 'basic', - description: 'Modals can be presented with or without animation', - render: (): React.Node => , - }, -]; - -const styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - padding: 20, - }, - innerContainer: { - borderRadius: 10, - alignItems: 'center', - }, - row: { - alignItems: 'center', - flex: 1, - flexDirection: 'row', - marginBottom: 20, - }, - rowTitle: { - flex: 1, - fontWeight: 'bold', - }, - button: { - borderRadius: 5, - flexGrow: 1, - height: 44, - alignSelf: 'stretch', - justifyContent: 'center', - overflow: 'hidden', - }, - buttonText: { - fontSize: 18, - margin: 5, - textAlign: 'center', - }, - modalButton: { - marginTop: 10, - }, - pickerItem: { - fontSize: 16, - }, - ScrollView: { - paddingTop: 10, - paddingBottom: 100, - }, -}); +import ModalCustomizable from './ModalCustomizable'; +import ModalOnShow from './ModalOnShow'; +import type {RNTesterExampleModuleItem} from '../../types/RNTesterTypes'; + +export const displayName = (undefined: ?string); +export const framework = 'React'; +export const title = 'Modal'; +export const category = 'UI'; +export const documentationURL = 'https://reactnative.dev/docs/modal'; +export const description = 'Component for presenting modal views.'; +export const examples = ([ + ModalCustomizable, + ModalOnShow, +]: Array); diff --git a/packages/rn-tester/js/examples/Modal/ModalOnShow.js b/packages/rn-tester/js/examples/Modal/ModalOnShow.js new file mode 100644 index 00000000000000..dc24ace791a874 --- /dev/null +++ b/packages/rn-tester/js/examples/Modal/ModalOnShow.js @@ -0,0 +1,122 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +import * as React from 'react'; +import {Modal, Pressable, StyleSheet, Text, View} from 'react-native'; +import type {RNTesterExampleModuleItem} from '../../types/RNTesterTypes'; + +function ModalOnShowOnDismiss(): React.Node { + const [modalVisible, setModalVisible] = React.useState(false); + const [onShowCount, setOnShowCount] = React.useState(0); + const [onDismissCount, setOnDismissCount] = React.useState(0); + + return ( + + { + setOnShowCount(onShowCount + 1); + }} + onDismiss={() => { + setOnDismissCount(onDismissCount + 1); + }} + onRequestClose={() => { + setModalVisible(false); + }}> + + + + onShow is called {onShowCount} times + + + onDismiss is called {onDismissCount} times + + setModalVisible(false)}> + + Hide Modal + + + + + + onShow is called {onShowCount} times + + onDismiss is called {onDismissCount} times + + setModalVisible(true)}> + + Show Modal + + + + ); +} + +const styles = StyleSheet.create({ + container: { + display: 'flex', + alignItems: 'center', + paddingVertical: 30, + }, + centeredView: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + modalBackdrop: { + backgroundColor: 'rgba(0, 0, 0, 0.5)', + }, + modalView: { + margin: 20, + backgroundColor: 'white', + borderRadius: 20, + padding: 35, + alignItems: 'center', + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 2, + }, + shadowOpacity: 0.25, + shadowRadius: 4, + elevation: 5, + }, + button: { + borderRadius: 20, + padding: 10, + marginVertical: 20, + elevation: 2, + }, + buttonOpen: { + backgroundColor: '#F194FF', + }, + buttonClose: { + backgroundColor: '#2196F3', + }, + textStyle: { + color: 'white', + fontWeight: 'bold', + textAlign: 'center', + }, +}); + +export default ({ + title: "Modal's onShow/onDismiss", + name: 'onShow', + description: + 'onShow and onDismiss (iOS only) callbacks are called when modals is shown/dissmissed', + render: (): React.Node => , +}: RNTesterExampleModuleItem); From de477a0df6da770e579892d4875a8995c430ebdf Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Fri, 23 Apr 2021 13:30:37 -0700 Subject: [PATCH 042/259] Register RCTEventEmitter as callable module for Venice Summary: ## Context Trying to fix this js error ``` com.facebook.errorreporting.lacrima.common.exception.LacrimaJavascriptException: Error: Module RCTEventEmitter has not been registered as callable. Did you forget to call `RN$registerCallableModule`?, js build: UNKNOWN ``` https://fburl.com/logview/fvc33d48 Changelog: [General][Changed] - Register RCTEventEmitter as callable module for Venice Reviewed By: PeteTheHeat Differential Revision: D27969226 fbshipit-source-id: 8e807ee5b2ef447b0bb49fa2107352d89584c181 --- Libraries/EventEmitter/RCTEventEmitter.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/EventEmitter/RCTEventEmitter.js b/Libraries/EventEmitter/RCTEventEmitter.js index 8001a7cf36a005..fd0ac72eaf9995 100644 --- a/Libraries/EventEmitter/RCTEventEmitter.js +++ b/Libraries/EventEmitter/RCTEventEmitter.js @@ -14,7 +14,11 @@ const BatchedBridge = require('../BatchedBridge/BatchedBridge'); const RCTEventEmitter = { register(eventEmitter: any) { - BatchedBridge.registerCallableModule('RCTEventEmitter', eventEmitter); + if (global.RN$Bridgeless) { + global.RN$registerCallableModule('RCTEventEmitter', () => eventEmitter); + } else { + BatchedBridge.registerCallableModule('RCTEventEmitter', eventEmitter); + } }, }; From bda032af6e4787e5420806e237d308282871eaeb Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Fri, 23 Apr 2021 15:06:04 -0700 Subject: [PATCH 043/259] Adjust animation batch numbers to be consistent when controlled by native Summary: D27682424 (https://github.com/facebook/react-native/commit/ea1ff374de2ece7d1698b14d4e1aa8075df22cdd) updated how animated node batches are executed in Fabric. On Paper, these batches were controlled by native module in some places (batch was executed ~every 2 frames), but some animations were switching animation batching control to JS globally there as well. This change updates two things: - If batching is controlled by native, it makes sure batches are calculated correctly. - At the same time, this change switches control for animation node batching to JS, aligning it with Fabric. Changelog: [Internal] Reviewed By: JoshuaGross, mdvacca Differential Revision: D27939659 fbshipit-source-id: d6251bce2a303a4a007dc10297edc0175cc4b348 --- Libraries/Animated/__tests__/Animated-test.js | 11 ++----- .../Animated/__tests__/AnimatedNative-test.js | 12 ++----- Libraries/Animated/createAnimatedComponent.js | 16 ++++----- .../react/animated/NativeAnimatedModule.java | 17 ++++++++-- jest/setup.js | 33 +++++++++++++++++++ 5 files changed, 60 insertions(+), 29 deletions(-) diff --git a/Libraries/Animated/__tests__/Animated-test.js b/Libraries/Animated/__tests__/Animated-test.js index f7a8bb05ace086..d5b05cc49a63bc 100644 --- a/Libraries/Animated/__tests__/Animated-test.js +++ b/Libraries/Animated/__tests__/Animated-test.js @@ -11,14 +11,9 @@ import TestRenderer from 'react-test-renderer'; import * as React from 'react'; -jest.mock('../../BatchedBridge/NativeModules', () => ({ - NativeAnimatedModule: {}, - PlatformConstants: { - getConstants() { - return {}; - }, - }, -})); +jest.mock('../NativeAnimatedHelper', () => { + return jest.requireActual('../NativeAnimatedHelper'); +}); let Animated = require('../Animated'); describe('Animated tests', () => { diff --git a/Libraries/Animated/__tests__/AnimatedNative-test.js b/Libraries/Animated/__tests__/AnimatedNative-test.js index e5ecec1fb7d648..8466b15483c50b 100644 --- a/Libraries/Animated/__tests__/AnimatedNative-test.js +++ b/Libraries/Animated/__tests__/AnimatedNative-test.js @@ -10,15 +10,9 @@ jest .clearAllMocks() - .mock('../../BatchedBridge/NativeModules', () => ({ - NativeAnimatedModule: {}, - PlatformConstants: { - getConstants() { - return {}; - }, - }, - })) - .mock('../NativeAnimatedModule') + .mock('../NativeAnimatedHelper', () => { + return jest.requireActual('../NativeAnimatedHelper'); + }) .mock('../../EventEmitter/NativeEventEmitter') // findNodeHandle is imported from ReactNative so mock that whole module. .setMock('../../Renderer/shims/ReactNative', {findNodeHandle: () => 1}); diff --git a/Libraries/Animated/createAnimatedComponent.js b/Libraries/Animated/createAnimatedComponent.js index fda18f0af80744..45859bb111ca8c 100644 --- a/Libraries/Animated/createAnimatedComponent.js +++ b/Libraries/Animated/createAnimatedComponent.js @@ -121,19 +121,15 @@ function createAnimatedComponent( }; _waitForUpdate = (): void => { - if (this._isFabric()) { - NativeAnimatedHelper.API.setWaitingForIdentifier( - this._animatedComponentId, - ); - } + NativeAnimatedHelper.API.setWaitingForIdentifier( + this._animatedComponentId, + ); }; _markUpdateComplete = (): void => { - if (this._isFabric()) { - NativeAnimatedHelper.API.unsetWaitingForIdentifier( - this._animatedComponentId, - ); - } + NativeAnimatedHelper.API.unsetWaitingForIdentifier( + this._animatedComponentId, + ); }; // The system is best designed when setNativeProps is implemented. It is diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java index 9d6f4299db2ba3..b12d75c86a6fe0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java @@ -174,7 +174,7 @@ public void onHostResume() { } private void addOperation(UIThreadOperation operation) { - operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1); + operation.setBatchNumber(getCurrentBatchNumber()); mOperations.add(operation); } @@ -184,7 +184,7 @@ private void addUnbatchedOperation(UIThreadOperation operation) { } private void addPreOperation(UIThreadOperation operation) { - operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1); + operation.setBatchNumber(getCurrentBatchNumber()); mPreOperations.add(operation); } @@ -342,6 +342,13 @@ private void enqueueFrameCallback() { ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE, mAnimatedFrameCallback); } + private long getCurrentBatchNumber() { + if (mBatchingControlledByJS && !mIsInBatch) { + return -1; + } + return mCurrentBatchNumber; + } + @VisibleForTesting public void setNodesManager(NativeAnimatedNodesManager nodesManager) { mNodesManager.set(nodesManager); @@ -426,6 +433,9 @@ private void decrementInFlightAnimationsForViewTag(final int viewTag) { @Override public void startOperationBatch() { + if (ANIMATED_MODULE_DEBUG) { + FLog.d(NAME, "Start JS operation batch " + mCurrentBatchNumber); + } mBatchingControlledByJS = true; mIsInBatch = true; mCurrentBatchNumber++; @@ -433,6 +443,9 @@ public void startOperationBatch() { @Override public void finishOperationBatch() { + if (ANIMATED_MODULE_DEBUG) { + FLog.d(NAME, "Finish JS operation batch " + mCurrentBatchNumber); + } mBatchingControlledByJS = true; mIsInBatch = false; mCurrentBatchNumber++; diff --git a/jest/setup.js b/jest/setup.js index c759924d23c38b..a37cbb3865e24c 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -332,6 +332,30 @@ jest doLeftAndRightSwapInRTL: true, }), }, + NativeAnimatedModule: { + startOperationBatch: jest.fn(), + finishOperationBatch: jest.fn(), + createAnimatedNode: jest.fn(), + getValue: jest.fn(), + startListeningToAnimatedNodeValue: jest.fn(), + stopListeningToAnimatedNodeValue: jest.fn(), + connectAnimatedNodes: jest.fn(), + disconnectAnimatedNodes: jest.fn(), + startAnimatingNode: jest.fn(), + stopAnimation: jest.fn(), + setAnimatedNodeValue: jest.fn(), + setAnimatedNodeOffset: jest.fn(), + flattenAnimatedNodeOffset: jest.fn(), + extractAnimatedNodeOffset: jest.fn(), + connectAnimatedNodeToView: jest.fn(), + disconnectAnimatedNodeFromView: jest.fn(), + restoreDefaultValues: jest.fn(), + dropAnimatedNode: jest.fn(), + addAnimatedEventToView: jest.fn(), + removeAnimatedEventFromView: jest.fn(), + addListener: jest.fn(), + removeListeners: jest.fn(), + }, })) .mock('../Libraries/NativeComponent/NativeComponentRegistry', () => { return { @@ -365,4 +389,13 @@ jest __esModule: true, default: Component, }; + }) + .mock('../Libraries/Animated/NativeAnimatedHelper.js', () => { + const NativeAnimatedHelper = jest.requireActual( + '../Libraries/Animated/NativeAnimatedHelper.js', + ); + return { + ...NativeAnimatedHelper, + shouldUseNativeDriver: jest.fn(false), + }; }); From 090196f330b40b63d6201f7253683f410fa812b2 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 23 Apr 2021 15:11:28 -0700 Subject: [PATCH 044/259] ReactContext: Fail fast when NativeModules thread is null Summary: By the time that we call [ReactContext.assertOnNativeModulesQueueThread()](https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java?commit=747a25280435d276fb975ccfe36fd5e60254c4e4&lines=355%2C359), ReactContext.mNativeModulesMessageQueueThread must be non-null. This implies that two things must have happened: 1. We initialized the ReactContext 2. After initialization, ReactContext.mNativeModulesMessageQueueThread must be non-null. According to T85807990, ReactContext.mNativeModulesMessageQueueThread is null. Since ReactContext doesn't ever write to ReactContext.mNativeModulesMessageQueueThread aside from during initialization, it must mean that we either didn't initialize properly, or we initialized, but set the NativeModules thread to null. This diff throws IllegalStateExceptions inside ReactContext initialization, which should help narrow down the crash in T85807990. Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D27729355 fbshipit-source-id: e39030b7db8862ae76fb644efaafb382a79b8ad0 --- .../facebook/react/bridge/ReactContext.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java index f227f0da0629ba..9caaeff3508c34 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java @@ -63,6 +63,7 @@ public class ReactContext extends ContextWrapper { private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler; private @Nullable NativeModuleCallExceptionHandler mExceptionHandlerWrapper; private @Nullable WeakReference mCurrentActivity; + private boolean mIsInitialized = false; public ReactContext(Context base) { super(base); @@ -101,6 +102,18 @@ public void initializeMessageQueueThreads(ReactQueueConfiguration queueConfig) { mUiMessageQueueThread = queueConfig.getUIQueueThread(); mNativeModulesMessageQueueThread = queueConfig.getNativeModulesQueueThread(); mJSMessageQueueThread = queueConfig.getJSQueueThread(); + + /** TODO(T85807990): Fail fast if any of the threads is null. */ + if (mUiMessageQueueThread == null) { + throw new IllegalStateException("UI thread is null"); + } + if (mNativeModulesMessageQueueThread == null) { + throw new IllegalStateException("NativeModules thread is null"); + } + if (mJSMessageQueueThread == null) { + throw new IllegalStateException("JavaScript thread is null"); + } + mIsInitialized = true; } public void resetPerfStats() { @@ -352,10 +365,20 @@ public void runOnUiQueueThread(Runnable runnable) { } public void assertOnNativeModulesQueueThread() { + /** TODO(T85807990): Fail fast if the ReactContext isn't initialized */ + if (!mIsInitialized) { + throw new IllegalStateException( + "Tried to call assertOnNativeModulesQueueThread() on an uninitialized ReactContext"); + } Assertions.assertNotNull(mNativeModulesMessageQueueThread).assertIsOnThread(); } public void assertOnNativeModulesQueueThread(String message) { + /** TODO(T85807990): Fail fast if the ReactContext isn't initialized */ + if (!mIsInitialized) { + throw new IllegalStateException( + "Tried to call assertOnNativeModulesQueueThread(message) on an uninitialized ReactContext"); + } Assertions.assertNotNull(mNativeModulesMessageQueueThread).assertIsOnThread(message); } From f34a2899e464b31d301c706b16966bfa3236a4a7 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 23 Apr 2021 15:57:58 -0700 Subject: [PATCH 045/259] Invalidate TurboModules on their method queues Summary: ## Rationale With the bridge, the invalidate method of every TurboModule gets called on the TurboModule's method queue. This ensures that we can safely clean up resources accessed in the TurboModule's async methods. In bridgeless mode, we don't invalidate each module on its method queue. After this diff, we will clean up every TurboModule on its own method queue. ## Changes - Make RCTInstance dealloc itself on the JavaScript thread. - Terminate the JavaScript thread on the JavaScript thread. This ensures that no work executes on the JavaScript thread after we clean up RCTInstance. - Make [RCTTurboModuleManager invalidate] execute right before RCTInstance terminates the JavaScript thread. - **Fix:** Make [RCTTurboModuleManger invalidate] synchronously invalidate modules on their own method queues. Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D27933587 fbshipit-source-id: 7630e7fc074df2f5a3293192431105c747b8588f --- .../platform/ios/RCTTurboModuleManager.mm | 73 ++++++++++--------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm index 8d755a6961b359..b43a4512b315e5 100644 --- a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm @@ -834,6 +834,27 @@ - (void)bridgeWillInvalidateModules:(NSNotification *)notification return; } + [self _enterInvalidatingState]; +} + +- (void)bridgeDidInvalidateModules:(NSNotification *)notification +{ + RCTBridge *bridge = notification.userInfo[@"bridge"]; + if (bridge != _bridge) { + return; + } + + [self _invalidateModules]; +} + +- (void)invalidate +{ + [self _enterInvalidatingState]; + [self _invalidateModules]; +} + +- (void)_enterInvalidatingState +{ // This should halt all insertions into _turboModuleHolders if (RCTTurboModuleSharedMutexInitEnabled()) { std::unique_lock guard(_turboModuleHoldersSharedMutex); @@ -844,13 +865,8 @@ - (void)bridgeWillInvalidateModules:(NSNotification *)notification } } -- (void)bridgeDidInvalidateModules:(NSNotification *)notification +- (void)_invalidateModules { - RCTBridge *bridge = notification.userInfo[@"bridge"]; - if (bridge != _bridge) { - return; - } - // Backward-compatibility: RCTInvalidating handling. dispatch_group_t moduleInvalidationGroup = dispatch_group_create(); @@ -870,17 +886,28 @@ - (void)bridgeDidInvalidateModules:(NSNotification *)notification if ([module respondsToSelector:@selector(invalidate)]) { if ([module respondsToSelector:@selector(methodQueue)]) { dispatch_queue_t methodQueue = [module performSelector:@selector(methodQueue)]; + if (methodQueue) { dispatch_group_enter(moduleInvalidationGroup); - [bridge - dispatchBlock:^{ - [((id)module) invalidate]; - dispatch_group_leave(moduleInvalidationGroup); - } - queue:methodQueue]; + dispatch_block_t invalidateModule = ^{ + [((id)module) invalidate]; + dispatch_group_leave(moduleInvalidationGroup); + }; + + if (_bridge) { + [_bridge dispatchBlock:invalidateModule queue:methodQueue]; + } else { + // Bridgeless mode + if (methodQueue == RCTJSThread) { + invalidateModule(); + } else { + dispatch_async(methodQueue, invalidateModule); + } + } continue; } } + [((id)module) invalidate]; } } @@ -893,26 +920,4 @@ - (void)bridgeDidInvalidateModules:(NSNotification *)notification _turboModuleCache.clear(); } -- (void)invalidate -{ - if (RCTTurboModuleSharedMutexInitEnabled()) { - std::unique_lock guard(_turboModuleHoldersSharedMutex); - _invalidating = true; - } else { - std::lock_guard guard(_turboModuleHoldersMutex); - _invalidating = true; - } - - // Backward-compatibility: RCTInvalidating handling, but not adhering to desired methodQueue. - for (const auto &p : _turboModuleHolders) { - id module = p.second.getModule(); - if ([module respondsToSelector:@selector(invalidate)]) { - [((id)module) invalidate]; - } - } - - _turboModuleHolders.clear(); - _turboModuleCache.clear(); -} - @end From 497eb578ab32614744a4ef61d7a6bca0d4251885 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 23 Apr 2021 15:57:58 -0700 Subject: [PATCH 046/259] Fix invalidation for modules with infra-generated method queues Summary: When invalidating TurboModules, the TurboModule infra looks for a methodQueue method on the TurboModule (line 871 below). If it finds one, the TurboModuleManager dispatches module invalidate on that method queue: https://www.internalfb.com/code/fbsource/[c91dc16f4b63abd05c7c9a038e88ca692a453c69]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=847-848%2C870-883 ## The Problem TurboModules that neither provide a method queue, nor request a method queue won't respond to selector(methodQueue). For those modules, the TurboModule system won't dispatch invalidate to their method queue ## The Fix Calling selector(methodQueue) is an unreliable way of getting the module's method queue. The TurboModuleManager attaches a method queue to every TurboModule as an associated object: https://www.internalfb.com/code/fbsource/[c91dc16f4b63]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=636 In this diff, in the TurboModule invalidate method, we retrieve the method queue using ObjC's associated object API. This guarantees that all TurboModules will be invalidated on their method queues. Changelog: [iOS][Fixed] - Invalidate TurboModules with infra-generated method queues on their method queues Reviewed By: appden Differential Revision: D27954644 fbshipit-source-id: af4408e444d03a15d8d8e154b3980511b81d5fb1 --- .../platform/ios/RCTTurboModuleManager.mm | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm index b43a4512b315e5..cd373ef7144ded 100644 --- a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm @@ -884,31 +884,31 @@ - (void)_invalidateModules shouldPerfLog:NO]; if ([module respondsToSelector:@selector(invalidate)]) { - if ([module respondsToSelector:@selector(methodQueue)]) { - dispatch_queue_t methodQueue = [module performSelector:@selector(methodQueue)]; - - if (methodQueue) { - dispatch_group_enter(moduleInvalidationGroup); - dispatch_block_t invalidateModule = ^{ - [((id)module) invalidate]; - dispatch_group_leave(moduleInvalidationGroup); - }; - - if (_bridge) { - [_bridge dispatchBlock:invalidateModule queue:methodQueue]; - } else { - // Bridgeless mode - if (methodQueue == RCTJSThread) { - invalidateModule(); - } else { - dispatch_async(methodQueue, invalidateModule); - } - } - continue; - } + dispatch_queue_t methodQueue = (dispatch_queue_t)objc_getAssociatedObject(module, &kAssociatedMethodQueueKey); + + if (methodQueue == nil) { + RCTLogError( + @"TurboModuleManager: Couldn't invalidate TurboModule \"%@\", because its method queue is nil.", + [module class]); + continue; } - [((id)module) invalidate]; + dispatch_group_enter(moduleInvalidationGroup); + dispatch_block_t invalidateModule = ^{ + [((id)module) invalidate]; + dispatch_group_leave(moduleInvalidationGroup); + }; + + if (_bridge) { + [_bridge dispatchBlock:invalidateModule queue:methodQueue]; + } else { + // Bridgeless mode + if (methodQueue == RCTJSThread) { + invalidateModule(); + } else { + dispatch_async(methodQueue, invalidateModule); + } + } } } From da150343f745ea03219edb92907794dde5acebaa Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 23 Apr 2021 15:57:58 -0700 Subject: [PATCH 047/259] TM Create: log error when method queue is nil Summary: When TurboModuleManager creates TurboModules, it creates and assigns a method queue to the module using ObjC's Associated Object API: https://www.internalfb.com/code/fbsource/[c91dc16f4b63]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=636 Down the line, we retrieve this method queue, and use it to create a native CallInvoker: https://www.internalfb.com/code/fbsource/[c91dc16f4b63abd05c7c9a038e88ca692a453c69]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=279-284 We should assert that this method queue isn't nil. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D27956219 fbshipit-source-id: 2554cf2bffc732bb895e6dc082338a38b05f6580 --- .../nativemodule/core/platform/ios/RCTTurboModuleManager.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm index cd373ef7144ded..804f4012cec40d 100644 --- a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm @@ -277,6 +277,9 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name Class moduleClass = [module class]; dispatch_queue_t methodQueue = (dispatch_queue_t)objc_getAssociatedObject(module, &kAssociatedMethodQueueKey); + if (methodQueue == nil) { + RCTLogError(@"TurboModule \"%@\" was not associated with a method queue.", moduleClass); + } /** * Step 2c: Create and native CallInvoker from the TurboModule's method queue. From c68c55469fe9e2e03cdd6d9201172bd2b49c07e8 Mon Sep 17 00:00:00 2001 From: Neil Dhar Date: Fri, 23 Apr 2021 17:45:33 -0700 Subject: [PATCH 048/259] Initialise LineMeasurement::xHeight in constructor Summary: Fix a bug in the constructor of `LineMeasurement` where it did not initialise `xHeight` correctly. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D27972942 fbshipit-source-id: a56d55fdfe286bd11a6a81a3d024504f070bdb19 --- .../react/renderer/textlayoutmanager/TextMeasureCache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp b/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp index db9910fecb5a16..76bbc45c963404 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp +++ b/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp @@ -34,7 +34,8 @@ LineMeasurement::LineMeasurement( frame(frame), descender(descender), capHeight(capHeight), - ascender(ascender) {} + ascender(ascender), + xHeight(xHeight) {} LineMeasurement::LineMeasurement(folly::dynamic const &data) : text(data.getDefault("text", "").getString()), From db3625a3b0ded78788d25d691cc3b83a9ee8d2c6 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 23 Apr 2021 18:14:35 -0700 Subject: [PATCH 049/259] Refactor: Move RuntimeExecutor into Instance.cpp Summary: RuntimeExecutor is currently declared inside NativeToJsBridge. It doesn't need to be: Instance.cpp can use NativeToJsBridge::runOnExecutorQueue to schedule work on the JS Thread. So, this diff moves RuntimeExecutor out of NativeToJsBridge into Instance.cpp. Now, both the JS CallInvoker and the RuntimeExecutor are declared in the same file. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D27975840 fbshipit-source-id: aa06f479fa24bb7a15bfd21712df5414a183266c --- ReactCommon/cxxreact/Instance.cpp | 22 +++++++++++++++++++++- ReactCommon/cxxreact/NativeToJsBridge.cpp | 21 --------------------- ReactCommon/cxxreact/NativeToJsBridge.h | 6 ------ 3 files changed, 21 insertions(+), 28 deletions(-) diff --git a/ReactCommon/cxxreact/Instance.cpp b/ReactCommon/cxxreact/Instance.cpp index d809a87c737734..8e837596f712a1 100644 --- a/ReactCommon/cxxreact/Instance.cpp +++ b/ReactCommon/cxxreact/Instance.cpp @@ -7,6 +7,7 @@ #include "Instance.h" +#include "ErrorUtils.h" #include "JSBigString.h" #include "JSBundleType.h" #include "JSExecutor.h" @@ -245,8 +246,27 @@ std::shared_ptr Instance::getJSCallInvoker() { return std::static_pointer_cast(jsCallInvoker_); } +// TODO: Unify with JS CallInvoker RuntimeExecutor Instance::getRuntimeExecutor() { - return nativeToJsBridge_->getRuntimeExecutor(); + std::weak_ptr weakNativeToJsBridge = nativeToJsBridge_; + + auto runtimeExecutor = + [weakNativeToJsBridge]( + std::function &&callback) { + if (auto strongNativeToJsBridge = weakNativeToJsBridge.lock()) { + strongNativeToJsBridge->runOnExecutorQueue( + [callback = std::move(callback)](JSExecutor *executor) { + jsi::Runtime *runtime = + (jsi::Runtime *)executor->getJavaScriptContext(); + try { + callback(*runtime); + } catch (jsi::JSError &originalError) { + handleJSError(*runtime, originalError, true); + } + }); + } + }; + return runtimeExecutor; } std::shared_ptr Instance::getDecoratedNativeCallInvoker( diff --git a/ReactCommon/cxxreact/NativeToJsBridge.cpp b/ReactCommon/cxxreact/NativeToJsBridge.cpp index d0c13554f28a13..3a695201057bcb 100644 --- a/ReactCommon/cxxreact/NativeToJsBridge.cpp +++ b/ReactCommon/cxxreact/NativeToJsBridge.cpp @@ -340,26 +340,5 @@ std::shared_ptr NativeToJsBridge::getDecoratedNativeCallInvoker( return std::make_shared(m_delegate, nativeInvoker); } -RuntimeExecutor NativeToJsBridge::getRuntimeExecutor() { - auto runtimeExecutor = - [this, isDestroyed = m_destroyed]( - std::function &&callback) { - if (*isDestroyed) { - return; - } - runOnExecutorQueue( - [callback = std::move(callback)](JSExecutor *executor) { - jsi::Runtime *runtime = - (jsi::Runtime *)executor->getJavaScriptContext(); - try { - callback(*runtime); - } catch (jsi::JSError &originalError) { - handleJSError(*runtime, originalError, true); - } - }); - }; - return runtimeExecutor; -} - } // namespace react } // namespace facebook diff --git a/ReactCommon/cxxreact/NativeToJsBridge.h b/ReactCommon/cxxreact/NativeToJsBridge.h index d298f9c27960c2..f9548c59509dbd 100644 --- a/ReactCommon/cxxreact/NativeToJsBridge.h +++ b/ReactCommon/cxxreact/NativeToJsBridge.h @@ -107,12 +107,6 @@ class NativeToJsBridge { std::shared_ptr getDecoratedNativeCallInvoker( std::shared_ptr nativeInvoker); - /** - * RuntimeExecutor is used on Android to access the jsi::Runtime from Fabric - * and TurboModules - */ - RuntimeExecutor getRuntimeExecutor(); - private: // This is used to avoid a race condition where a proxyCallback gets queued // after ~NativeToJsBridge(), on the same thread. In that case, the callback From c0ec82e61eb464b38b912ce54f2678e308ad8d10 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 23 Apr 2021 18:14:35 -0700 Subject: [PATCH 050/259] Add flushing to RuntimeExecutor Summary: ## Motivation With the bridge, every call into JS flushes the queue of NativeModule calls. Fabric bypasses this mechanism, because it uses a RuntimeExecutor that schedules work directly on the JavaScript thread. This diff makes Fabric's RuntimeExecutor also flush the queue of NativeModule calls. This likely won't fix anything in Fabric, because we don't execute any async NativeModule calls on Fb4a. However, this is necessary for the drainMicrotask work we're doing in D27729702 (https://github.com/facebook/react-native/commit/73108477589a18cecb303ef556fa3da02f8ca1b8), because (1) we need to drain the Hermes microtask queue on every call from C++ -> JavaScript (2) we drain the microtask queue [inside JSIExecutor::flush()](https://github.com/facebook/react-native/blob/de477a0df6da770e579892d4875a8995c430ebdf/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp#L427,L445). Changelog: [Android][Fixed] - Flush JSIExecutor in Fabric's RuntimeExecutor Reviewed By: JoshuaGross Differential Revision: D27975839 fbshipit-source-id: 27f031fb36593253da116a033e30998475eb1473 --- .../facebook/react/bridge/CatalystInstanceImpl.java | 6 +++++- .../src/main/jni/react/jni/CatalystInstanceImpl.cpp | 6 +++--- .../src/main/jni/react/jni/CatalystInstanceImpl.h | 3 ++- ReactCommon/cxxreact/Instance.cpp | 13 ++++++++----- ReactCommon/cxxreact/Instance.h | 2 +- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index cdc1eb26a3699a..a75c7d39100667 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -550,7 +550,11 @@ public JavaScriptContextHolder getJavaScriptContextHolder() { } @Override - public native RuntimeExecutor getRuntimeExecutor(); + public RuntimeExecutor getRuntimeExecutor() { + return getRuntimeExecutor(false); + } + + public native RuntimeExecutor getRuntimeExecutor(boolean shouldFlush); @Override public void addJSIModules(List jsiModules) { diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index 2a33fa3d0f8294..6027a63f49f15e 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -346,10 +346,10 @@ CatalystInstanceImpl::getNativeCallInvokerHolder() { } jni::alias_ref -CatalystInstanceImpl::getRuntimeExecutor() { +CatalystInstanceImpl::getRuntimeExecutor(bool shouldFlush) { if (!runtimeExecutor_) { - runtimeExecutor_ = jni::make_global( - JRuntimeExecutor::newObjectCxxArgs(instance_->getRuntimeExecutor())); + runtimeExecutor_ = jni::make_global(JRuntimeExecutor::newObjectCxxArgs( + instance_->getRuntimeExecutor(shouldFlush))); } return runtimeExecutor_; } diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h index c40a691232c6a2..fff64a0a79db6f 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h @@ -93,7 +93,8 @@ class CatalystInstanceImpl : public jni::HybridClass { void jniCallJSCallback(jint callbackId, NativeArray *arguments); jni::alias_ref getJSCallInvokerHolder(); jni::alias_ref getNativeCallInvokerHolder(); - jni::alias_ref getRuntimeExecutor(); + jni::alias_ref getRuntimeExecutor( + bool shouldFlush); void setGlobalVariable(std::string propName, std::string &&jsonValue); jlong getJavaScriptContext(); void handleMemoryPressure(int pressureLevel); diff --git a/ReactCommon/cxxreact/Instance.cpp b/ReactCommon/cxxreact/Instance.cpp index 8e837596f712a1..13679112bbe257 100644 --- a/ReactCommon/cxxreact/Instance.cpp +++ b/ReactCommon/cxxreact/Instance.cpp @@ -246,20 +246,23 @@ std::shared_ptr Instance::getJSCallInvoker() { return std::static_pointer_cast(jsCallInvoker_); } -// TODO: Unify with JS CallInvoker -RuntimeExecutor Instance::getRuntimeExecutor() { +RuntimeExecutor Instance::getRuntimeExecutor(bool shouldFlush) { std::weak_ptr weakNativeToJsBridge = nativeToJsBridge_; auto runtimeExecutor = - [weakNativeToJsBridge]( - std::function &&callback) { + [weakNativeToJsBridge, + shouldFlush](std::function &&callback) { if (auto strongNativeToJsBridge = weakNativeToJsBridge.lock()) { strongNativeToJsBridge->runOnExecutorQueue( - [callback = std::move(callback)](JSExecutor *executor) { + [callback = std::move(callback), + shouldFlush](JSExecutor *executor) { jsi::Runtime *runtime = (jsi::Runtime *)executor->getJavaScriptContext(); try { callback(*runtime); + if (shouldFlush) { + executor->flush(); + } } catch (jsi::JSError &originalError) { handleJSError(*runtime, originalError, true); } diff --git a/ReactCommon/cxxreact/Instance.h b/ReactCommon/cxxreact/Instance.h index 7cd11f9bdf50b4..dfde400a01d9e8 100644 --- a/ReactCommon/cxxreact/Instance.h +++ b/ReactCommon/cxxreact/Instance.h @@ -134,7 +134,7 @@ class RN_EXPORT Instance { /** * RuntimeExecutor is used by Fabric to access the jsi::Runtime. */ - RuntimeExecutor getRuntimeExecutor(); + RuntimeExecutor getRuntimeExecutor(bool shouldFlush); private: void callNativeModules(folly::dynamic &&calls, bool isEndOfBatch); From d48c2be46ff76a403a879917bac5ca63e9925684 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 23 Apr 2021 18:14:35 -0700 Subject: [PATCH 051/259] Wire up RuntimeExecutorFlushing to MobileConfig Summary: With D27975839, RuntimeExecutor will be able to start flushing the queued up NativeModule calls in every call from C++ -> JavaScript. We're going to test this feature to measure its impact. In this diff, I wire up the the MobileConfig to ReactFeatureFlags. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D27978112 fbshipit-source-id: 47e1e74398c62755bb0fdc6b54b7fd3aa47eb877 --- .../react/bridge/CatalystInstanceImpl.java | 2 +- .../react/config/ReactFeatureFlags.java | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index a75c7d39100667..c0d8d225e31243 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -551,7 +551,7 @@ public JavaScriptContextHolder getJavaScriptContextHolder() { @Override public RuntimeExecutor getRuntimeExecutor() { - return getRuntimeExecutor(false); + return getRuntimeExecutor(ReactFeatureFlags.enableRuntimeExecutorFlushing()); } public native RuntimeExecutor getRuntimeExecutor(boolean shouldFlush); diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index 8416fe580fffcc..23668c8a3ffd7e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -72,4 +72,24 @@ public class ReactFeatureFlags { /** Enables MapBuffer Serialization */ public static boolean mapBufferSerializationEnabled = false; + + /** An interface used to compute flags on demand. */ + public interface FlagProvider { + boolean get(); + } + + /** Should the RuntimeExecutor call JSIExecutor::flush()? */ + private static FlagProvider enableRuntimeExecutorFlushingProvider = null; + + public static void setEnableRuntimeExecutorFlushingFlagProvider(FlagProvider provider) { + enableRuntimeExecutorFlushingProvider = provider; + } + + public static boolean enableRuntimeExecutorFlushing() { + if (enableRuntimeExecutorFlushingProvider != null) { + return enableRuntimeExecutorFlushingProvider.get(); + } + + return false; + } } From f31497354b72ad51b452a4b8bd3b70de16830025 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Fri, 23 Apr 2021 19:53:34 -0700 Subject: [PATCH 052/259] iOS: make RCTSurfaceHostingView have default backgroundColor Summary: Previously it defaults to using transparent color (iOS default), but when using `RCTSurfaceHostingProxyRootView` we actually manually set to `[UIColor whiteColor]`. However, if the surface is initialized via a different API, the color wasn't set. To avoid confusion and backward incompatibility, let's just set the same background color here. We can decide in the future if the default color should be transparent instead. Changelog: [Fixed][iOS] RCTSurfaceHostingView default background color is now consistent with RCTRootView Reviewed By: RSNara Differential Revision: D27973748 fbshipit-source-id: c506afbc5629df6647277aa2323f084773c8e760 --- .../SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm | 2 +- React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm index 6bc6632509cabb..dac29387c41f72 100644 --- a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +++ b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm @@ -74,7 +74,7 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge initialProperties:initialProperties]; [surface start]; if (self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) { - self.backgroundColor = [UIColor whiteColor]; + // Nothing specific to do. } RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @""); diff --git a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm index 4b6817ebf4b22b..06d6eabe9d28dc 100644 --- a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +++ b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm @@ -60,6 +60,9 @@ - (instancetype)initWithSurface:(id)surface _surface.delegate = self; _stage = surface.stage; [self _updateViews]; + + // For backward compatibility with RCTRootView, set a color here instead of transparent (OS default). + self.backgroundColor = [UIColor whiteColor]; } return self; From 09cb12c26ca8484fa20aa5e6fd63e71e60c21067 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Sat, 24 Apr 2021 03:19:43 -0700 Subject: [PATCH 053/259] Pass eventPriority by value instead of reference Summary: Changelog: [internal] EventPriority is backed by int, passing it by reference doesn't provide any performance benefits. Quite contrary, it can make it slower because of indirectness (in our case it is probably negligible). Reviewed By: mdvacca Differential Revision: D27938600 fbshipit-source-id: 37d1312627dd5a8f9012dfb35d21afe716a16ad7 --- ReactCommon/react/renderer/core/EventEmitter.cpp | 4 ++-- ReactCommon/react/renderer/core/EventEmitter.h | 4 ++-- ReactCommon/react/renderer/core/EventPriority.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ReactCommon/react/renderer/core/EventEmitter.cpp b/ReactCommon/react/renderer/core/EventEmitter.cpp index 54a0c8154b2acb..7d0dac98392adc 100644 --- a/ReactCommon/react/renderer/core/EventEmitter.cpp +++ b/ReactCommon/react/renderer/core/EventEmitter.cpp @@ -52,7 +52,7 @@ EventEmitter::EventEmitter( void EventEmitter::dispatchEvent( const std::string &type, const folly::dynamic &payload, - const EventPriority &priority) const { + EventPriority priority) const { dispatchEvent( type, [payload](jsi::Runtime &runtime) { @@ -64,7 +64,7 @@ void EventEmitter::dispatchEvent( void EventEmitter::dispatchEvent( const std::string &type, const ValueFactory &payloadFactory, - const EventPriority &priority) const { + EventPriority priority) const { SystraceSection s("EventEmitter::dispatchEvent"); auto eventDispatcher = eventDispatcher_.lock(); diff --git a/ReactCommon/react/renderer/core/EventEmitter.h b/ReactCommon/react/renderer/core/EventEmitter.h index 55bdf8f040158c..a60e7507fa7213 100644 --- a/ReactCommon/react/renderer/core/EventEmitter.h +++ b/ReactCommon/react/renderer/core/EventEmitter.h @@ -71,12 +71,12 @@ class EventEmitter { const std::string &type, const ValueFactory &payloadFactory = EventEmitter::defaultPayloadFactory(), - const EventPriority &priority = EventPriority::AsynchronousBatched) const; + EventPriority priority = EventPriority::AsynchronousBatched) const; void dispatchEvent( const std::string &type, const folly::dynamic &payload, - const EventPriority &priority = EventPriority::AsynchronousBatched) const; + EventPriority priority = EventPriority::AsynchronousBatched) const; void dispatchUniqueEvent( const std::string &type, diff --git a/ReactCommon/react/renderer/core/EventPriority.h b/ReactCommon/react/renderer/core/EventPriority.h index 61e3ad39dbdf5e..8611f105800e0e 100644 --- a/ReactCommon/react/renderer/core/EventPriority.h +++ b/ReactCommon/react/renderer/core/EventPriority.h @@ -10,7 +10,7 @@ namespace facebook { namespace react { -enum class EventPriority : int { +enum class EventPriority { SynchronousUnbatched, SynchronousBatched, AsynchronousUnbatched, From 1b592631a77ab63df553052a9197b66e42341f1a Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Sat, 24 Apr 2021 03:19:43 -0700 Subject: [PATCH 054/259] Prevent redundant dispatches onto RuntimeExecutor queue in AsynchronousEventBeat::induce Summary: Changelog: [internal] Current implementation of `AsynchronousEventBeat` dispatches lambdas through `RuntimeExecutor` regardless if it has done so previously. So if `AsynchronousEventBeat::induce` is called 30 times, it will dispatch 30 lambdas. In `AsynchronousEventBeatV2`, we make sure only single lambda is dispatched to `RuntimeExecutor` at a time. Reviewed By: mdvacca Differential Revision: D27940300 fbshipit-source-id: 2bad25c86315c1712b4a1da8c1d4702734cec70f --- React/Fabric/RCTSurfacePresenter.mm | 13 ++++- .../scheduler/AsynchronousEventBeatV2.cpp | 58 +++++++++++++++++++ .../scheduler/AsynchronousEventBeatV2.h | 41 +++++++++++++ 3 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 ReactCommon/react/renderer/scheduler/AsynchronousEventBeatV2.cpp create mode 100644 ReactCommon/react/renderer/scheduler/AsynchronousEventBeatV2.h diff --git a/React/Fabric/RCTSurfacePresenter.mm b/React/Fabric/RCTSurfacePresenter.mm index 65c0f185953395..8a3e74b1e02875 100644 --- a/React/Fabric/RCTSurfacePresenter.mm +++ b/React/Fabric/RCTSurfacePresenter.mm @@ -31,6 +31,7 @@ #import #import #import +#import #import #import #import @@ -305,10 +306,18 @@ - (RCTScheduler *)_createScheduler return std::make_unique(std::move(runLoopObserver), runtimeExecutor); }; - toolbox.asynchronousEventBeatFactory = [runtimeExecutor](EventBeat::SharedOwnerBox const &ownerBox) { + auto enableV2AsynchronousEventBeat = + reactNativeConfig && reactNativeConfig->getBool("react_fabric:enable_asynchronous_event_beat_v2_ios"); + + toolbox.asynchronousEventBeatFactory = [runtimeExecutor, enableV2AsynchronousEventBeat]( + EventBeat::SharedOwnerBox const &ownerBox) -> std::unique_ptr { auto runLoopObserver = std::make_unique(RunLoopObserver::Activity::BeforeWaiting, ownerBox->owner); - return std::make_unique(std::move(runLoopObserver), runtimeExecutor); + if (enableV2AsynchronousEventBeat) { + return std::make_unique(std::move(runLoopObserver), runtimeExecutor); + } else { + return std::make_unique(std::move(runLoopObserver), runtimeExecutor); + } }; RCTScheduler *scheduler = [[RCTScheduler alloc] initWithToolbox:toolbox]; diff --git a/ReactCommon/react/renderer/scheduler/AsynchronousEventBeatV2.cpp b/ReactCommon/react/renderer/scheduler/AsynchronousEventBeatV2.cpp new file mode 100644 index 00000000000000..68f80973e5d7a2 --- /dev/null +++ b/ReactCommon/react/renderer/scheduler/AsynchronousEventBeatV2.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "AsynchronousEventBeatV2.h" + +#include + +namespace facebook::react { + +AsynchronousEventBeatV2::AsynchronousEventBeatV2( + RunLoopObserver::Unique uiRunLoopObserver, + RuntimeExecutor runtimeExecutor) + : EventBeat({}), + uiRunLoopObserver_(std::move(uiRunLoopObserver)), + runtimeExecutor_(std::move(runtimeExecutor)) { + uiRunLoopObserver_->setDelegate(this); + uiRunLoopObserver_->enable(); +} + +void AsynchronousEventBeatV2::activityDidChange( + RunLoopObserver::Delegate const *delegate, + RunLoopObserver::Activity) const noexcept { + react_native_assert(delegate == this); + induce(); +} + +void AsynchronousEventBeatV2::induce() const { + if (!isRequested_ || isBeatCallbackScheduled_) { + return; + } + + isRequested_ = false; + + // Here we know that `this` object exists because the caller has a strong + // pointer to `owner`. To ensure the object will exist inside + // `runtimeExecutor_` callback, we need to copy the pointer there. + auto weakOwner = uiRunLoopObserver_->getOwner(); + + isBeatCallbackScheduled_ = true; + + runtimeExecutor_([this, weakOwner](jsi::Runtime &runtime) { + isBeatCallbackScheduled_ = false; + + auto owner = weakOwner.lock(); + if (!owner) { + return; + } + + if (beatCallback_) { + beatCallback_(runtime); + } + }); +} +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/scheduler/AsynchronousEventBeatV2.h b/ReactCommon/react/renderer/scheduler/AsynchronousEventBeatV2.h new file mode 100644 index 00000000000000..b0449fd8d6581e --- /dev/null +++ b/ReactCommon/react/renderer/scheduler/AsynchronousEventBeatV2.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include +#include +#include + +namespace facebook::react { + +/* + * Event beat associated with JavaScript runtime. + * The beat is called on `RuntimeExecutor`'s thread induced by the UI thread + * event loop. + */ +class AsynchronousEventBeatV2 : public EventBeat, + public RunLoopObserver::Delegate { + public: + AsynchronousEventBeatV2( + RunLoopObserver::Unique uiRunLoopObserver, + RuntimeExecutor runtimeExecutor); + + void induce() const override; + +#pragma mark - RunLoopObserver::Delegate + + void activityDidChange( + RunLoopObserver::Delegate const *delegate, + RunLoopObserver::Activity activity) const noexcept override; + + private: + RunLoopObserver::Unique uiRunLoopObserver_; + RuntimeExecutor runtimeExecutor_; + + mutable std::atomic isBeatCallbackScheduled_{false}; +}; + +} // namespace facebook::react From b914153286ea537d4a57ff934e63e07172c576a0 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Sat, 24 Apr 2021 17:08:01 -0700 Subject: [PATCH 055/259] Animated: Delete `getNode()` on Refs Summary: In 0.62, `createAnimatedComponent` was changed to use `forwardRef` instead of requiring callers to use `ref.getNode()`. In order to preserve backward-compatibility, `ref.getNode()` was monkey-patched onto the returned ref, if possible, to return the `ref` and output a console warning. Three major (well, technically, minor) releases later, we are dropping support for `getNode()`. Calling it on the `ref` of an animated component will begin to fail after this (unless the underlying component itself actually implements a `getNode()` method on its imperative handle). Changelog: [General][Removed] - Removed `getNode()` from animated component refs. Reviewed By: nadiia Differential Revision: D27979882 fbshipit-source-id: 885c3dbf4f2749c994fc2662dd6f16ff3dd887c7 --- Libraries/Animated/createAnimatedComponent.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Libraries/Animated/createAnimatedComponent.js b/Libraries/Animated/createAnimatedComponent.js index 45859bb111ca8c..c86e63cd88cd29 100644 --- a/Libraries/Animated/createAnimatedComponent.js +++ b/Libraries/Animated/createAnimatedComponent.js @@ -198,19 +198,6 @@ function createAnimatedComponent( setLocalRef: ref => { this._prevComponent = this._component; this._component = ref; - - // TODO: Delete this in a future release. - if (ref != null && ref.getNode == null) { - ref.getNode = () => { - console.warn( - '%s: Calling `getNode()` on the ref of an Animated component ' + - 'is no longer necessary. You can now directly use the ref ' + - 'instead. This method will be removed in a future release.', - ref.constructor.name ?? '<>', - ); - return ref; - }; - } }, }); From f598dd0ee3670075e8f9480aeb1489e7ad5c63e8 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Sun, 25 Apr 2021 01:16:50 -0700 Subject: [PATCH 056/259] RN: Create Experiment for `collapsable` (iOS) Summary: Sets up an experiment that enables `collapsable` in Fabric for iOS. This will enable us to validate with production data that enabling the use of this prop does not cause unexpected regressions. Changelog: [internal] Reviewed By: mdvacca Differential Revision: D27987619 fbshipit-source-id: 9b1c0ff45bed09b1e72ad7d9c782f07bb4211cc6 --- Libraries/Components/View/ViewInjection.js | 13 +++++++++++++ Libraries/Components/View/ViewNativeComponent.js | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Libraries/Components/View/ViewInjection.js diff --git a/Libraries/Components/View/ViewInjection.js b/Libraries/Components/View/ViewInjection.js new file mode 100644 index 00000000000000..d67512f5a57c47 --- /dev/null +++ b/Libraries/Components/View/ViewInjection.js @@ -0,0 +1,13 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict + * @format + */ + +export default { + unstable_enableCollapsable: false, +}; diff --git a/Libraries/Components/View/ViewNativeComponent.js b/Libraries/Components/View/ViewNativeComponent.js index 4ca5ec9cf3c479..4510d9bdab199b 100644 --- a/Libraries/Components/View/ViewNativeComponent.js +++ b/Libraries/Components/View/ViewNativeComponent.js @@ -13,8 +13,10 @@ import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import Platform from '../../Utilities/Platform'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid'; +import ViewInjection from './ViewInjection'; import {type ViewProps as Props} from './ViewPropTypes'; import * as React from 'react'; +import ReactNativeViewConfigRegistry from '../../Renderer/shims/ReactNativeViewConfigRegistry'; const ViewNativeComponent: HostComponent = NativeComponentRegistry.get( 'RCTView', @@ -24,6 +26,14 @@ const ViewNativeComponent: HostComponent = NativeComponentRegistry.get>, From 9cd98fa3eeded9f9bded846ac8ec94f05052a6c7 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Sun, 25 Apr 2021 16:14:03 -0700 Subject: [PATCH 057/259] Prevent redundant dispatches onto RuntimeExecutor queue in AsynchronousEventBeat::induce Summary: Changelog: [internal] Prevent redundant calls to RuntimeExecutor by making sure no two calls to the executor are scheduled at the same time. Reviewed By: mdvacca Differential Revision: D27989412 fbshipit-source-id: 8f9b1591f7c9c2265fd4b05bf3dc5505ffc2568b --- .../react/fabric/jni/AsyncEventBeatV2.cpp | 69 +++++++++++++++++++ .../react/fabric/jni/AsyncEventBeatV2.h | 40 +++++++++++ .../com/facebook/react/fabric/jni/Binding.cpp | 40 ++++++++--- 3 files changed, 139 insertions(+), 10 deletions(-) create mode 100644 ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.cpp create mode 100644 ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.h diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.cpp new file mode 100644 index 00000000000000..1d9b2dd27f2f60 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.cpp @@ -0,0 +1,69 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include +#include +#include + +#include "AsyncEventBeatV2.h" + +namespace facebook::react { + +AsyncEventBeatV2::AsyncEventBeatV2( + EventBeat::SharedOwnerBox const &ownerBox, + EventBeatManager *eventBeatManager, + RuntimeExecutor runtimeExecutor, + jni::global_ref javaUIManager) + : EventBeat(ownerBox), + eventBeatManager_(eventBeatManager), + runtimeExecutor_(runtimeExecutor), + javaUIManager_(javaUIManager) { + eventBeatManager->addObserver(*this); +} + +AsyncEventBeatV2::~AsyncEventBeatV2() { + eventBeatManager_->removeObserver(*this); +} + +void AsyncEventBeatV2::tick() const { + if (!isRequested_ || isBeatCallbackScheduled_) { + return; + } + + isRequested_ = false; + isBeatCallbackScheduled_ = true; + + runtimeExecutor_([this, ownerBox = ownerBox_](jsi::Runtime &runtime) { + isBeatCallbackScheduled_ = false; + auto owner = ownerBox->owner.lock(); + if (!owner) { + return; + } + + if (beatCallback_) { + beatCallback_(runtime); + } + }); +} + +void AsyncEventBeatV2::induce() const { + tick(); +} + +void AsyncEventBeatV2::request() const { + bool alreadyRequested = isRequested_; + EventBeat::request(); + if (!alreadyRequested) { + // Notifies java side that an event will be dispatched (e.g. LayoutEvent) + static auto onRequestEventBeat = + jni::findClassStatic("com/facebook/react/fabric/FabricUIManager") + ->getMethod("onRequestEventBeat"); + onRequestEventBeat(javaUIManager_); + } +} + +} // namespace facebook::react diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.h b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.h new file mode 100644 index 00000000000000..acd682f4cd856b --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include "EventBeatManager.h" + +namespace facebook::react { + +class AsyncEventBeatV2 final : public EventBeat, + public EventBeatManagerObserver { + public: + AsyncEventBeatV2( + EventBeat::SharedOwnerBox const &ownerBox, + EventBeatManager *eventBeatManager, + RuntimeExecutor runtimeExecutor, + jni::global_ref javaUIManager); + + ~AsyncEventBeatV2() override; + + void tick() const override; + + void induce() const override; + + void request() const override; + + private: + EventBeatManager *eventBeatManager_; + RuntimeExecutor runtimeExecutor_; + jni::global_ref javaUIManager_; + mutable std::atomic isBeatCallbackScheduled_{false}; +}; + +} // namespace facebook::react diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index 192f8493f9485b..631d20ee8cd736 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -7,6 +7,7 @@ #include "Binding.h" #include "AsyncEventBeat.h" +#include "AsyncEventBeatV2.h" #include "EventEmitterWrapper.h" #include "ReactNativeConfigHolder.h" #include "StateWrapperImpl.h" @@ -488,21 +489,40 @@ void Binding::installFabricUIManager( std::make_shared(jsMessageQueueThread); auto runtimeExecutor = runtimeExecutorHolder->cthis()->get(); + auto enableV2AsynchronousEventBeat = + config->getBool("react_fabric:enable_asynchronous_event_beat_v2_android"); + // TODO: T31905686 Create synchronous Event Beat jni::global_ref localJavaUIManager = javaUIManager_; EventBeat::Factory synchronousBeatFactory = - [eventBeatManager, runtimeExecutor, localJavaUIManager]( - EventBeat::SharedOwnerBox const &ownerBox) { - return std::make_unique( - ownerBox, eventBeatManager, runtimeExecutor, localJavaUIManager); - }; + [eventBeatManager, + runtimeExecutor, + localJavaUIManager, + enableV2AsynchronousEventBeat](EventBeat::SharedOwnerBox const &ownerBox) + -> std::unique_ptr { + if (enableV2AsynchronousEventBeat) { + return std::make_unique( + ownerBox, eventBeatManager, runtimeExecutor, localJavaUIManager); + } else { + return std::make_unique( + ownerBox, eventBeatManager, runtimeExecutor, localJavaUIManager); + } + }; EventBeat::Factory asynchronousBeatFactory = - [eventBeatManager, runtimeExecutor, localJavaUIManager]( - EventBeat::SharedOwnerBox const &ownerBox) { - return std::make_unique( - ownerBox, eventBeatManager, runtimeExecutor, localJavaUIManager); - }; + [eventBeatManager, + runtimeExecutor, + localJavaUIManager, + enableV2AsynchronousEventBeat](EventBeat::SharedOwnerBox const &ownerBox) + -> std::unique_ptr { + if (enableV2AsynchronousEventBeat) { + return std::make_unique( + ownerBox, eventBeatManager, runtimeExecutor, localJavaUIManager); + } else { + return std::make_unique( + ownerBox, eventBeatManager, runtimeExecutor, localJavaUIManager); + } + }; contextContainer->insert("ReactNativeConfig", config); contextContainer->insert("FabricUIManager", javaUIManager_); From 66ba89921a38c5f3084703ea383782c3cb5e1474 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 058/259] Differ tests: use react_native_assert(false) instead of FAIL() to get logs upon test failure Summary: Calling `FAIL()` doesn't flush glog, but `react_native_assert(false)` does. Both will have the effect of failing the test. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003334 fbshipit-source-id: 802ad1f59e46eb048fd6ca95f5978eeaaad83f3a --- .../renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp b/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp index 1362d2ee65ac0f..62d5c341b10bff 100644 --- a/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -121,7 +121,7 @@ static void testShadowNodeTreeLifeCycle( mutation.newChildShadowView.tag) != deletedTags.end()) { LOG(ERROR) << "Deleted tag was recreated in mutations list: [" << mutation.newChildShadowView.tag << "]"; - FAIL(); + react_native_assert(false); } } } @@ -159,7 +159,7 @@ static void testShadowNodeTreeLifeCycle( << getDebugDescription(mutations, {}); #endif - FAIL(); + react_native_assert(false); } currentRootNode = nextRootNode; @@ -269,7 +269,7 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( mutation.newChildShadowView.tag) != deletedTags.end()) { LOG(ERROR) << "Deleted tag was recreated in mutations list: [" << mutation.newChildShadowView.tag << "]"; - FAIL(); + react_native_assert(false); } } } @@ -307,7 +307,7 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( << getDebugDescription(mutations, {}); #endif - FAIL(); + react_native_assert(false); } currentRootNode = nextRootNode; From 1b4a5176d7f2420b64a0d0b44aca4ca4b8a00d5f Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 059/259] Testing mechanism to find new failing Differ test-cases Summary: This code can be uncommented locally and run several times to discover new failing seeds. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003333 fbshipit-source-id: 6a3b6c08ae02bccc5c4d26067409ff6c736f8a89 --- .../tests/ShadowTreeLifeCycleTest.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp b/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp index 62d5c341b10bff..3910504a1ee7ba 100644 --- a/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -16,6 +16,10 @@ #include #include +// Uncomment when random test blocks are uncommented below. +// #include +// #include + #include "Entropy.h" #include "shadowTreeGeneration.h" @@ -381,3 +385,20 @@ TEST( /* repeats */ 512, /* stages */ 32); } + +// You may uncomment this - locally only! - to generate failing seeds. +// TEST( +// ShadowTreeLifecyleTest, +// unstableSmallerTreeMoreIterationsExtensiveFlatteningUnflatteningManyRandom) +// { +// std::random_device device; +// for (int i = 0; i < 10; i++) { +// uint_fast32_t seed = device(); +// LOG(ERROR) << "Seed: " << seed; +// testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( +// /* seed */ seed, +// /* size */ 32, +// /* repeats */ 512, +// /* stages */ 32); +// } +// } From 3a99c7cdbbecfc93f669a07ab09a85947c226560 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 060/259] Differ: add failing test case 1167342011 which covers an existing error Summary: Found by running random tests and extracting a failing seed. This error existed in master (and existed prior to recent refactors) and will be fixed by the end of this stack. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003332 fbshipit-source-id: 9c4a10d236c24337b089c44e8c1beb22358cfb05 --- .../mounting/tests/ShadowTreeLifeCycleTest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp b/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp index 3910504a1ee7ba..e949f1357ef8c9 100644 --- a/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -386,6 +386,17 @@ TEST( /* stages */ 32); } +// failing test case found 4-25-2021 +TEST( + ShadowTreeLifecyleTest, + unstableSmallerTreeMoreIterationsExtensiveFlatteningUnflattening_1167342011) { + testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( + /* seed */ 1167342011, + /* size */ 32, + /* repeats */ 512, + /* stages */ 32); +} + // You may uncomment this - locally only! - to generate failing seeds. // TEST( // ShadowTreeLifecyleTest, From 11e166b9aad4a646f9bbf02199447fb9e2ac0429 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 061/259] Differ: refactor: use mutation container list to store all temporary mutations Summary: Simple refactor to use this struct to store lists instead of references to lists. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003337 fbshipit-source-id: a37fa23ed3c1e1b273f92bf5ad5179a0fd1d852b --- .../renderer/mounting/Differentiator.cpp | 240 +++++++++--------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index c23d7ee615354b..ba382011162467 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -346,20 +346,20 @@ static void calculateShadowViewMutationsV2( ShadowViewNodePair::NonOwningList &&newChildPairs); struct OrderedMutationInstructionContainer { - ShadowViewMutation::List &createMutations; - ShadowViewMutation::List &deleteMutations; - ShadowViewMutation::List &insertMutations; - ShadowViewMutation::List &removeMutations; - ShadowViewMutation::List &updateMutations; - ShadowViewMutation::List &downwardMutations; - ShadowViewMutation::List &destructiveDownwardMutations; + ShadowViewMutation::List createMutations{}; + ShadowViewMutation::List deleteMutations{}; + ShadowViewMutation::List insertMutations{}; + ShadowViewMutation::List removeMutations{}; + ShadowViewMutation::List updateMutations{}; + ShadowViewMutation::List downwardMutations{}; + ShadowViewMutation::List destructiveDownwardMutations{}; }; static void calculateShadowViewMutationsFlattener( BREADCRUMB_TYPE breadcrumb, ViewNodePairScope &scope, ReparentMode reparentMode, - OrderedMutationInstructionContainer &mutationInstructionContainer, + OrderedMutationInstructionContainer &mutationContainer, ShadowView const &parentShadowView, TinyMap &unvisitedFlattenedNodes, ShadowViewNodePair const &node, @@ -409,7 +409,7 @@ static void calculateShadowViewMutationsFlattener( BREADCRUMB_TYPE breadcrumb, ViewNodePairScope &scope, ReparentMode reparentMode, - OrderedMutationInstructionContainer &mutationInstructionContainer, + OrderedMutationInstructionContainer &mutationContainer, ShadowView const &parentShadowView, TinyMap &unvisitedOtherNodes, ShadowViewNodePair const &node, @@ -558,13 +558,13 @@ static void calculateShadowViewMutationsFlattener( react_native_assert(existsInOtherTree == treeChildPair.inOtherTree()); if (treeChildPair.inOtherTree() && treeChildPair.otherTreePair->isConcreteView) { - mutationInstructionContainer.removeMutations.push_back( + mutationContainer.removeMutations.push_back( ShadowViewMutation::RemoveMutation( node.shadowView, treeChildPair.otherTreePair->shadowView, static_cast(treeChildPair.mountIndex))); } else { - mutationInstructionContainer.removeMutations.push_back( + mutationContainer.removeMutations.push_back( ShadowViewMutation::RemoveMutation( node.shadowView, treeChildPair.shadowView, @@ -572,8 +572,8 @@ static void calculateShadowViewMutationsFlattener( } } else { // treeChildParent represents the "new" version of the node, so - // we can safely insert it - mutationInstructionContainer.insertMutations.push_back( + // we can safely insert it without checking in the other tree + mutationContainer.insertMutations.push_back( ShadowViewMutation::InsertMutation( node.shadowView, treeChildPair.shadowView, @@ -617,7 +617,7 @@ static void calculateShadowViewMutationsFlattener( if (newTreeNodePair.shadowView != oldTreeNodePair.shadowView && newTreeNodePair.isConcreteView && oldTreeNodePair.isConcreteView) { - mutationInstructionContainer.updateMutations.push_back( + mutationContainer.updateMutations.push_back( ShadowViewMutation::UpdateMutation( oldTreeNodePair.shadowView, newTreeNodePair.shadowView)); } @@ -631,7 +631,7 @@ static void calculateShadowViewMutationsFlattener( "(Un)Flattener trivial update of " + std::to_string(newTreeNodePair.shadowView.tag)), innerScope, - mutationInstructionContainer.downwardMutations, + mutationContainer.downwardMutations, newTreeNodePair.shadowView, sliceChildShadowNodeViewPairsFromViewNodePair( oldTreeNodePair, innerScope), @@ -662,7 +662,7 @@ static void calculateShadowViewMutationsFlattener( " old:" + std::to_string(treeChildPair.shadowView.tag)), scope, childReparentMode, - mutationInstructionContainer, + mutationContainer, (reparentMode == ReparentMode::Flatten ? parentShadowView : newTreeNodePair.shadowView), @@ -708,7 +708,7 @@ static void calculateShadowViewMutationsFlattener( " old:" + std::to_string(oldTreeNodePair.shadowView.tag)), scope, ReparentMode::Flatten, - mutationInstructionContainer, + mutationContainer, (reparentMode == ReparentMode::Flatten ? parentShadowView : newTreeNodePair.shadowView), @@ -767,7 +767,7 @@ static void calculateShadowViewMutationsFlattener( " new:" + std::to_string(newTreeNodePair.shadowView.tag)), scope, ReparentMode::Unflatten, - mutationInstructionContainer, + mutationContainer, (reparentMode == ReparentMode::Flatten ? parentShadowView : newTreeNodePair.shadowView), @@ -810,7 +810,7 @@ static void calculateShadowViewMutationsFlattener( // see this in dev after a few months, let's delete this // path. react_native_assert(false); - mutationInstructionContainer.deleteMutations.push_back( + mutationContainer.deleteMutations.push_back( ShadowViewMutation::DeleteMutation( oldFlattenedNode->shadowView)); @@ -819,8 +819,7 @@ static void calculateShadowViewMutationsFlattener( "Destroy " + std::to_string(oldFlattenedNode->shadowView.tag)), scope, - mutationInstructionContainer - .destructiveDownwardMutations, + mutationContainer.destructiveDownwardMutations, oldFlattenedNode->shadowView, sliceChildShadowNodeViewPairsFromViewNodePair( *oldFlattenedNode, scope), @@ -854,10 +853,10 @@ static void calculateShadowViewMutationsFlattener( // delete/create if the Concreteness of the node has changed. if (newTreeNodePair.isConcreteView != oldTreeNodePair.isConcreteView) { if (newTreeNodePair.isConcreteView) { - mutationInstructionContainer.createMutations.push_back( + mutationContainer.createMutations.push_back( ShadowViewMutation::CreateMutation(newTreeNodePair.shadowView)); } else { - mutationInstructionContainer.deleteMutations.push_back( + mutationContainer.deleteMutations.push_back( ShadowViewMutation::DeleteMutation(oldTreeNodePair.shadowView)); } } @@ -900,7 +899,7 @@ static void calculateShadowViewMutationsFlattener( } if (reparentMode == ReparentMode::Flatten) { - mutationInstructionContainer.deleteMutations.push_back( + mutationContainer.deleteMutations.push_back( ShadowViewMutation::DeleteMutation(treeChildPair.shadowView)); if (!treeChildPair.flattened) { @@ -910,14 +909,14 @@ static void calculateShadowViewMutationsFlattener( "Recursively delete tree child pair (flatten case): " + std::to_string(treeChildPair.shadowView.tag)), innerScope, - mutationInstructionContainer.destructiveDownwardMutations, + mutationContainer.destructiveDownwardMutations, treeChildPair.shadowView, sliceChildShadowNodeViewPairsFromViewNodePair( treeChildPair, innerScope), {}); } } else { - mutationInstructionContainer.createMutations.push_back( + mutationContainer.createMutations.push_back( ShadowViewMutation::CreateMutation(treeChildPair.shadowView)); if (!treeChildPair.flattened) { @@ -927,7 +926,7 @@ static void calculateShadowViewMutationsFlattener( "Recursively delete tree child pair (unflatten case): " + std::to_string(treeChildPair.shadowView.tag)), innerScope, - mutationInstructionContainer.downwardMutations, + mutationContainer.downwardMutations, treeChildPair.shadowView, {}, sliceChildShadowNodeViewPairsFromViewNodePair( @@ -951,21 +950,7 @@ static void calculateShadowViewMutationsV2( size_t index = 0; // Lists of mutations - auto createMutations = ShadowViewMutation::List{}; - auto deleteMutations = ShadowViewMutation::List{}; - auto insertMutations = ShadowViewMutation::List{}; - auto removeMutations = ShadowViewMutation::List{}; - auto updateMutations = ShadowViewMutation::List{}; - auto downwardMutations = ShadowViewMutation::List{}; - auto destructiveDownwardMutations = ShadowViewMutation::List{}; - auto mutationInstructionContainer = OrderedMutationInstructionContainer{ - createMutations, - deleteMutations, - insertMutations, - removeMutations, - updateMutations, - downwardMutations, - destructiveDownwardMutations}; + auto mutationContainer = OrderedMutationInstructionContainer{}; DEBUG_LOGS({ LOG(ERROR) << "Differ Entry: Child Pairs of node: [" << parentShadowView.tag @@ -1030,8 +1015,9 @@ static void calculateShadowViewMutationsV2( if (newChildPair.isConcreteView && oldChildPair.shadowView != newChildPair.shadowView) { - updateMutations.push_back(ShadowViewMutation::UpdateMutation( - oldChildPair.shadowView, newChildPair.shadowView)); + mutationContainer.updateMutations.push_back( + ShadowViewMutation::UpdateMutation( + oldChildPair.shadowView, newChildPair.shadowView)); } // Recursively update tree if ShadowNode pointers are not equal @@ -1047,8 +1033,9 @@ static void calculateShadowViewMutationsV2( "Stage 1: Recurse on " + std::to_string(oldChildPair.shadowView.tag)), innerScope, - *(newGrandChildPairs.size() ? &downwardMutations - : &destructiveDownwardMutations), + *(newGrandChildPairs.size() + ? &mutationContainer.downwardMutations + : &mutationContainer.destructiveDownwardMutations), oldChildPair.shadowView, std::move(oldGrandChildPairs), std::move(newGrandChildPairs)); @@ -1073,12 +1060,13 @@ static void calculateShadowViewMutationsV2( continue; } - deleteMutations.push_back( + mutationContainer.deleteMutations.push_back( ShadowViewMutation::DeleteMutation(oldChildPair.shadowView)); - removeMutations.push_back(ShadowViewMutation::RemoveMutation( - parentShadowView, - oldChildPair.shadowView, - static_cast(oldChildPair.mountIndex))); + mutationContainer.removeMutations.push_back( + ShadowViewMutation::RemoveMutation( + parentShadowView, + oldChildPair.shadowView, + static_cast(oldChildPair.mountIndex))); // We also have to call the algorithm recursively to clean up the entire // subtree starting from the removed view. @@ -1087,7 +1075,7 @@ static void calculateShadowViewMutationsV2( DIFF_BREADCRUMB( "Trivial delete " + std::to_string(oldChildPair.shadowView.tag)), innerScope, - destructiveDownwardMutations, + mutationContainer.destructiveDownwardMutations, oldChildPair.shadowView, sliceChildShadowNodeViewPairsFromViewNodePair( oldChildPair, innerScope), @@ -1109,11 +1097,12 @@ static void calculateShadowViewMutationsV2( continue; } - insertMutations.push_back(ShadowViewMutation::InsertMutation( - parentShadowView, - newChildPair.shadowView, - static_cast(newChildPair.mountIndex))); - createMutations.push_back( + mutationContainer.insertMutations.push_back( + ShadowViewMutation::InsertMutation( + parentShadowView, + newChildPair.shadowView, + static_cast(newChildPair.mountIndex))); + mutationContainer.createMutations.push_back( ShadowViewMutation::CreateMutation(newChildPair.shadowView)); ViewNodePairScope innerScope{}; @@ -1121,7 +1110,7 @@ static void calculateShadowViewMutationsV2( DIFF_BREADCRUMB( "Trivial create " + std::to_string(newChildPair.shadowView.tag)), innerScope, - downwardMutations, + mutationContainer.downwardMutations, newChildPair.shadowView, {}, sliceChildShadowNodeViewPairsFromViewNodePair( @@ -1172,18 +1161,20 @@ static void calculateShadowViewMutationsV2( // Create/Delete and Insert/Remove if necessary if (oldChildPair.isConcreteView != newChildPair.isConcreteView) { if (newChildPair.isConcreteView) { - insertMutations.push_back(ShadowViewMutation::InsertMutation( - parentShadowView, - newChildPair.shadowView, - static_cast(newChildPair.mountIndex))); - createMutations.push_back( + mutationContainer.insertMutations.push_back( + ShadowViewMutation::InsertMutation( + parentShadowView, + newChildPair.shadowView, + static_cast(newChildPair.mountIndex))); + mutationContainer.createMutations.push_back( ShadowViewMutation::CreateMutation(newChildPair.shadowView)); } else { - removeMutations.push_back(ShadowViewMutation::RemoveMutation( - parentShadowView, - oldChildPair.shadowView, - static_cast(oldChildPair.mountIndex))); - deleteMutations.push_back( + mutationContainer.removeMutations.push_back( + ShadowViewMutation::RemoveMutation( + parentShadowView, + oldChildPair.shadowView, + static_cast(oldChildPair.mountIndex))); + mutationContainer.deleteMutations.push_back( ShadowViewMutation::DeleteMutation(oldChildPair.shadowView)); } } else if ( @@ -1192,8 +1183,9 @@ static void calculateShadowViewMutationsV2( // concrete view. The case where they're different is handled // above. if (oldChildPair.shadowView != newChildPair.shadowView) { - updateMutations.push_back(ShadowViewMutation::UpdateMutation( - oldChildPair.shadowView, newChildPair.shadowView)); + mutationContainer.updateMutations.push_back( + ShadowViewMutation::UpdateMutation( + oldChildPair.shadowView, newChildPair.shadowView)); } // Remove from newRemainingPairs @@ -1234,7 +1226,7 @@ static void calculateShadowViewMutationsV2( std::to_string(oldChildPair.shadowView.tag)), scope, ReparentMode::Flatten, - mutationInstructionContainer, + mutationContainer, parentShadowView, newRemainingPairs, oldChildPair); @@ -1272,7 +1264,7 @@ static void calculateShadowViewMutationsV2( std::to_string(newChildPair.shadowView.tag)), scope, ReparentMode::Unflatten, - mutationInstructionContainer, + mutationContainer, parentShadowView, unvisitedOldChildPairs, newChildPair); @@ -1316,8 +1308,9 @@ static void calculateShadowViewMutationsV2( "Non-trivial update " + std::to_string(oldChildPair.shadowView.tag)), innerScope, - *(newGrandChildPairs.size() ? &downwardMutations - : &destructiveDownwardMutations), + *(newGrandChildPairs.size() + ? &mutationContainer.downwardMutations + : &mutationContainer.destructiveDownwardMutations), oldChildPair.shadowView, std::move(oldGrandChildPairs), std::move(newGrandChildPairs)); @@ -1373,7 +1366,7 @@ static void calculateShadowViewMutationsV2( "Flatten2 " + std::to_string(parentShadowView.tag)), scope, ReparentMode::Flatten, - mutationInstructionContainer, + mutationContainer, parentShadowView, newRemainingPairs, oldChildPair); @@ -1409,7 +1402,7 @@ static void calculateShadowViewMutationsV2( "Unflatten2 " + std::to_string(parentShadowView.tag)), scope, ReparentMode::Unflatten, - mutationInstructionContainer, + mutationContainer, parentShadowView, unvisitedOldChildPairs, newChildPair); @@ -1441,14 +1434,15 @@ static void calculateShadowViewMutationsV2( // loop, but not Remove if (oldChildPair.isConcreteView != newChildPair.isConcreteView) { if (newChildPair.isConcreteView) { - createMutations.push_back( + mutationContainer.createMutations.push_back( ShadowViewMutation::CreateMutation(newChildPair.shadowView)); } else { - removeMutations.push_back(ShadowViewMutation::RemoveMutation( - parentShadowView, - oldChildPair.shadowView, - static_cast(oldChildPair.mountIndex))); - deleteMutations.push_back( + mutationContainer.removeMutations.push_back( + ShadowViewMutation::RemoveMutation( + parentShadowView, + oldChildPair.shadowView, + static_cast(oldChildPair.mountIndex))); + mutationContainer.deleteMutations.push_back( ShadowViewMutation::DeleteMutation(oldChildPair.shadowView)); } } @@ -1462,14 +1456,16 @@ static void calculateShadowViewMutationsV2( // removes/inserts in cases of (un)flattening + reorders? // If removing here, we must remove the newest version of the View // - which will always be in the "new" tree. - removeMutations.push_back(ShadowViewMutation::RemoveMutation( - parentShadowView, - newChildPair.shadowView, - static_cast(oldChildPair.mountIndex))); + mutationContainer.removeMutations.push_back( + ShadowViewMutation::RemoveMutation( + parentShadowView, + newChildPair.shadowView, + static_cast(oldChildPair.mountIndex))); if (oldChildPair.shadowView != newChildPair.shadowView) { - updateMutations.push_back(ShadowViewMutation::UpdateMutation( - oldChildPair.shadowView, newChildPair.shadowView)); + mutationContainer.updateMutations.push_back( + ShadowViewMutation::UpdateMutation( + oldChildPair.shadowView, newChildPair.shadowView)); } } @@ -1488,8 +1484,9 @@ static void calculateShadowViewMutationsV2( "Non-trivial update3 " + std::to_string(oldChildPair.shadowView.tag)), innerScope, - *(newGrandChildPairs.size() ? &downwardMutations - : &destructiveDownwardMutations), + *(newGrandChildPairs.size() + ? &mutationContainer.downwardMutations + : &mutationContainer.destructiveDownwardMutations), oldChildPair.shadowView, std::move(oldGrandChildPairs), std::move(newGrandChildPairs)); @@ -1543,17 +1540,19 @@ static void calculateShadowViewMutationsV2( // Here we do *not" need to generate a potential DELETE mutation // because we know the view is concrete, and still in the new // hierarchy. - removeMutations.push_back(ShadowViewMutation::RemoveMutation( - parentShadowView, - otherTreeView, - static_cast(oldChildPair.mountIndex))); + mutationContainer.removeMutations.push_back( + ShadowViewMutation::RemoveMutation( + parentShadowView, + otherTreeView, + static_cast(oldChildPair.mountIndex))); continue; } - removeMutations.push_back(ShadowViewMutation::RemoveMutation( - parentShadowView, - oldChildPair.shadowView, - static_cast(oldChildPair.mountIndex))); + mutationContainer.removeMutations.push_back( + ShadowViewMutation::RemoveMutation( + parentShadowView, + oldChildPair.shadowView, + static_cast(oldChildPair.mountIndex))); deletionCandidatePairs.insert( {oldChildPair.shadowView.tag, &oldChildPair}); @@ -1576,10 +1575,11 @@ static void calculateShadowViewMutationsV2( << " with parent: [" << parentShadowView.tag << "]"; }); if (newChildPair.isConcreteView) { - insertMutations.push_back(ShadowViewMutation::InsertMutation( - parentShadowView, - newChildPair.shadowView, - static_cast(newChildPair.mountIndex))); + mutationContainer.insertMutations.push_back( + ShadowViewMutation::InsertMutation( + parentShadowView, + newChildPair.shadowView, + static_cast(newChildPair.mountIndex))); } // `inOtherTree` is only set to true during flattening/unflattening of @@ -1620,7 +1620,7 @@ static void calculateShadowViewMutationsV2( // This can happen when the parent is unflattened if (!oldChildPair.inOtherTree() && oldChildPair.isConcreteView) { - deleteMutations.push_back( + mutationContainer.deleteMutations.push_back( ShadowViewMutation::DeleteMutation(oldChildPair.shadowView)); // We also have to call the algorithm recursively to clean up the @@ -1631,7 +1631,7 @@ static void calculateShadowViewMutationsV2( "Non-trivial delete " + std::to_string(oldChildPair.shadowView.tag)), innerScope, - destructiveDownwardMutations, + mutationContainer.destructiveDownwardMutations, oldChildPair.shadowView, sliceChildShadowNodeViewPairsFromViewNodePair( oldChildPair, innerScope), @@ -1670,7 +1670,7 @@ static void calculateShadowViewMutationsV2( continue; } - createMutations.push_back( + mutationContainer.createMutations.push_back( ShadowViewMutation::CreateMutation(newChildPair.shadowView)); ViewNodePairScope innerScope{}; @@ -1679,7 +1679,7 @@ static void calculateShadowViewMutationsV2( "Non-trivial create " + std::to_string(newChildPair.shadowView.tag)), innerScope, - downwardMutations, + mutationContainer.downwardMutations, newChildPair.shadowView, {}, sliceChildShadowNodeViewPairsFromViewNodePair( @@ -1689,32 +1689,32 @@ static void calculateShadowViewMutationsV2( // All mutations in an optimal order: std::move( - destructiveDownwardMutations.begin(), - destructiveDownwardMutations.end(), + mutationContainer.destructiveDownwardMutations.begin(), + mutationContainer.destructiveDownwardMutations.end(), std::back_inserter(mutations)); std::move( - updateMutations.begin(), - updateMutations.end(), + mutationContainer.updateMutations.begin(), + mutationContainer.updateMutations.end(), std::back_inserter(mutations)); std::move( - removeMutations.rbegin(), - removeMutations.rend(), + mutationContainer.removeMutations.rbegin(), + mutationContainer.removeMutations.rend(), std::back_inserter(mutations)); std::move( - deleteMutations.begin(), - deleteMutations.end(), + mutationContainer.deleteMutations.begin(), + mutationContainer.deleteMutations.end(), std::back_inserter(mutations)); std::move( - createMutations.begin(), - createMutations.end(), + mutationContainer.createMutations.begin(), + mutationContainer.createMutations.end(), std::back_inserter(mutations)); std::move( - downwardMutations.begin(), - downwardMutations.end(), + mutationContainer.downwardMutations.begin(), + mutationContainer.downwardMutations.end(), std::back_inserter(mutations)); std::move( - insertMutations.begin(), - insertMutations.end(), + mutationContainer.insertMutations.begin(), + mutationContainer.insertMutations.end(), std::back_inserter(mutations)); } From 6e13040ecbb5313e1137c988eadfc9887ed2f53b Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 062/259] Differ: consolidate two code paths into updateMatchedPairSubtrees Summary: There's a lot of code duplication in the differ. Reduce by factoring a duplicated code path into `updateMatchedPairSubtrees`. This handles cases of updating trees with flattening or unflattening. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003339 fbshipit-source-id: cbbf890ba447b29d79aedea374b173de40e71334 --- .../renderer/mounting/Differentiator.cpp | 398 ++++++++---------- 1 file changed, 164 insertions(+), 234 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index ba382011162467..881d65d4c24dbf 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -336,7 +336,6 @@ static_assert( std::is_move_assignable::value, "`ShadowViewNodePair::NonOwningList` must be `move assignable`."); -// Forward declaration static void calculateShadowViewMutationsV2( BREADCRUMB_TYPE breadcrumb, ViewNodePairScope &scope, @@ -355,6 +354,17 @@ struct OrderedMutationInstructionContainer { ShadowViewMutation::List destructiveDownwardMutations{}; }; +static void updateMatchedPairSubtrees( + BREADCRUMB_TYPE breadcrumb, + ViewNodePairScope &scope, + OrderedMutationInstructionContainer &mutationContainer, + TinyMap &newRemainingPairs, + ShadowViewNodePair::NonOwningList &oldChildPairs, + ShadowViewNodePair::NonOwningList &newChildPairs, + ShadowView const &parentShadowView, + ShadowViewNodePair const &oldPair, + ShadowViewNodePair const &newPair); + static void calculateShadowViewMutationsFlattener( BREADCRUMB_TYPE breadcrumb, ViewNodePairScope &scope, @@ -367,6 +377,134 @@ static void calculateShadowViewMutationsFlattener( TinyMap *parentSubVisitedOtherOldNodes = nullptr); +/** + * Updates the subtrees of any matched ShadowViewNodePair. This handles + * all cases of flattening/unflattening. + * + * This may modify data-structures passed to it and owned by the caller, + * specifically `newRemainingPairs`, and so the caller must also own + * the ViewNodePairScope used within. + */ +static void updateMatchedPairSubtrees( + BREADCRUMB_TYPE breadcrumb, + ViewNodePairScope &scope, + OrderedMutationInstructionContainer &mutationContainer, + TinyMap &newRemainingPairs, + ShadowViewNodePair::NonOwningList &oldChildPairs, + ShadowViewNodePair::NonOwningList &newChildPairs, + ShadowView const &parentShadowView, + ShadowViewNodePair const &oldPair, + ShadowViewNodePair const &newPair) { + // Are we flattening or unflattening either one? If node was + // flattened in both trees, there's no change, just continue. + if (oldPair.flattened && newPair.flattened) { + return; + } + + // We are either flattening or unflattening this node. + if (oldPair.flattened != newPair.flattened) { + DEBUG_LOGS({ + LOG(ERROR) + << "Differ: flattening or unflattening in updateMatchedPairSubtrees: [" + << oldChildPair.shadowView.tag << "] [" << newChildPair.shadowView.tag + << "] " << oldChildPair.flattened << " " << newChildPair.flattened + << " with parent: [" << parentShadowView.tag << "]"; + }); + + // Flattening + if (!oldPair.flattened) { + // Flatten old tree into new list + // At the end of this loop we still want to know which of these + // children are visited, so we reuse the `newRemainingPairs` + // map. + calculateShadowViewMutationsFlattener( + DIFF_BREADCRUMB( + "Flatten tree " + std::to_string(parentShadowView.tag) + + " into list " + std::to_string(oldPair.shadowView.tag)), + scope, + ReparentMode::Flatten, + mutationContainer, + parentShadowView, + newRemainingPairs, + oldPair); + } + // Unflattening + else { + // Construct unvisited nodes map + auto unvisitedOldChildPairs = TinyMap{}; + // We don't know where all the children of oldChildPair are + // within oldChildPairs, but we know that they're in the same + // relative order. The reason for this is because of flattening + // + zIndex: the children could be listed before the parent, + // interwoven with children from other nodes, etc. + auto oldFlattenedNodes = + sliceChildShadowNodeViewPairsFromViewNodePair(oldPair, scope, true); + for (size_t i = 0, j = 0; + i < oldChildPairs.size() && j < oldFlattenedNodes.size(); + i++) { + auto &oldChild = *oldChildPairs[i]; + if (oldChild.shadowView.tag == oldFlattenedNodes[j]->shadowView.tag) { + unvisitedOldChildPairs.insert({oldChild.shadowView.tag, &oldChild}); + j++; + } + } + + // Unflatten old list into new tree + calculateShadowViewMutationsFlattener( + DIFF_BREADCRUMB( + "Unflatten old list " + std::to_string(parentShadowView.tag) + + " into new tree " + std::to_string(newChildPair.shadowView.tag)), + scope, + ReparentMode::Unflatten, + mutationContainer, + parentShadowView, + unvisitedOldChildPairs, + newPair); + + // If old nodes were not visited, we know that we can delete + // them now. They will be removed from the hierarchy by the + // outermost loop of this function. + // TODO: is this necessary anymore? + for (auto &oldFlattenedNodePtr : oldFlattenedNodes) { + auto &oldFlattenedNode = *oldFlattenedNodePtr; + auto unvisitedOldChildPairIt = + unvisitedOldChildPairs.find(oldFlattenedNode.shadowView.tag); + if (unvisitedOldChildPairIt == unvisitedOldChildPairs.end()) { + // Node was visited - make sure to remove it from + // "newRemainingPairs" map + auto newRemainingIt = + newRemainingPairs.find(oldFlattenedNode.shadowView.tag); + if (newRemainingIt != newRemainingPairs.end()) { + newRemainingPairs.erase(newRemainingIt); + } + } + } + } + + return; + } + + // Update subtrees if View is not flattened, and if node addresses + // are not equal + if (oldPair.shadowNode != newPair.shadowNode) { + ViewNodePairScope innerScope{}; + auto oldGrandChildPairs = + sliceChildShadowNodeViewPairsFromViewNodePair(oldPair, innerScope); + auto newGrandChildPairs = + sliceChildShadowNodeViewPairsFromViewNodePair(newPair, innerScope); + calculateShadowViewMutationsV2( + DIFF_BREADCRUMB( + "Non-trivial update " + std::to_string(oldPair.shadowView.tag)), + innerScope, + *(newGrandChildPairs.size() + ? &mutationContainer.downwardMutations + : &mutationContainer.destructiveDownwardMutations), + oldPair.shadowView, + std::move(oldGrandChildPairs), + std::move(newGrandChildPairs)); + } +} + /** * Here we flatten or unflatten a subtree, given an unflattened node in either * the old or new tree, and a list of flattened nodes in the other tree. @@ -1189,132 +1327,25 @@ static void calculateShadowViewMutationsV2( } // Remove from newRemainingPairs + // TODO: do we still need to do this? auto newRemainingPairIt = newRemainingPairs.find(oldTag); if (newRemainingPairIt != newRemainingPairs.end()) { newRemainingPairs.erase(newRemainingPairIt); } } - // Are we flattening or unflattening either one? If node was - // flattened in both trees, there's no change, just continue. - if (oldChildPair.flattened && newChildPair.flattened) { - newIndex++; - oldIndex++; - continue; - } - // We are either flattening or unflattening this node. - if (oldChildPair.flattened != newChildPair.flattened) { - DEBUG_LOGS({ - LOG(ERROR) << "Differ: flattening or unflattening at branch 6: [" - << oldChildPair.shadowView.tag << "] [" - << newChildPair.shadowView.tag << "] " - << oldChildPair.flattened << " " - << newChildPair.flattened << " with parent: [" - << parentShadowView.tag << "]"; - }); - - // Flattening - if (!oldChildPair.flattened) { - // Flatten old tree into new list - // At the end of this loop we still want to know which of these - // children are visited, so we reuse the `newRemainingPairs` - // map. - calculateShadowViewMutationsFlattener( - DIFF_BREADCRUMB( - "Flatten tree " + std::to_string(parentShadowView.tag) + - " into list " + - std::to_string(oldChildPair.shadowView.tag)), - scope, - ReparentMode::Flatten, - mutationContainer, - parentShadowView, - newRemainingPairs, - oldChildPair); - } - // Unflattening - else { - // Construct unvisited nodes map - auto unvisitedOldChildPairs = - TinyMap{}; - // We don't know where all the children of oldChildPair are - // within oldChildPairs, but we know that they're in the same - // relative order. The reason for this is because of flattening - // + zIndex: the children could be listed before the parent, - // interwoven with children from other nodes, etc. - auto oldFlattenedNodes = - sliceChildShadowNodeViewPairsFromViewNodePair( - oldChildPair, scope, true); - for (size_t i = 0, j = 0; - i < oldChildPairs.size() && j < oldFlattenedNodes.size(); - i++) { - auto &oldChild = *oldChildPairs[i]; - if (oldChild.shadowView.tag == - oldFlattenedNodes[j]->shadowView.tag) { - unvisitedOldChildPairs.insert( - {oldChild.shadowView.tag, &oldChild}); - j++; - } - } - - // Unflatten old list into new tree - calculateShadowViewMutationsFlattener( - DIFF_BREADCRUMB( - "Unflatten old list " + - std::to_string(parentShadowView.tag) + " into new tree " + - std::to_string(newChildPair.shadowView.tag)), - scope, - ReparentMode::Unflatten, - mutationContainer, - parentShadowView, - unvisitedOldChildPairs, - newChildPair); - - // If old nodes were not visited, we know that we can delete - // them now. They will be removed from the hierarchy by the - // outermost loop of this function. - for (auto &oldFlattenedNodePtr : oldFlattenedNodes) { - auto &oldFlattenedNode = *oldFlattenedNodePtr; - auto unvisitedOldChildPairIt = unvisitedOldChildPairs.find( - oldFlattenedNode.shadowView.tag); - if (unvisitedOldChildPairIt == unvisitedOldChildPairs.end()) { - // Node was visited - make sure to remove it from - // "newRemainingPairs" map - auto newRemainingIt = - newRemainingPairs.find(oldFlattenedNode.shadowView.tag); - if (newRemainingIt != newRemainingPairs.end()) { - newRemainingPairs.erase(newRemainingIt); - } - } - } - } - - newIndex++; - oldIndex++; - continue; - } - - // Update subtrees if View is not flattened, and if node addresses - // are not equal - if (oldChildPair.shadowNode != newChildPair.shadowNode) { - ViewNodePairScope innerScope{}; - auto oldGrandChildPairs = - sliceChildShadowNodeViewPairsFromViewNodePair( - oldChildPair, innerScope); - auto newGrandChildPairs = - sliceChildShadowNodeViewPairsFromViewNodePair( - newChildPair, innerScope); - calculateShadowViewMutationsV2( - DIFF_BREADCRUMB( - "Non-trivial update " + - std::to_string(oldChildPair.shadowView.tag)), - innerScope, - *(newGrandChildPairs.size() - ? &mutationContainer.downwardMutations - : &mutationContainer.destructiveDownwardMutations), - oldChildPair.shadowView, - std::move(oldGrandChildPairs), - std::move(newGrandChildPairs)); - } + updateMatchedPairSubtrees( + DIFF_BREADCRUMB( + "Update Matched Pair Subtrees (1): " + + std::to_string(oldChildPair.shadowView.tag)), + scope, + mutationContainer, + newRemainingPairs, + oldChildPairs, + newChildPairs, + parentShadowView, + oldChildPair, + newChildPair); newIndex++; oldIndex++; @@ -1337,96 +1368,18 @@ static void calculateShadowViewMutationsV2( if (insertedIt != newInsertedPairs.end()) { auto const &newChildPair = *insertedIt->second; - // The node has been reordered and we are also flattening or - // unflattening - if (oldChildPair.flattened != newChildPair.flattened) { - DEBUG_LOGS({ - LOG(ERROR) - << "Differ: branch 7: Flattening or unflattening already-inserted node upon remove (move/reorder operation)." - << oldChildPair.shadowView.tag << " " - << oldChildPair.flattened << " // " - << newChildPair.shadowView.tag << " " - << newChildPair.flattened; - }); - - // Unflattening. - // The node in question was already inserted and we are - // *unflattening* it, so we just need to update the subtree nodes - // and remove them from the view hierarchy. Any of the unvisited - // nodes in the old tree will be deleted. - // TODO: can we consolidate this code? It's identical to the first - // block above. - if (!oldChildPair.flattened) { - // Flatten old tree into new list - // At the end of this loop we still want to know which of these - // children are visited, so we reuse the `newRemainingPairs` - // map. - calculateShadowViewMutationsFlattener( - DIFF_BREADCRUMB( - "Flatten2 " + std::to_string(parentShadowView.tag)), - scope, - ReparentMode::Flatten, - mutationContainer, - parentShadowView, - newRemainingPairs, - oldChildPair); - } - // Unflattening - else { - // Construct unvisited nodes map - auto unvisitedOldChildPairs = - TinyMap{}; - // We don't know where all the children of oldChildPair are - // within oldChildPairs, but we know that they're in the same - // relative order. The reason for this is because of flattening - // + zIndex: the children could be listed before the parent, - // interwoven with children from other nodes, etc. - auto oldFlattenedNodes = - sliceChildShadowNodeViewPairsFromViewNodePair( - oldChildPair, scope, true); - for (size_t i = 0, j = 0; - i < oldChildPairs.size() && j < oldFlattenedNodes.size(); - i++) { - auto &oldChild = *oldChildPairs[i]; - if (oldChild.shadowView.tag == - oldFlattenedNodes[j]->shadowView.tag) { - unvisitedOldChildPairs.insert( - {oldChild.shadowView.tag, &oldChild}); - j++; - } - } - - // Unflatten old list into new tree - calculateShadowViewMutationsFlattener( - DIFF_BREADCRUMB( - "Unflatten2 " + std::to_string(parentShadowView.tag)), - scope, - ReparentMode::Unflatten, - mutationContainer, - parentShadowView, - unvisitedOldChildPairs, - newChildPair); - - // If old nodes were not visited, we know that we can delete - // them now. They will be removed from the hierarchy by the - // outermost loop of this function. TODO: delete recursively? - // create recursively? - for (auto &oldFlattenedNodePtr : oldFlattenedNodes) { - auto &oldFlattenedNode = *oldFlattenedNodePtr; - auto unvisitedOldChildPairIt = unvisitedOldChildPairs.find( - oldFlattenedNode.shadowView.tag); - if (unvisitedOldChildPairIt == unvisitedOldChildPairs.end()) { - // Node was visited - make sure to remove it from - // "newRemainingPairs" map - auto newRemainingIt = - newRemainingPairs.find(oldFlattenedNode.shadowView.tag); - if (newRemainingIt != newRemainingPairs.end()) { - newRemainingPairs.erase(newRemainingIt); - } - } - } - } - } + updateMatchedPairSubtrees( + DIFF_BREADCRUMB( + "Update Matched Pair Subtrees (2): " + + std::to_string(oldChildPair.shadowView.tag)), + scope, + mutationContainer, + newRemainingPairs, + oldChildPairs, + newChildPairs, + parentShadowView, + oldChildPair, + newChildPair); // Check concrete-ness of views // Create/Delete and Insert/Remove if necessary @@ -1469,29 +1422,6 @@ static void calculateShadowViewMutationsV2( } } - if (!oldChildPair.flattened && !newChildPair.flattened && - oldChildPair.shadowNode != newChildPair.shadowNode) { - // Update subtrees - ViewNodePairScope innerScope{}; - auto oldGrandChildPairs = - sliceChildShadowNodeViewPairsFromViewNodePair( - oldChildPair, innerScope); - auto newGrandChildPairs = - sliceChildShadowNodeViewPairsFromViewNodePair( - newChildPair, innerScope); - calculateShadowViewMutationsV2( - DIFF_BREADCRUMB( - "Non-trivial update3 " + - std::to_string(oldChildPair.shadowView.tag)), - innerScope, - *(newGrandChildPairs.size() - ? &mutationContainer.downwardMutations - : &mutationContainer.destructiveDownwardMutations), - oldChildPair.shadowView, - std::move(oldGrandChildPairs), - std::move(newGrandChildPairs)); - } - newInsertedPairs.erase(insertedIt); oldIndex++; continue; From 08a1531a1f579b61fffc9344cd06d618d29dd29f Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 063/259] Differ: simplify flatten/unflatten logic Summary: Since each ShadowViewNodePair will point to any matched pair in the "other" tree during diffing, we can rely on the presence of the "other" pointer instead of always removing nodes from `deletionCreationCandidatePairs` when they're matched. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003335 fbshipit-source-id: 0b886946eedc497091ca79c436f160b3d4bf3f1e --- .../react/renderer/mounting/Differentiator.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index 881d65d4c24dbf..69046c14eaabad 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -854,21 +854,6 @@ static void calculateShadowViewMutationsFlattener( oldTreeNodePair, subVisitedNewMap, subVisitedOldMap); - - for (auto newFlattenedNode : newFlattenedNodes) { - auto unvisitedOldChildPairIt = - unvisitedNewChildPairs.find(newFlattenedNode->shadowView.tag); - - if (unvisitedOldChildPairIt == unvisitedNewChildPairs.end()) { - // Node was visited. - - auto deleteCreateIt = deletionCreationCandidatePairs.find( - newFlattenedNode->shadowView.tag); - if (deleteCreateIt != deletionCreationCandidatePairs.end()) { - deletionCreationCandidatePairs.erase(deleteCreateIt); - } - } - } } // Flatten parent, unflatten child else { From 1b83922cb67e7d5041a71e12bab3253b862c96e2 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 064/259] Differ: delete impossible and redundant blocks Summary: These blocks either are not necessary due to other mechanisms, or are impossible to hit. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003336 fbshipit-source-id: f2321073de77c0f0173a9a0891be2a3012578b01 --- .../renderer/mounting/Differentiator.cpp | 46 +++---------------- 1 file changed, 7 insertions(+), 39 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index 69046c14eaabad..71306025afc742 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -915,6 +915,8 @@ static void calculateShadowViewMutationsFlattener( [&tag](ShadowViewNodePair *nodePair) { return nodePair->shadowView.tag == tag; }); + react_native_assert( + oldRemainingChildInListIt != treeChildren.end()); if (oldRemainingChildInListIt != treeChildren.end()) { auto deleteCreateIt = deletionCreationCandidatePairs.find( oldFlattenedNode->shadowView.tag); @@ -923,30 +925,6 @@ static void calculateShadowViewMutationsFlattener( deletionCreationCandidatePairs.insert( {tag, *oldRemainingChildInListIt}); } - } else { - // TODO: we might want to remove this block. It seems - // impossible to hit this logically (and empirically, - // after testing on lots of randomized and pathologically - // constructed trees) but I'm leaving this here out of an - // abundance of caution. - // In theory, this path should never be hit. If we don't - // see this in dev after a few months, let's delete this - // path. - react_native_assert(false); - mutationContainer.deleteMutations.push_back( - ShadowViewMutation::DeleteMutation( - oldFlattenedNode->shadowView)); - - calculateShadowViewMutationsV2( - DIFF_BREADCRUMB( - "Destroy " + - std::to_string(oldFlattenedNode->shadowView.tag)), - scope, - mutationContainer.destructiveDownwardMutations, - oldFlattenedNode->shadowView, - sliceChildShadowNodeViewPairsFromViewNodePair( - *oldFlattenedNode, scope), - {}); } } } else { @@ -957,13 +935,6 @@ static void calculateShadowViewMutationsFlattener( if (newRemainingIt != unvisitedOtherNodes.end()) { unvisitedOtherNodes.erase(newRemainingIt); } - - // We also remove it from delete/creation candidates - auto deleteCreateIt = deletionCreationCandidatePairs.find( - oldFlattenedNode->shadowView.tag); - if (deleteCreateIt != deletionCreationCandidatePairs.end()) { - deletionCreationCandidatePairs.erase(deleteCreateIt); - } } } } @@ -1016,7 +987,11 @@ static void calculateShadowViewMutationsFlattener( } auto &treeChildPair = *it->second; - // If node was visited during a flattening/unflattening recursion. + // If node was visited during a flattening/unflattening recursion, + // and the node in the other tree is concrete, that means it was + // already created/deleted and we don't need to do that here. + // It is always the responsibility of the matcher to update subtrees when + // nodes are matched. if (treeChildPair.inOtherTree()) { continue; } @@ -1310,13 +1285,6 @@ static void calculateShadowViewMutationsV2( ShadowViewMutation::UpdateMutation( oldChildPair.shadowView, newChildPair.shadowView)); } - - // Remove from newRemainingPairs - // TODO: do we still need to do this? - auto newRemainingPairIt = newRemainingPairs.find(oldTag); - if (newRemainingPairIt != newRemainingPairs.end()) { - newRemainingPairs.erase(newRemainingPairIt); - } } updateMatchedPairSubtrees( From 2c62e02b2b09c40745849b8ea4061d7d807ce80d Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 065/259] Differ: comments Summary: Just adding a comment for future possible refactoring here. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003338 fbshipit-source-id: ec307314d18d69f8c77c2b2afff1f3953ca55473 --- ReactCommon/react/renderer/mounting/Differentiator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index 71306025afc742..a9c5f5b48251cb 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -753,6 +753,10 @@ static void calculateShadowViewMutationsFlattener( continue; } + // TODO: compare ShadowNode pointer instead of ShadowView here? + // Or ShadowNode ptr comparison before comparing ShadowView, to allow for + // short-circuiting? ShadowView comparison is relatively expensive vs + // ShadowNode. if (newTreeNodePair.shadowView != oldTreeNodePair.shadowView && newTreeNodePair.isConcreteView && oldTreeNodePair.isConcreteView) { mutationContainer.updateMutations.push_back( From 4bc81422ed5318e0cd2556de4883f40b6cb5e3f9 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 066/259] Differ: fix debug log compilation Summary: Only compiles when debug flags are added locally. This fixes compiler errors. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003331 fbshipit-source-id: 0383f41bbb405a1b089f155d2a7f3398795ac965 --- ReactCommon/react/renderer/mounting/Differentiator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index a9c5f5b48251cb..ea9b2813db7995 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -406,9 +406,9 @@ static void updateMatchedPairSubtrees( DEBUG_LOGS({ LOG(ERROR) << "Differ: flattening or unflattening in updateMatchedPairSubtrees: [" - << oldChildPair.shadowView.tag << "] [" << newChildPair.shadowView.tag - << "] " << oldChildPair.flattened << " " << newChildPair.flattened - << " with parent: [" << parentShadowView.tag << "]"; + << oldPair.shadowView.tag << "] [" << newPair.shadowView.tag << "] " + << oldPair.flattened << " " << newPair.flattened << " with parent: [" + << parentShadowView.tag << "]"; }); // Flattening @@ -453,7 +453,7 @@ static void updateMatchedPairSubtrees( calculateShadowViewMutationsFlattener( DIFF_BREADCRUMB( "Unflatten old list " + std::to_string(parentShadowView.tag) + - " into new tree " + std::to_string(newChildPair.shadowView.tag)), + " into new tree " + std::to_string(newPair.shadowView.tag)), scope, ReparentMode::Unflatten, mutationContainer, From ca3aae7980d4a4059f9078f44bba8ab90385c34a Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH 067/259] Differ: fix unit test case 1167342011 Summary: Unit test case seed 1167342011 encodes a case where the differ produces a DELETE and CREATE of the same node in the same frame, which we consider an error. It turns out this was caused by nested "unflatten" operations and this bit of deleted code specifically. We were deleting an unmatched node from a parent call's dictionary of nodes, which prevented it from being matched in the "old" tree later on. This is only possible now that we attach pointers to the "other" ViewNodePair when they're matched, so we can check existence of that pointer instead of inclusion in dictionaries to decide if we need to DELETE/CREATE a node and its subtree. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003330 fbshipit-source-id: 305440ef20b921883c1d6e38a4a4072e5a7f95ac --- ReactCommon/react/renderer/mounting/Differentiator.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index ea9b2813db7995..f66dfa0a8969e3 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -963,10 +963,6 @@ static void calculateShadowViewMutationsFlattener( {newTreeNodePair.shadowView.tag, &newTreeNodePair}); subVisitedOldMap->insert( {oldTreeNodePair.shadowView.tag, &oldTreeNodePair}); - - if (unvisitedIt != unvisitedOtherNodes.end()) { - unvisitedOtherNodes.erase(unvisitedIt); - } } else { // Node does not in exist in other tree. if (treeChildPair.isConcreteView && !treeChildPair.inOtherTree()) { From 0afd71a18d19edef3d6603cabd2672ffde5ba30e Mon Sep 17 00:00:00 2001 From: Kacie Bawiec Date: Mon, 26 Apr 2021 12:49:37 -0700 Subject: [PATCH 068/259] Convert require to import in Libraries/Components Summary: Changelog: [General][Changed] Convert require statements to use import from in Libraries/Components Reviewed By: lunaleaps Differential Revision: D27921557 fbshipit-source-id: 3f1618455a47a56c4a090f3ececfef88476c0b8a --- .../ActivityIndicator/ActivityIndicator.js | 10 +++--- Libraries/Components/Button.js | 17 +++++---- .../DatePicker/DatePickerIOS.android.js | 9 +++-- .../DatePicker/DatePickerIOS.ios.js | 9 +++-- Libraries/Components/Keyboard/Keyboard.js | 2 +- .../MaskedView/MaskedViewIOS.ios.js | 6 ++-- Libraries/Components/Picker/Picker.js | 15 ++++---- Libraries/Components/Picker/PickerIOS.ios.js | 19 +++++----- .../ProgressViewIOS.android.js | 9 +++-- .../ProgressViewIOS/ProgressViewIOS.ios.js | 5 ++- .../__mocks__/RefreshControlMock.js | 5 ++- ...roidHorizontalScrollViewNativeComponent.js | 4 +-- .../ScrollContentViewNativeComponent.js | 4 +-- .../ScrollView/ScrollViewNativeComponent.js | 4 +-- .../SegmentedControlIOS.android.js | 9 +++-- Libraries/Components/Slider/Slider.js | 11 +++--- Libraries/Components/StatusBar/StatusBar.js | 9 +++-- .../AndroidTextInputNativeComponent.js | 7 ++-- .../TextInput/AndroidTextInputViewConfig.js | 2 +- .../TextInput/InputAccessoryView.js | 12 +++---- .../RCTMultilineTextInputNativeComponent.js | 2 +- .../RCTSingelineTextInputNativeComponent.js | 2 +- .../TextInput/RCTTextInputViewConfig.js | 2 +- Libraries/Components/TextInput/TextInput.js | 36 +++++++++++-------- .../Touchable/BoundingDimensions.js | 3 +- Libraries/Components/Touchable/PooledClass.js | 3 +- Libraries/Components/Touchable/Position.js | 3 +- Libraries/Components/Touchable/Touchable.js | 12 +++---- .../Touchable/ensurePositiveDelayProps.js | 3 +- .../UnimplementedViews/UnimplementedView.js | 5 ++- .../View/ReactNativeStyleAttributes.js | 14 ++++---- .../View/ReactNativeViewAttributes.js | 3 +- .../View/ReactNativeViewViewConfig.js | 2 +- 33 files changed, 125 insertions(+), 133 deletions(-) diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 6202d610d95e22..9100cf6483de2a 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -10,14 +10,12 @@ */ 'use strict'; - -const Platform = require('../../Utilities/Platform'); -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const View = require('../View/View'); +import * as React from 'react'; +import Platform from '../../Utilities/Platform'; +import StyleSheet, {type ColorValue} from '../../StyleSheet/StyleSheet'; +import View from '../View/View'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ViewProps} from '../View/ViewPropTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; const PlatformActivityIndicator = Platform.OS === 'android' diff --git a/Libraries/Components/Button.js b/Libraries/Components/Button.js index a235b375d02a06..c1f1987f4a5aec 100644 --- a/Libraries/Components/Button.js +++ b/Libraries/Components/Button.js @@ -11,18 +11,17 @@ 'use strict'; -const Platform = require('../Utilities/Platform'); -const React = require('react'); -const StyleSheet = require('../StyleSheet/StyleSheet'); -const Text = require('../Text/Text'); -const TouchableNativeFeedback = require('./Touchable/TouchableNativeFeedback'); -const TouchableOpacity = require('./Touchable/TouchableOpacity'); -const View = require('./View/View'); -const invariant = require('invariant'); +import * as React from 'react'; +import Platform from '../Utilities/Platform'; +import StyleSheet, {type ColorValue} from '../StyleSheet/StyleSheet'; +import Text from '../Text/Text'; +import TouchableNativeFeedback from './Touchable/TouchableNativeFeedback'; +import TouchableOpacity from './Touchable/TouchableOpacity'; +import View from './View/View'; +import invariant from 'invariant'; import type {AccessibilityState} from './View/ViewAccessibility'; import type {PressEvent} from '../Types/CoreEventTypes'; -import type {ColorValue} from '../StyleSheet/StyleSheet'; type ButtonProps = $ReadOnly<{| /** diff --git a/Libraries/Components/DatePicker/DatePickerIOS.android.js b/Libraries/Components/DatePicker/DatePickerIOS.android.js index 4c26ab962855b0..a3531c770b42b1 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.android.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.android.js @@ -8,11 +8,10 @@ */ 'use strict'; - -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const Text = require('../../Text/Text'); -const View = require('../View/View'); +import * as React from 'react'; +import StyleSheet from '../../StyleSheet/StyleSheet'; +import Text from '../../Text/Text'; +import View from '../View/View'; class DummyDatePickerIOS extends React.Component { render() { diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index a501a0eccc8210..30cc13ad55f0b0 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -10,14 +10,13 @@ // This is a controlled component version of RCTDatePickerIOS. +import * as React from 'react'; import RCTDatePickerNativeComponent, { Commands as DatePickerCommands, } from './RCTDatePickerNativeComponent'; -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const View = require('../View/View'); - -const invariant = require('invariant'); +import StyleSheet from '../../StyleSheet/StyleSheet'; +import View from '../View/View'; +import invariant from 'invariant'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; import type {ViewProps} from '../View/ViewPropTypes'; diff --git a/Libraries/Components/Keyboard/Keyboard.js b/Libraries/Components/Keyboard/Keyboard.js index 6227b975adf12c..fec163cd2845cd 100644 --- a/Libraries/Components/Keyboard/Keyboard.js +++ b/Libraries/Components/Keyboard/Keyboard.js @@ -13,7 +13,7 @@ import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation'; import dismissKeyboard from '../../Utilities/dismissKeyboard'; import Platform from '../../Utilities/Platform'; import NativeKeyboardObserver from './NativeKeyboardObserver'; -import {type EventSubscription} from '../../vendor/emitter/EventEmitter'; +import type {EventSubscription} from '../../vendor/emitter/EventEmitter'; export type KeyboardEventName = $Keys; diff --git a/Libraries/Components/MaskedView/MaskedViewIOS.ios.js b/Libraries/Components/MaskedView/MaskedViewIOS.ios.js index 4a32d29836f8d0..eb69fc4233affc 100644 --- a/Libraries/Components/MaskedView/MaskedViewIOS.ios.js +++ b/Libraries/Components/MaskedView/MaskedViewIOS.ios.js @@ -8,9 +8,9 @@ * @flow */ -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const View = require('../View/View'); +import * as React from 'react'; +import StyleSheet from '../../StyleSheet/StyleSheet'; +import View from '../View/View'; import type {ViewProps} from '../View/ViewPropTypes'; import RCTMaskedViewNativeComponent from './RCTMaskedViewNativeComponent'; diff --git a/Libraries/Components/Picker/Picker.js b/Libraries/Components/Picker/Picker.js index 7a733f32637bcf..0a3ac3bd3d99ea 100644 --- a/Libraries/Components/Picker/Picker.js +++ b/Libraries/Components/Picker/Picker.js @@ -10,14 +10,13 @@ 'use strict'; -const PickerAndroid = require('./PickerAndroid'); -const PickerIOS = require('./PickerIOS'); -const Platform = require('../../Utilities/Platform'); -const React = require('react'); -const UnimplementedView = require('../UnimplementedViews/UnimplementedView'); - -import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import * as React from 'react'; +import PickerAndroid from './PickerAndroid'; +import PickerIOS from './PickerIOS'; +import Platform from '../../Utilities/Platform'; +import UnimplementedView from '../UnimplementedViews/UnimplementedView'; + +import type {TextStyleProp, ColorValue} from '../../StyleSheet/StyleSheet'; const MODE_DIALOG = 'dialog'; const MODE_DROPDOWN = 'dropdown'; diff --git a/Libraries/Components/Picker/PickerIOS.ios.js b/Libraries/Components/Picker/PickerIOS.ios.js index fcdecf2f5934d5..93c1c4821cfab2 100644 --- a/Libraries/Components/Picker/PickerIOS.ios.js +++ b/Libraries/Components/Picker/PickerIOS.ios.js @@ -10,19 +10,20 @@ // This is a controlled component version of RCTPickerIOS. -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const View = require('../View/View'); - -const invariant = require('invariant'); -const processColor = require('../../StyleSheet/processColor'); +import * as React from 'react'; +import StyleSheet, { + type TextStyleProp, + type ColorValue, +} from '../../StyleSheet/StyleSheet'; +import View from '../View/View'; +import invariant from 'invariant'; +import processColor, { + type ProcessedColorValue, +} from '../../StyleSheet/processColor'; import RCTPickerNativeComponent, { Commands as PickerCommands, } from './RCTPickerNativeComponent'; -import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {ProcessedColorValue} from '../../StyleSheet/processColor'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; import type {ViewProps} from '../View/ViewPropTypes'; diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js index 8396ac4e87981e..d642a6545ab5bb 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js @@ -8,11 +8,10 @@ */ 'use strict'; - -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const Text = require('../../Text/Text'); -const View = require('../View/View'); +import * as React from 'react'; +import StyleSheet from '../../StyleSheet/StyleSheet'; +import Text from '../../Text/Text'; +import View from '../View/View'; class DummyProgressViewIOS extends React.Component { render() { diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js index c3f5352e68740d..d465440d174872 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js @@ -8,12 +8,11 @@ * @flow strict-local */ -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); +import * as React from 'react'; +import StyleSheet, {type ColorValue} from '../../StyleSheet/StyleSheet'; import RCTProgressViewNativeComponent from './RCTProgressViewNativeComponent'; import type {ImageSource} from '../../Image/ImageSource'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; type Props = $ReadOnly<{| diff --git a/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js b/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js index 40d41abbdc68ec..696eaa37ae7d2d 100644 --- a/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +++ b/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js @@ -9,10 +9,9 @@ */ 'use strict'; +import * as React from 'react'; -const React = require('react'); - -const requireNativeComponent = require('../../../ReactNative/requireNativeComponent'); +import requireNativeComponent from '../../../ReactNative/requireNativeComponent'; import type {HostComponent} from '../../../Renderer/shims/ReactNativeTypes'; diff --git a/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js b/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js index 6c68faf202ad50..05f629e01a1d1e 100644 --- a/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +++ b/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js @@ -8,8 +8,8 @@ * @format */ -import {type ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType'; -import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; const AndroidHorizontalScrollViewNativeComponent: HostComponent = NativeComponentRegistry.get( diff --git a/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js b/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js index 702900a3b89cb6..4e3174044dfc8b 100644 --- a/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +++ b/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js @@ -8,9 +8,9 @@ * @flow */ -import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; -import {type ViewProps as Props} from '../View/ViewPropTypes'; +import type {ViewProps as Props} from '../View/ViewPropTypes'; const ScrollContentViewNativeComponent: HostComponent = NativeComponentRegistry.get( 'RCTScrollContentView', diff --git a/Libraries/Components/ScrollView/ScrollViewNativeComponent.js b/Libraries/Components/ScrollView/ScrollViewNativeComponent.js index e74fb870e34c02..f5433a0b25e21c 100644 --- a/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +++ b/Libraries/Components/ScrollView/ScrollViewNativeComponent.js @@ -8,8 +8,8 @@ * @format */ -import {type ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType'; -import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; const ScrollViewNativeComponent: HostComponent = NativeComponentRegistry.get( diff --git a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js index a5f56f2f7a7cab..a4cbc5e98425b2 100644 --- a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +++ b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js @@ -8,11 +8,10 @@ */ 'use strict'; - -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const Text = require('../../Text/Text'); -const View = require('../View/View'); +import * as React from 'react'; +import StyleSheet from '../../StyleSheet/StyleSheet'; +import Text from '../../Text/Text'; +import View from '../View/View'; class DummySegmentedControlIOS extends React.Component { render() { diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 90bbfbf6fee91e..74221175de5e39 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -8,14 +8,15 @@ * @flow strict-local */ -const Platform = require('../../Utilities/Platform'); +import * as React from 'react'; +import Platform from '../../Utilities/Platform'; import SliderNativeComponent from './SliderNativeComponent'; -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); +import StyleSheet, { + type ViewStyleProp, + type ColorValue, +} from '../../StyleSheet/StyleSheet'; import type {ImageSource} from '../../Image/ImageSource'; -import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; diff --git a/Libraries/Components/StatusBar/StatusBar.js b/Libraries/Components/StatusBar/StatusBar.js index 5c24278694307f..4ba35f0f461d01 100644 --- a/Libraries/Components/StatusBar/StatusBar.js +++ b/Libraries/Components/StatusBar/StatusBar.js @@ -8,11 +8,10 @@ * @flow */ -const Platform = require('../../Utilities/Platform'); -const React = require('react'); - -const invariant = require('invariant'); -const processColor = require('../../StyleSheet/processColor'); +import * as React from 'react'; +import Platform from '../../Utilities/Platform'; +import invariant from 'invariant'; +import processColor from '../../StyleSheet/processColor'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; import NativeStatusBarManagerAndroid from './NativeStatusBarManagerAndroid'; diff --git a/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js b/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js index e96df0585aed1d..b8d559a295418e 100644 --- a/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js @@ -18,8 +18,11 @@ import type { WithDefault, } from '../../Types/CodegenTypes'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; -import type {TextStyleProp, ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type { + TextStyleProp, + ViewStyleProp, + ColorValue, +} from '../../StyleSheet/StyleSheet'; import requireNativeComponent from '../../ReactNative/requireNativeComponent'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import type {TextInputNativeCommands} from './TextInputNativeCommands'; diff --git a/Libraries/Components/TextInput/AndroidTextInputViewConfig.js b/Libraries/Components/TextInput/AndroidTextInputViewConfig.js index d1f922dccbe4c1..e1a693d5f7053e 100644 --- a/Libraries/Components/TextInput/AndroidTextInputViewConfig.js +++ b/Libraries/Components/TextInput/AndroidTextInputViewConfig.js @@ -9,7 +9,7 @@ */ import ReactNativeViewViewConfig from '../../Components/View/ReactNativeViewViewConfig'; -import {type PartialViewConfig} from 'react-native/Libraries/Renderer/shims/ReactNativeTypes'; +import type {PartialViewConfig} from 'react-native/Libraries/Renderer/shims/ReactNativeTypes'; const AndroidTextInputViewConfig = { uiViewClassName: 'AndroidTextInput', diff --git a/Libraries/Components/TextInput/InputAccessoryView.js b/Libraries/Components/TextInput/InputAccessoryView.js index 0da3ed3d332429..eb83a9ca0e7b8e 100644 --- a/Libraries/Components/TextInput/InputAccessoryView.js +++ b/Libraries/Components/TextInput/InputAccessoryView.js @@ -8,15 +8,15 @@ * @format */ -const Platform = require('../../Utilities/Platform'); -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); +import * as React from 'react'; +import Platform from '../../Utilities/Platform'; +import StyleSheet, { + type ViewStyleProp, + type ColorValue, +} from '../../StyleSheet/StyleSheet'; import RCTInputAccessoryViewNativeComponent from './RCTInputAccessoryViewNativeComponent'; -import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; - /** * Note: iOS only * diff --git a/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js b/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js index bd43ced4b6573a..18662d32933f80 100644 --- a/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js @@ -13,7 +13,7 @@ import requireNativeComponent from '../../ReactNative/requireNativeComponent'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import type {TextInputNativeCommands} from './TextInputNativeCommands'; import RCTTextInputViewConfig from './RCTTextInputViewConfig'; -const ReactNativeViewConfigRegistry = require('../../Renderer/shims/ReactNativeViewConfigRegistry'); +import ReactNativeViewConfigRegistry from '../../Renderer/shims/ReactNativeViewConfigRegistry'; type NativeType = HostComponent; diff --git a/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js b/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js index d6b14eef521a01..eb5105537f7e5c 100644 --- a/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js @@ -13,7 +13,7 @@ import requireNativeComponent from '../../ReactNative/requireNativeComponent'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import type {TextInputNativeCommands} from './TextInputNativeCommands'; import RCTTextInputViewConfig from './RCTTextInputViewConfig'; -const ReactNativeViewConfigRegistry = require('../../Renderer/shims/ReactNativeViewConfigRegistry'); +import ReactNativeViewConfigRegistry from '../../Renderer/shims/ReactNativeViewConfigRegistry'; type NativeType = HostComponent; diff --git a/Libraries/Components/TextInput/RCTTextInputViewConfig.js b/Libraries/Components/TextInput/RCTTextInputViewConfig.js index aa06ae9fe38af2..8545091c89e2e1 100644 --- a/Libraries/Components/TextInput/RCTTextInputViewConfig.js +++ b/Libraries/Components/TextInput/RCTTextInputViewConfig.js @@ -9,7 +9,7 @@ */ import ReactNativeViewViewConfig from '../../Components/View/ReactNativeViewViewConfig'; -import {type ViewConfig} from '../../Renderer/shims/ReactNativeTypes'; +import type {ViewConfig} from '../../Renderer/shims/ReactNativeTypes'; const RCTTextInputViewConfig = { uiViewClassName: 'RCTSinglelineTextInputView', diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 5bad7e6cf849cc..30e87a6de92ee3 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -8,25 +8,31 @@ * @format */ -const DeprecatedTextInputPropTypes = require('../../DeprecatedPropTypes/DeprecatedTextInputPropTypes'); -const Platform = require('../../Utilities/Platform'); -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const Text = require('../../Text/Text'); -const TextAncestor = require('../../Text/TextAncestor'); -const TextInputState = require('./TextInputState'); - -const invariant = require('invariant'); -const nullthrows = require('nullthrows'); -const setAndForwardRef = require('../../Utilities/setAndForwardRef'); +import * as React from 'react'; + +import DeprecatedTextInputPropTypes from '../../DeprecatedPropTypes/DeprecatedTextInputPropTypes'; + +import Platform from '../../Utilities/Platform'; +import StyleSheet, { + type TextStyleProp, + type ViewStyleProp, + type ColorValue, +} from '../../StyleSheet/StyleSheet'; +import Text from '../../Text/Text'; +import TextAncestor from '../../Text/TextAncestor'; +import TextInputState from './TextInputState'; +import invariant from 'invariant'; +import nullthrows from 'nullthrows'; +import setAndForwardRef from '../../Utilities/setAndForwardRef'; import usePressability from '../../Pressability/usePressability'; -import type {TextStyleProp, ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; -import type {SyntheticEvent, ScrollEvent} from '../../Types/CoreEventTypes'; -import type {PressEvent} from '../../Types/CoreEventTypes'; +import type { + SyntheticEvent, + ScrollEvent, + PressEvent, +} from '../../Types/CoreEventTypes'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {TextInputNativeCommands} from './TextInputNativeCommands'; diff --git a/Libraries/Components/Touchable/BoundingDimensions.js b/Libraries/Components/Touchable/BoundingDimensions.js index b0a48d0eccd65c..114b950733df31 100644 --- a/Libraries/Components/Touchable/BoundingDimensions.js +++ b/Libraries/Components/Touchable/BoundingDimensions.js @@ -8,8 +8,7 @@ */ 'use strict'; - -const PooledClass = require('./PooledClass'); +import PooledClass from './PooledClass'; const twoArgumentPooler = PooledClass.twoArgumentPooler; diff --git a/Libraries/Components/Touchable/PooledClass.js b/Libraries/Components/Touchable/PooledClass.js index 4aee28a81c5ad7..1c9e940bd53df5 100644 --- a/Libraries/Components/Touchable/PooledClass.js +++ b/Libraries/Components/Touchable/PooledClass.js @@ -9,8 +9,7 @@ */ 'use strict'; - -const invariant = require('invariant'); +import invariant from 'invariant'; /** * Static poolers. Several custom versions for each potential number of diff --git a/Libraries/Components/Touchable/Position.js b/Libraries/Components/Touchable/Position.js index 37c9738dd4b844..5656bf9aaab912 100644 --- a/Libraries/Components/Touchable/Position.js +++ b/Libraries/Components/Touchable/Position.js @@ -8,8 +8,7 @@ */ 'use strict'; - -const PooledClass = require('./PooledClass'); +import PooledClass from './PooledClass'; const twoArgumentPooler = PooledClass.twoArgumentPooler; diff --git a/Libraries/Components/Touchable/Touchable.js b/Libraries/Components/Touchable/Touchable.js index 53c821ebc0849e..f59ba3ad4954ff 100644 --- a/Libraries/Components/Touchable/Touchable.js +++ b/Libraries/Components/Touchable/Touchable.js @@ -8,12 +8,12 @@ * @format */ -const BoundingDimensions = require('./BoundingDimensions'); -const Platform = require('../../Utilities/Platform'); -const Position = require('./Position'); -const React = require('react'); -const UIManager = require('../../ReactNative/UIManager'); -const SoundManager = require('../Sound/SoundManager'); +import * as React from 'react'; +import BoundingDimensions from './BoundingDimensions'; +import Platform from '../../Utilities/Platform'; +import Position from './Position'; +import UIManager from '../../ReactNative/UIManager'; +import SoundManager from '../Sound/SoundManager'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; diff --git a/Libraries/Components/Touchable/ensurePositiveDelayProps.js b/Libraries/Components/Touchable/ensurePositiveDelayProps.js index 69dad5539faf2b..bd9b3028399cd0 100644 --- a/Libraries/Components/Touchable/ensurePositiveDelayProps.js +++ b/Libraries/Components/Touchable/ensurePositiveDelayProps.js @@ -9,8 +9,7 @@ */ 'use strict'; - -const invariant = require('invariant'); +import invariant from 'invariant'; const ensurePositiveDelayProps = function(props: any) { invariant( diff --git a/Libraries/Components/UnimplementedViews/UnimplementedView.js b/Libraries/Components/UnimplementedViews/UnimplementedView.js index 58804b7a772583..4bbb41060ff32f 100644 --- a/Libraries/Components/UnimplementedViews/UnimplementedView.js +++ b/Libraries/Components/UnimplementedViews/UnimplementedView.js @@ -9,9 +9,8 @@ */ 'use strict'; - -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); +import * as React from 'react'; +import StyleSheet from '../../StyleSheet/StyleSheet'; /** * Common implementation for a simple stubbed view. Simply applies the view's styles to the inner diff --git a/Libraries/Components/View/ReactNativeStyleAttributes.js b/Libraries/Components/View/ReactNativeStyleAttributes.js index ebd3c63df5614b..7ddf41e8352fd8 100644 --- a/Libraries/Components/View/ReactNativeStyleAttributes.js +++ b/Libraries/Components/View/ReactNativeStyleAttributes.js @@ -9,14 +9,12 @@ */ 'use strict'; - -const DeprecatedImageStylePropTypes = require('../../DeprecatedPropTypes/DeprecatedImageStylePropTypes'); -const DeprecatedTextStylePropTypes = require('../../DeprecatedPropTypes/DeprecatedTextStylePropTypes'); -const DeprecatedViewStylePropTypes = require('../../DeprecatedPropTypes/DeprecatedViewStylePropTypes'); - -const processColor = require('../../StyleSheet/processColor'); -const processTransform = require('../../StyleSheet/processTransform'); -const sizesDiffer = require('../../Utilities/differ/sizesDiffer'); +import DeprecatedImageStylePropTypes from '../../DeprecatedPropTypes/DeprecatedImageStylePropTypes'; +import DeprecatedTextStylePropTypes from '../../DeprecatedPropTypes/DeprecatedTextStylePropTypes'; +import DeprecatedViewStylePropTypes from '../../DeprecatedPropTypes/DeprecatedViewStylePropTypes'; +import processColor from '../../StyleSheet/processColor'; +import processTransform from '../../StyleSheet/processTransform'; +import sizesDiffer from '../../Utilities/differ/sizesDiffer'; type ReturnBoolType = (V) => true; type BoolifiedDeprecatedViewStylePropTypes = $ObjMap< diff --git a/Libraries/Components/View/ReactNativeViewAttributes.js b/Libraries/Components/View/ReactNativeViewAttributes.js index 50438910f2430f..da38aeef79085a 100644 --- a/Libraries/Components/View/ReactNativeViewAttributes.js +++ b/Libraries/Components/View/ReactNativeViewAttributes.js @@ -9,8 +9,7 @@ */ 'use strict'; - -const ReactNativeStyleAttributes = require('./ReactNativeStyleAttributes'); +import ReactNativeStyleAttributes from './ReactNativeStyleAttributes'; const UIView = { pointerEvents: true, diff --git a/Libraries/Components/View/ReactNativeViewViewConfig.js b/Libraries/Components/View/ReactNativeViewViewConfig.js index 63fbe0fbeba3a3..ff0b6d837e17ad 100644 --- a/Libraries/Components/View/ReactNativeViewViewConfig.js +++ b/Libraries/Components/View/ReactNativeViewViewConfig.js @@ -8,7 +8,7 @@ * @format */ -import {type ViewConfig} from '../../Renderer/shims/ReactNativeTypes'; +import type {ViewConfig} from '../../Renderer/shims/ReactNativeTypes'; import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid'; import {Platform} from 'react-native'; From 6ea72fa231914c0e9ba71e8d3aa6ac6dc1b9b888 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Mon, 26 Apr 2021 15:14:30 -0700 Subject: [PATCH 069/259] msggen: Fix Missing `RefProperty.recursive` Summary: This was missing, causing the test to fail. Changelog: [Internal] Reviewed By: mhorowitz Differential Revision: D28009429 fbshipit-source-id: 51d4366b4feb6a2300c5bd05007dd9455bdcd77b --- ReactCommon/hermes/inspector/tools/msggen/src/Property.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ReactCommon/hermes/inspector/tools/msggen/src/Property.js b/ReactCommon/hermes/inspector/tools/msggen/src/Property.js index a3673f0547081e..bfcf5d1a23760a 100644 --- a/ReactCommon/hermes/inspector/tools/msggen/src/Property.js +++ b/ReactCommon/hermes/inspector/tools/msggen/src/Property.js @@ -154,6 +154,7 @@ class RefProperty extends Property { constructor(domain: string, obj: any) { super(domain, obj); this.$ref = obj.$ref; + this.recursive = obj.recursive; } getRefDebuggerName(): ?string { From 8719a2e9a9a84b14dc318063a979c04da34cd01b Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Mon, 26 Apr 2021 15:14:30 -0700 Subject: [PATCH 070/259] msggen: Upgrade `jest` Dependency Summary: Upgrades `jest` to mitigate a dependency with security vulnerabilities. Changelog: [Internal] Reviewed By: mhorowitz Differential Revision: D28009549 fbshipit-source-id: ea3313a452e9e4b79d68781ffc37c26b00f26da5 --- .../inspector/tools/msggen/package.json | 2 +- .../hermes/inspector/tools/msggen/yarn.lock | 2848 ++++++++++------- 2 files changed, 1768 insertions(+), 1082 deletions(-) diff --git a/ReactCommon/hermes/inspector/tools/msggen/package.json b/ReactCommon/hermes/inspector/tools/msggen/package.json index bcd465c61e42eb..f9009a21999fb5 100644 --- a/ReactCommon/hermes/inspector/tools/msggen/package.json +++ b/ReactCommon/hermes/inspector/tools/msggen/package.json @@ -20,7 +20,7 @@ "@babel/preset-flow": "^7.2.0", "diff": "3.5.0", "extend": "3.0.2", - "jest": "^24.9.0", + "jest": "^26.6.3", "nwmatcher": "1.4.4", "randomatic": "3.0.0", "sshpk": "1.16.1", diff --git a/ReactCommon/hermes/inspector/tools/msggen/yarn.lock b/ReactCommon/hermes/inspector/tools/msggen/yarn.lock index a1dce3965086ab..8ba72b6f94882b 100644 --- a/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +++ b/ReactCommon/hermes/inspector/tools/msggen/yarn.lock @@ -25,6 +25,18 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/code-frame@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + dependencies: + "@babel/highlight" "^7.12.13" + +"@babel/compat-data@^7.13.15": + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.15.tgz#7e8eea42d0b64fda2b375b22d06c605222e848f4" + integrity sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA== + "@babel/core@^7.1.0", "@babel/core@^7.2.0": version "7.7.7" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.7.tgz#ee155d2e12300bcc0cff6a8ad46f2af5063803e9" @@ -45,7 +57,37 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.7.4", "@babel/generator@^7.7.7": +"@babel/core@^7.7.5": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.16.tgz#7756ab24396cc9675f1c3fcd5b79fcce192ea96a" + integrity sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.13.16" + "@babel/helper-compilation-targets" "^7.13.16" + "@babel/helper-module-transforms" "^7.13.14" + "@babel/helpers" "^7.13.16" + "@babel/parser" "^7.13.16" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.15" + "@babel/types" "^7.13.16" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.1.2" + semver "^6.3.0" + source-map "^0.5.0" + +"@babel/generator@^7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.16.tgz#0befc287031a201d84cdfc173b46b320ae472d14" + integrity sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg== + dependencies: + "@babel/types" "^7.13.16" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/generator@^7.7.4", "@babel/generator@^7.7.7": version "7.7.7" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.7.tgz#859ac733c44c74148e1a72980a64ec84b85f4f45" integrity sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ== @@ -79,6 +121,16 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helper-compilation-targets@^7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" + integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== + dependencies: + "@babel/compat-data" "^7.13.15" + "@babel/helper-validator-option" "^7.12.17" + browserslist "^4.14.5" + semver "^6.3.0" + "@babel/helper-create-regexp-features-plugin@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz#6d5762359fd34f4da1500e4cff9955b5299aaf59" @@ -104,6 +156,15 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helper-function-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" + integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== + dependencies: + "@babel/helper-get-function-arity" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/types" "^7.12.13" + "@babel/helper-function-name@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz#ab6e041e7135d436d8f0a3eca15de5b67a341a2e" @@ -113,6 +174,13 @@ "@babel/template" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helper-get-function-arity@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-get-function-arity@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz#cb46348d2f8808e632f0ab048172130e636005f0" @@ -127,6 +195,13 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-member-expression-to-functions@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" + integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== + dependencies: + "@babel/types" "^7.13.12" + "@babel/helper-member-expression-to-functions@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz#356438e2569df7321a8326644d4b790d2122cb74" @@ -134,6 +209,13 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-module-imports@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" + integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== + dependencies: + "@babel/types" "^7.13.12" + "@babel/helper-module-imports@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz#e5a92529f8888bf319a6376abfbd1cebc491ad91" @@ -141,6 +223,20 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-module-transforms@^7.13.14": + version "7.13.14" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz#e600652ba48ccb1641775413cb32cfa4e8b495ef" + integrity sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g== + dependencies: + "@babel/helper-module-imports" "^7.13.12" + "@babel/helper-replace-supers" "^7.13.12" + "@babel/helper-simple-access" "^7.13.12" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/helper-validator-identifier" "^7.12.11" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.13" + "@babel/types" "^7.13.14" + "@babel/helper-module-transforms@^7.7.4", "@babel/helper-module-transforms@^7.7.5": version "7.7.5" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.7.5.tgz#d044da7ffd91ec967db25cd6748f704b6b244835" @@ -153,6 +249,13 @@ "@babel/types" "^7.7.4" lodash "^4.17.13" +"@babel/helper-optimise-call-expression@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" + integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-optimise-call-expression@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz#034af31370d2995242aa4df402c3b7794b2dcdf2" @@ -165,6 +268,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== +"@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.8.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" + integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== + "@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.5.5.tgz#0aa6824f7100a2e0e89c1527c23936c152cab351" @@ -183,6 +291,16 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helper-replace-supers@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" + integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.13.12" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.12" + "@babel/helper-replace-supers@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz#3c881a6a6a7571275a72d82e6107126ec9e2cdd2" @@ -193,6 +311,13 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helper-simple-access@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" + integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== + dependencies: + "@babel/types" "^7.13.12" + "@babel/helper-simple-access@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz#a169a0adb1b5f418cfc19f22586b2ebf58a9a294" @@ -201,6 +326,13 @@ "@babel/template" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helper-split-export-declaration@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-split-export-declaration@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz#57292af60443c4a3622cf74040ddc28e68336fd8" @@ -208,6 +340,16 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + +"@babel/helper-validator-option@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" + integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== + "@babel/helper-wrap-function@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz#37ab7fed5150e22d9d7266e830072c0cdd8baace" @@ -218,6 +360,15 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helpers@^7.13.16": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.17.tgz#b497c7a00e9719d5b613b8982bda6ed3ee94caf6" + integrity sha512-Eal4Gce4kGijo1/TGJdqp3WuhllaMLSrW6XcL0ulyUAQOuxHcCafZE8KHg9857gcTehsm/v7RcOx2+jp0Ryjsg== + dependencies: + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.17" + "@babel/types" "^7.13.17" + "@babel/helpers@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.4.tgz#62c215b9e6c712dadc15a9a0dcab76c92a940302" @@ -236,11 +387,25 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.7.4", "@babel/parser@^7.7.7": +"@babel/highlight@^7.12.13": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.13.10.tgz#a8b2a66148f5b27d666b15d81774347a731d52d1" + integrity sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.7.4", "@babel/parser@^7.7.7": version "7.7.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.7.tgz#1b886595419cf92d811316d5b715a53ff38b4937" integrity sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw== +"@babel/parser@^7.12.13", "@babel/parser@^7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.16.tgz#0f18179b0448e6939b1f3f5c4c355a3a9bcdfd37" + integrity sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw== + "@babel/plugin-proposal-async-generator-functions@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz#0351c5ac0a9e927845fffd5b82af476947b7ce6d" @@ -297,6 +462,27 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/plugin-syntax-dynamic-import@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz#29ca3b4415abfe4a5ec381e903862ad1a54c3aec" @@ -311,6 +497,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-import-meta@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-json-strings@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.7.4.tgz#86e63f7d2e22f9e27129ac4e83ea989a382e86cc" @@ -318,13 +511,48 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.7.4": +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.7.4.tgz#47cf220d19d6d0d7b154304701f468fc1cc6ff46" integrity sha512-mObR+r+KZq0XhRVS2BrBKBpr5jqrqzlPvS9C9vuOf5ilSwzloAl7RPWLrgKdWS6IreaVrjHxTjtyqFiOisaCwg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + "@babel/plugin-syntax-optional-catch-binding@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.7.4.tgz#a3e38f59f4b6233867b4a92dcb0ee05b2c334aa6" @@ -332,6 +560,20 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + "@babel/plugin-syntax-top-level-await@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.4.tgz#bd7d8fa7b9fee793a36e4027fd6dd1aa32f946da" @@ -339,6 +581,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-top-level-await@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" + integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/plugin-transform-arrow-functions@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.7.4.tgz#76309bd578addd8aee3b379d809c802305a98a12" @@ -656,7 +905,16 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-flow-strip-types" "^7.7.4" -"@babel/template@^7.4.0", "@babel/template@^7.7.4": +"@babel/template@^7.12.13", "@babel/template@^7.3.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/template@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.4.tgz#428a7d9eecffe27deac0a98e23bf8e3675d2a77b" integrity sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw== @@ -665,7 +923,7 @@ "@babel/parser" "^7.7.4" "@babel/types" "^7.7.4" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.4": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.4.tgz#9c1e7c60fb679fe4fcfaa42500833333c2058558" integrity sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw== @@ -680,7 +938,21 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.7.4": +"@babel/traverse@^7.13.0", "@babel/traverse@^7.13.13", "@babel/traverse@^7.13.15", "@babel/traverse@^7.13.17": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.17.tgz#c85415e0c7d50ac053d758baec98b28b2ecfeea3" + integrity sha512-BMnZn0R+X6ayqm3C3To7o1j7Q020gWdqdyP50KEoVqaCO2c/Im7sYZSmVgvefp8TTMQ+9CtwuBp0Z1CZ8V3Pvg== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.13.16" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.13.16" + "@babel/types" "^7.13.17" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.4.tgz#516570d539e44ddf308c07569c258ff94fde9193" integrity sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA== @@ -689,6 +961,19 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.12.13", "@babel/types@^7.13.12", "@babel/types@^7.13.14", "@babel/types@^7.13.16", "@babel/types@^7.13.17", "@babel/types@^7.3.3": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.17.tgz#48010a115c9fba7588b4437dd68c9469012b38b4" + integrity sha512-RawydLgxbOPDlTLJNtoIypwdmAy//uQIzlKt2+iBiJaRlVuI6QLUxVAyWGNfOzp8Yu4L4lLIacoCyTNtpb4wiA== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + to-fast-properties "^2.0.0" + +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + "@cnakazawa/watch@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" @@ -697,158 +982,211 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@jest/console@^24.7.1", "@jest/console@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0" - integrity sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ== +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== dependencies: - "@jest/source-map" "^24.9.0" - chalk "^2.0.1" - slash "^2.0.0" + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" -"@jest/core@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.9.0.tgz#2ceccd0b93181f9c4850e74f2a9ad43d351369c4" - integrity sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A== - dependencies: - "@jest/console" "^24.7.1" - "@jest/reporters" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - ansi-escapes "^3.0.0" - chalk "^2.0.1" +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/console@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.2.tgz#4e04bc464014358b03ab4937805ee36a0aeb98f2" + integrity sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g== + dependencies: + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^26.6.2" + jest-util "^26.6.2" + slash "^3.0.0" + +"@jest/core@^26.6.3": + version "26.6.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.6.3.tgz#7639fcb3833d748a4656ada54bde193051e45fad" + integrity sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw== + dependencies: + "@jest/console" "^26.6.2" + "@jest/reporters" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" exit "^0.1.2" - graceful-fs "^4.1.15" - jest-changed-files "^24.9.0" - jest-config "^24.9.0" - jest-haste-map "^24.9.0" - jest-message-util "^24.9.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.9.0" - jest-resolve-dependencies "^24.9.0" - jest-runner "^24.9.0" - jest-runtime "^24.9.0" - jest-snapshot "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - jest-watcher "^24.9.0" - micromatch "^3.1.10" - p-each-series "^1.0.0" - realpath-native "^1.1.0" - rimraf "^2.5.4" - slash "^2.0.0" - strip-ansi "^5.0.0" - -"@jest/environment@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.9.0.tgz#21e3afa2d65c0586cbd6cbefe208bafade44ab18" - integrity sha512-5A1QluTPhvdIPFYnO3sZC3smkNeXPVELz7ikPbhUj0bQjB07EoE9qtLrem14ZUYWdVayYbsjVwIiL4WBIMV4aQ== - dependencies: - "@jest/fake-timers" "^24.9.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - jest-mock "^24.9.0" - -"@jest/fake-timers@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.9.0.tgz#ba3e6bf0eecd09a636049896434d306636540c93" - integrity sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A== - dependencies: - "@jest/types" "^24.9.0" - jest-message-util "^24.9.0" - jest-mock "^24.9.0" - -"@jest/reporters@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.9.0.tgz#86660eff8e2b9661d042a8e98a028b8d631a5b43" - integrity sha512-mu4X0yjaHrffOsWmVLzitKmmmWSQ3GGuefgNscUSWNiUNcEOSEQk9k3pERKEQVBb0Cnn88+UESIsZEMH3o88Gw== - dependencies: - "@jest/environment" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" + graceful-fs "^4.2.4" + jest-changed-files "^26.6.2" + jest-config "^26.6.3" + jest-haste-map "^26.6.2" + jest-message-util "^26.6.2" + jest-regex-util "^26.0.0" + jest-resolve "^26.6.2" + jest-resolve-dependencies "^26.6.3" + jest-runner "^26.6.3" + jest-runtime "^26.6.3" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" + jest-watcher "^26.6.2" + micromatch "^4.0.2" + p-each-series "^2.1.0" + rimraf "^3.0.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.6.2.tgz#ba364cc72e221e79cc8f0a99555bf5d7577cf92c" + integrity sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA== + dependencies: + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + jest-mock "^26.6.2" + +"@jest/fake-timers@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.6.2.tgz#459c329bcf70cee4af4d7e3f3e67848123535aad" + integrity sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA== + dependencies: + "@jest/types" "^26.6.2" + "@sinonjs/fake-timers" "^6.0.1" + "@types/node" "*" + jest-message-util "^26.6.2" + jest-mock "^26.6.2" + jest-util "^26.6.2" + +"@jest/globals@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.6.2.tgz#5b613b78a1aa2655ae908eba638cc96a20df720a" + integrity sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA== + dependencies: + "@jest/environment" "^26.6.2" + "@jest/types" "^26.6.2" + expect "^26.6.2" + +"@jest/reporters@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.6.2.tgz#1f518b99637a5f18307bd3ecf9275f6882a667f6" + integrity sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.2" - istanbul-lib-coverage "^2.0.2" - istanbul-lib-instrument "^3.0.1" - istanbul-lib-report "^2.0.4" - istanbul-lib-source-maps "^3.0.1" - istanbul-reports "^2.2.6" - jest-haste-map "^24.9.0" - jest-resolve "^24.9.0" - jest-runtime "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.6.0" - node-notifier "^5.4.2" - slash "^2.0.0" + graceful-fs "^4.2.4" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^4.0.3" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + jest-haste-map "^26.6.2" + jest-resolve "^26.6.2" + jest-util "^26.6.2" + jest-worker "^26.6.2" + slash "^3.0.0" source-map "^0.6.0" - string-length "^2.0.0" + string-length "^4.0.1" + terminal-link "^2.0.0" + v8-to-istanbul "^7.0.0" + optionalDependencies: + node-notifier "^8.0.0" -"@jest/source-map@^24.3.0", "@jest/source-map@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.9.0.tgz#0e263a94430be4b41da683ccc1e6bffe2a191714" - integrity sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg== +"@jest/source-map@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.6.2.tgz#29af5e1e2e324cafccc936f218309f54ab69d535" + integrity sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA== dependencies: callsites "^3.0.0" - graceful-fs "^4.1.15" + graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.9.0.tgz#11796e8aa9dbf88ea025757b3152595ad06ba0ca" - integrity sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA== +"@jest/test-result@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.2.tgz#55da58b62df134576cc95476efa5f7949e3f5f18" + integrity sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ== dependencies: - "@jest/console" "^24.9.0" - "@jest/types" "^24.9.0" + "@jest/console" "^26.6.2" + "@jest/types" "^26.6.2" "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.9.0.tgz#f8f334f35b625a4f2f355f2fe7e6036dad2e6b31" - integrity sha512-6qqsU4o0kW1dvA95qfNog8v8gkRN9ph6Lz7r96IvZpHdNipP2cBcb07J1Z45mz/VIS01OHJ3pY8T5fUY38tg4A== +"@jest/test-sequencer@^26.6.3": + version "26.6.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz#98e8a45100863886d074205e8ffdc5a7eb582b17" + integrity sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw== dependencies: - "@jest/test-result" "^24.9.0" - jest-haste-map "^24.9.0" - jest-runner "^24.9.0" - jest-runtime "^24.9.0" + "@jest/test-result" "^26.6.2" + graceful-fs "^4.2.4" + jest-haste-map "^26.6.2" + jest-runner "^26.6.3" + jest-runtime "^26.6.3" -"@jest/transform@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.9.0.tgz#4ae2768b296553fadab09e9ec119543c90b16c56" - integrity sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ== +"@jest/transform@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.6.2.tgz#5ac57c5fa1ad17b2aae83e73e45813894dcf2e4b" + integrity sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^24.9.0" - babel-plugin-istanbul "^5.1.0" - chalk "^2.0.1" + "@jest/types" "^26.6.2" + babel-plugin-istanbul "^6.0.0" + chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.1.15" - jest-haste-map "^24.9.0" - jest-regex-util "^24.9.0" - jest-util "^24.9.0" - micromatch "^3.1.10" + graceful-fs "^4.2.4" + jest-haste-map "^26.6.2" + jest-regex-util "^26.0.0" + jest-util "^26.6.2" + micromatch "^4.0.2" pirates "^4.0.1" - realpath-native "^1.1.0" - slash "^2.0.0" + slash "^3.0.0" source-map "^0.6.1" - write-file-atomic "2.4.1" + write-file-atomic "^3.0.0" -"@jest/types@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" - integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== +"@jest/types@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" + integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^13.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + +"@sinonjs/commons@^1.7.0": + version "1.8.3" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" + integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" + integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== + dependencies: + "@sinonjs/commons" "^1.7.0" -"@types/babel__core@^7.1.0": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.3.tgz#e441ea7df63cd080dfcd02ab199e6d16a735fc30" - integrity sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA== +"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": + version "7.1.14" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" + integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -878,11 +1216,30 @@ dependencies: "@babel/types" "^7.3.0" +"@types/babel__traverse@^7.0.4": + version "7.11.1" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.1.tgz#654f6c4f67568e24c23b367e947098c6206fa639" + integrity sha512-Vs0hm0vPahPMYi9tDjtP66llufgO3ST16WXaSTtDGEl9cewAl3AibmxWw6TINOqHPT9z0uABKAYjT9jNSg4npw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/graceful-fs@^4.1.2": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" + integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== + dependencies: + "@types/node" "*" + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== +"@types/istanbul-lib-coverage@^2.0.1": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" + integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== + "@types/istanbul-lib-report@*": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" @@ -890,28 +1247,42 @@ dependencies: "@types/istanbul-lib-coverage" "*" -"@types/istanbul-reports@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" - integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== +"@types/istanbul-reports@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz#508b13aa344fa4976234e75dddcc34925737d821" + integrity sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA== dependencies: - "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" -"@types/stack-utils@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" - integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== +"@types/node@*": + version "15.0.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.0.tgz#557dd0da4a6dca1407481df3bbacae0cd6f68042" + integrity sha512-YN1d+ae2MCb4U0mMa+Zlb5lWTdpFShbAj5nmte6lel27waMMBfivrm0prC16p/Di3DyTrmerrYUT8/145HXxVw== + +"@types/normalize-package-data@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" + integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + +"@types/prettier@^2.0.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" + integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== + +"@types/stack-utils@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" + integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== "@types/yargs-parser@*": version "13.1.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== -"@types/yargs@^13.0.0": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380" - integrity sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ== +"@types/yargs@^15.0.0": + version "15.0.13" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.13.tgz#34f7fec8b389d7f3c1fd08026a5763e072d3c6dc" + integrity sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ== dependencies: "@types/yargs-parser" "*" @@ -1070,39 +1441,39 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -abab@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" - integrity sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg== +abab@^2.0.3, abab@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" + integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== -acorn-globals@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" - integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== +acorn-globals@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" + integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== dependencies: - acorn "^6.0.1" - acorn-walk "^6.0.1" - -acorn-walk@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" - integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== - -acorn@^5.5.3: - version "5.7.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" - integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + acorn "^7.1.1" + acorn-walk "^7.1.1" -acorn@^6.0.1: - version "6.4.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784" - integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw== +acorn-walk@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" + integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== +acorn@^7.1.1: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + +acorn@^8.1.0: + version "8.2.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.1.tgz#0d36af126fb6755095879c1dc6fd7edf7d60a5fb" + integrity sha512-z716cpm5TX4uzOzILx8PavOE6C6DKshHDw1aQN52M/yNSqE9s5O8SMfyhCCfCJ3HmTL0NkVOi+8a/55T7YB3bg== + ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" @@ -1113,7 +1484,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.1.0, ajv@^6.10.2: +ajv@^6.1.0, ajv@^6.10.2, ajv@^6.12.3: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1123,31 +1494,23 @@ ajv@^6.1.0, ajv@^6.10.2: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.5.5: - version "6.10.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" - integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== +ansi-escapes@^4.2.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-escapes@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + type-fest "^0.21.3" -ansi-regex@^4.0.0, ansi-regex@^4.1.0: +ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -1155,6 +1518,13 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" @@ -1163,7 +1533,7 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -anymatch@~3.1.1: +anymatch@^3.0.3, anymatch@~3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== @@ -1176,6 +1546,13 @@ aproba@^1.1.1: resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -1191,11 +1568,6 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" - integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= - array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -1236,21 +1608,11 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - async-each@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1271,18 +1633,19 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.0.tgz#24390e6ad61386b0a747265754d2a17219de862c" integrity sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A== -babel-jest@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz#3fc327cb8467b89d14d7bc70e315104a783ccd54" - integrity sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw== - dependencies: - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/babel__core" "^7.1.0" - babel-plugin-istanbul "^5.1.0" - babel-preset-jest "^24.9.0" - chalk "^2.4.2" - slash "^2.0.0" +babel-jest@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" + integrity sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA== + dependencies: + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/babel__core" "^7.1.7" + babel-plugin-istanbul "^6.0.0" + babel-preset-jest "^26.6.2" + chalk "^4.0.0" + graceful-fs "^4.2.4" + slash "^3.0.0" babel-plugin-dynamic-import-node@^2.3.0: version "2.3.0" @@ -1291,30 +1654,52 @@ babel-plugin-dynamic-import-node@^2.3.0: dependencies: object.assign "^4.1.0" -babel-plugin-istanbul@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" - integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== +babel-plugin-istanbul@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" + integrity sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - find-up "^3.0.0" - istanbul-lib-instrument "^3.3.0" - test-exclude "^5.2.3" - -babel-plugin-jest-hoist@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz#4f837091eb407e01447c8843cbec546d0002d756" - integrity sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw== - dependencies: + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^4.0.0" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz#8185bd030348d254c6d7dd974355e6a28b21e62d" + integrity sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" -babel-preset-jest@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz#192b521e2217fb1d1f67cf73f70c336650ad3cdc" - integrity sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg== - dependencies: - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^24.9.0" +babel-preset-current-node-syntax@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" + integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.8.3" + "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-top-level-await" "^7.8.3" + +babel-preset-jest@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz#747872b1171df032252426586881d62d31798fee" + integrity sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ== + dependencies: + babel-plugin-jest-hoist "^26.6.2" + babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: version "1.0.2" @@ -1407,7 +1792,7 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@~3.0.2: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -1419,17 +1804,10 @@ brorand@^1.0.1, brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= -browser-process-hrtime@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" - integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== - -browser-resolve@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" +browser-process-hrtime@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" + integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" @@ -1492,6 +1870,17 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" +browserslist@^4.14.5: + version "4.16.5" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.5.tgz#952825440bca8913c62d0021334cbe928ef062ae" + integrity sha512-C2HAjrM1AI/djrpAUU/tr4pml1DqLIzJKSLDBXBrNErl9ZCCTXdhwxdJjYc16953+mBWf7Lw+uUJgpgb8cN71A== + dependencies: + caniuse-lite "^1.0.30001214" + colorette "^1.2.2" + electron-to-chromium "^1.3.719" + escalade "^3.1.1" + node-releases "^1.1.71" + browserslist@^4.6.0, browserslist@^4.8.2: version "4.8.2" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.2.tgz#b45720ad5fbc8713b7253c20766f701c9a694289" @@ -1578,11 +1967,21 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== +camelcase@^6.0.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" + integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + caniuse-lite@^1.0.30001015: version "1.0.30001016" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001016.tgz#16ea48d7d6e8caf3cad3295c2d746fe38c4e7f66" integrity sha512-yYQ2QfotceRiH4U+h1Us86WJXtVHDmy3nEKIdYPsZCYnOV5/tMgGbmoIlrMzmh2VXlproqYtVaKeGDBkMZifFA== +caniuse-lite@^1.0.30001214: + version "1.0.30001216" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001216.tgz#47418a082a4f952d14d8964ae739e25efb2060a9" + integrity sha512-1uU+ww/n5WCJRwUcc9UH/W6925Se5aNnem/G5QaSDga2HzvjYMs8vRbekGUN/PnTZ7ezTHcxxTEb9fgiMYwH6Q== + capture-exit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" @@ -1595,7 +1994,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: +chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1604,6 +2003,19 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" + integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -1661,6 +2073,11 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +cjs-module-lexer@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" + integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== + class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -1680,11 +2097,25 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= +collect-v8-coverage@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" + integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -1700,11 +2131,28 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colorette@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== + combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -1712,7 +2160,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.20.0, commander@~2.20.3: +commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -1757,7 +2205,7 @@ constants-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= -convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.7.0: +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== @@ -1836,6 +2284,15 @@ cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -1853,17 +2310,22 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" -cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": +cssom@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" + integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== + +cssom@~0.3.6: version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -cssstyle@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.4.0.tgz#9d31328229d3c565c61e586b02041a28fccdccf1" - integrity sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA== +cssstyle@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== dependencies: - cssom "0.3.x" + cssom "~0.3.6" cyclist@^1.0.1: version "1.0.1" @@ -1877,14 +2339,14 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-urls@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== +data-urls@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" + integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" + abab "^2.0.3" + whatwg-mimetype "^2.3.0" + whatwg-url "^8.0.0" debug@^2.2.0, debug@^2.3.3: version "2.6.9" @@ -1905,6 +2367,11 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= +decimal.js@^10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" + integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -1915,7 +2382,12 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -define-properties@^1.1.2, define-properties@^1.1.3: +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + +define-properties@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -1957,20 +2429,20 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" -detect-newline@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" - integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== devtools-protocol@0.0.730699: version "0.0.730699" resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.730699.tgz#4d18f6a9b7fb7cf3f1ffe73bfe14aad66cf3b2ef" integrity sha512-dprBpuPzVIIXXL6GevzhvWe2wg836h3d5hY+n6IzzHbKLsUh6QlVmcIy15za0J3MhDFbmEH60s6uYsrw/tgBbw== -diff-sequences@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" - integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== +diff-sequences@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" + integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== diff@3.5.0: version "3.5.0" @@ -1991,12 +2463,12 @@ domain-browser@^1.1.1: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== -domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== +domexception@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" + integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== dependencies: - webidl-conversions "^4.0.2" + webidl-conversions "^5.0.0" duplexify@^3.4.2, duplexify@^3.6.0: version "3.7.1" @@ -2021,6 +2493,11 @@ electron-to-chromium@^1.3.322: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.322.tgz#a6f7e1c79025c2b05838e8e344f6e89eb83213a8" integrity sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA== +electron-to-chromium@^1.3.719: + version "1.3.720" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.720.tgz#f5d66df8754d993006b7b2ded15ff7738c58bd94" + integrity sha512-B6zLTxxaOFP4WZm6DrvgRk8kLFYWNhQ5TrHMC0l5WtkMXhU5UbnvWoTfeEwqOruUSlNMhVLfYak7REX6oC5Yfw== + elliptic@^6.5.3: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" @@ -2034,11 +2511,21 @@ elliptic@^6.5.3: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" +emittery@^0.7.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" + integrity sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" @@ -2074,44 +2561,28 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0-next.1: - version "1.17.0-next.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.0-next.1.tgz#94acc93e20b05a6e96dacb5ab2f1cb3a81fc2172" - integrity sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimleft "^2.1.0" - string.prototype.trimright "^2.1.0" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@^1.9.1: - version "1.12.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541" - integrity sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg== +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" + integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" + esprima "^4.0.1" + estraverse "^5.2.0" esutils "^2.0.2" optionator "^0.8.1" optionalDependencies: @@ -2125,10 +2596,10 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= +esprima@^4.0.0, esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esrecurse@^4.1.0: version "4.3.0" @@ -2137,7 +2608,7 @@ esrecurse@^4.1.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -2183,6 +2654,21 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -2201,17 +2687,17 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca" - integrity sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q== +expect@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" + integrity sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA== dependencies: - "@jest/types" "^24.9.0" - ansi-styles "^3.2.0" - jest-get-type "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-regex-util "^24.9.0" + "@jest/types" "^26.6.2" + ansi-styles "^4.0.0" + jest-get-type "^26.3.0" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-regex-util "^26.0.0" extend-shallow@^2.0.1: version "2.0.1" @@ -2257,11 +2743,6 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -2327,6 +2808,14 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + flush-write-stream@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" @@ -2397,7 +2886,7 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@~2.3.1: +fsevents@^2.1.2, fsevents@~2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -2407,11 +2896,21 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -2419,6 +2918,13 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" +get-stream@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -2463,7 +2969,7 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.2.4: version "4.2.6" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== @@ -2473,28 +2979,17 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -handlebars@^4.1.2: - version "4.5.3" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.3.tgz#5cf75bd8714f7605713511a56be7c349becb0482" - integrity sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA== - dependencies: - neo-async "^2.6.0" - optimist "^0.6.1" - source-map "^0.6.1" - optionalDependencies: - uglify-js "^3.1.4" - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= -har-validator@~5.1.0: - version "5.1.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" - integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== dependencies: - ajv "^6.5.5" + ajv "^6.12.3" har-schema "^2.0.0" has-flag@^3.0.0: @@ -2502,7 +2997,12 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= -has-symbols@^1.0.0, has-symbols@^1.0.1: +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-symbols@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== @@ -2576,12 +3076,17 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c" integrity sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg== -html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== +html-encoding-sniffer@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" + integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== dependencies: - whatwg-encoding "^1.0.1" + whatwg-encoding "^1.0.5" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== http-signature@~1.2.0: version "1.2.0" @@ -2597,6 +3102,11 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -2614,13 +3124,13 @@ iferr@^0.1.5: resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= -import-local@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" - integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== +import-local@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" + integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== dependencies: - pkg-dir "^3.0.0" - resolve-cwd "^2.0.0" + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" imurmurhash@^0.1.4: version "0.1.4" @@ -2655,7 +3165,7 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -2700,11 +3210,6 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-callable@^1.1.4: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" - integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== - is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -2712,6 +3217,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-core-module@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.3.0.tgz#d341652e3408bca69c4671b79a0954a3d349f887" + integrity sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw== + dependencies: + has "^1.0.3" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -2726,11 +3238,6 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-date-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" - integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== - is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -2749,6 +3256,11 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" +is-docker@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -2771,6 +3283,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-generator-fn@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" @@ -2814,26 +3331,22 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-regex@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" +is-potential-custom-element-name@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= -is-symbol@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" - integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== - dependencies: - has-symbols "^1.0.1" +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== -is-typedarray@~1.0.0: +is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= @@ -2848,6 +3361,13 @@ is-wsl@^1.1.0: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= +is-wsl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2875,404 +3395,419 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== +istanbul-lib-coverage@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" + integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== -istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" - integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== - dependencies: - "@babel/generator" "^7.4.0" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - istanbul-lib-coverage "^2.0.5" - semver "^6.0.0" +istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" + integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== + dependencies: + "@babel/core" "^7.7.5" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" -istanbul-lib-report@^2.0.4: - version "2.0.8" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" - integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== +istanbul-lib-report@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" + integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== dependencies: - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - supports-color "^6.1.0" + istanbul-lib-coverage "^3.0.0" + make-dir "^3.0.0" + supports-color "^7.1.0" -istanbul-lib-source-maps@^3.0.1: - version "3.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" - integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== +istanbul-lib-source-maps@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" + integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== dependencies: debug "^4.1.1" - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - rimraf "^2.6.3" + istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" - integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== - dependencies: - handlebars "^4.1.2" - -jest-changed-files@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.9.0.tgz#08d8c15eb79a7fa3fc98269bc14b451ee82f8039" - integrity sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg== - dependencies: - "@jest/types" "^24.9.0" - execa "^1.0.0" - throat "^4.0.0" - -jest-cli@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.9.0.tgz#ad2de62d07472d419c6abc301fc432b98b10d2af" - integrity sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg== - dependencies: - "@jest/core" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" +istanbul-reports@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" + integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +jest-changed-files@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" + integrity sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ== + dependencies: + "@jest/types" "^26.6.2" + execa "^4.0.0" + throat "^5.0.0" + +jest-cli@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.6.3.tgz#43117cfef24bc4cd691a174a8796a532e135e92a" + integrity sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg== + dependencies: + "@jest/core" "^26.6.3" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" + chalk "^4.0.0" exit "^0.1.2" - import-local "^2.0.0" + graceful-fs "^4.2.4" + import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" + jest-config "^26.6.3" + jest-util "^26.6.2" + jest-validate "^26.6.2" prompts "^2.0.1" - realpath-native "^1.1.0" - yargs "^13.3.0" + yargs "^15.4.1" -jest-config@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.9.0.tgz#fb1bbc60c73a46af03590719efa4825e6e4dd1b5" - integrity sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ== +jest-config@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.6.3.tgz#64f41444eef9eb03dc51d5c53b75c8c71f645349" + integrity sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^24.9.0" - "@jest/types" "^24.9.0" - babel-jest "^24.9.0" - chalk "^2.0.1" + "@jest/test-sequencer" "^26.6.3" + "@jest/types" "^26.6.2" + babel-jest "^26.6.3" + chalk "^4.0.0" + deepmerge "^4.2.2" glob "^7.1.1" - jest-environment-jsdom "^24.9.0" - jest-environment-node "^24.9.0" - jest-get-type "^24.9.0" - jest-jasmine2 "^24.9.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - micromatch "^3.1.10" - pretty-format "^24.9.0" - realpath-native "^1.1.0" - -jest-diff@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" - integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== - dependencies: - chalk "^2.0.1" - diff-sequences "^24.9.0" - jest-get-type "^24.9.0" - pretty-format "^24.9.0" - -jest-docblock@^24.3.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.9.0.tgz#7970201802ba560e1c4092cc25cbedf5af5a8ce2" - integrity sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA== - dependencies: - detect-newline "^2.1.0" - -jest-each@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.9.0.tgz#eb2da602e2a610898dbc5f1f6df3ba86b55f8b05" - integrity sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog== - dependencies: - "@jest/types" "^24.9.0" - chalk "^2.0.1" - jest-get-type "^24.9.0" - jest-util "^24.9.0" - pretty-format "^24.9.0" - -jest-environment-jsdom@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz#4b0806c7fc94f95edb369a69cc2778eec2b7375b" - integrity sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA== - dependencies: - "@jest/environment" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/types" "^24.9.0" - jest-mock "^24.9.0" - jest-util "^24.9.0" - jsdom "^11.5.1" - -jest-environment-node@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.9.0.tgz#333d2d2796f9687f2aeebf0742b519f33c1cbfd3" - integrity sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA== - dependencies: - "@jest/environment" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/types" "^24.9.0" - jest-mock "^24.9.0" - jest-util "^24.9.0" - -jest-get-type@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" - integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== - -jest-haste-map@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" - integrity sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ== - dependencies: - "@jest/types" "^24.9.0" - anymatch "^2.0.0" + graceful-fs "^4.2.4" + jest-environment-jsdom "^26.6.2" + jest-environment-node "^26.6.2" + jest-get-type "^26.3.0" + jest-jasmine2 "^26.6.3" + jest-regex-util "^26.0.0" + jest-resolve "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" + micromatch "^4.0.2" + pretty-format "^26.6.2" + +jest-diff@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" + integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== + dependencies: + chalk "^4.0.0" + diff-sequences "^26.6.2" + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + +jest-docblock@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" + integrity sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w== + dependencies: + detect-newline "^3.0.0" + +jest-each@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.6.2.tgz#02526438a77a67401c8a6382dfe5999952c167cb" + integrity sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A== + dependencies: + "@jest/types" "^26.6.2" + chalk "^4.0.0" + jest-get-type "^26.3.0" + jest-util "^26.6.2" + pretty-format "^26.6.2" + +jest-environment-jsdom@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz#78d09fe9cf019a357009b9b7e1f101d23bd1da3e" + integrity sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q== + dependencies: + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + jest-mock "^26.6.2" + jest-util "^26.6.2" + jsdom "^16.4.0" + +jest-environment-node@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.6.2.tgz#824e4c7fb4944646356f11ac75b229b0035f2b0c" + integrity sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag== + dependencies: + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + jest-mock "^26.6.2" + jest-util "^26.6.2" + +jest-get-type@^26.3.0: + version "26.3.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" + integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== + +jest-haste-map@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" + integrity sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w== + dependencies: + "@jest/types" "^26.6.2" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" fb-watchman "^2.0.0" - graceful-fs "^4.1.15" - invariant "^2.2.4" - jest-serializer "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.9.0" - micromatch "^3.1.10" + graceful-fs "^4.2.4" + jest-regex-util "^26.0.0" + jest-serializer "^26.6.2" + jest-util "^26.6.2" + jest-worker "^26.6.2" + micromatch "^4.0.2" sane "^4.0.3" walker "^1.0.7" optionalDependencies: - fsevents "^1.2.7" + fsevents "^2.1.2" -jest-jasmine2@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz#1f7b1bd3242c1774e62acabb3646d96afc3be6a0" - integrity sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw== +jest-jasmine2@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" + integrity sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" + "@jest/environment" "^26.6.2" + "@jest/source-map" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" co "^4.6.0" - expect "^24.9.0" + expect "^26.6.2" is-generator-fn "^2.0.0" - jest-each "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-runtime "^24.9.0" - jest-snapshot "^24.9.0" - jest-util "^24.9.0" - pretty-format "^24.9.0" - throat "^4.0.0" - -jest-leak-detector@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz#b665dea7c77100c5c4f7dfcb153b65cf07dcf96a" - integrity sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA== - dependencies: - jest-get-type "^24.9.0" - pretty-format "^24.9.0" - -jest-matcher-utils@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz#f5b3661d5e628dffe6dd65251dfdae0e87c3a073" - integrity sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA== - dependencies: - chalk "^2.0.1" - jest-diff "^24.9.0" - jest-get-type "^24.9.0" - pretty-format "^24.9.0" - -jest-message-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.9.0.tgz#527f54a1e380f5e202a8d1149b0ec872f43119e3" - integrity sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw== + jest-each "^26.6.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-runtime "^26.6.3" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + pretty-format "^26.6.2" + throat "^5.0.0" + +jest-leak-detector@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af" + integrity sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg== + dependencies: + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + +jest-matcher-utils@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" + integrity sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw== + dependencies: + chalk "^4.0.0" + jest-diff "^26.6.2" + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + +jest-message-util@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" + integrity sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/stack-utils" "^1.0.1" - chalk "^2.0.1" - micromatch "^3.1.10" - slash "^2.0.0" - stack-utils "^1.0.1" - -jest-mock@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6" - integrity sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w== - dependencies: - "@jest/types" "^24.9.0" - -jest-pnp-resolver@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" - integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== - -jest-regex-util@^24.3.0, jest-regex-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" - integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA== - -jest-resolve-dependencies@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz#ad055198959c4cfba8a4f066c673a3f0786507ab" - integrity sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g== - dependencies: - "@jest/types" "^24.9.0" - jest-regex-util "^24.3.0" - jest-snapshot "^24.9.0" - -jest-resolve@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.9.0.tgz#dff04c7687af34c4dd7e524892d9cf77e5d17321" - integrity sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ== - dependencies: - "@jest/types" "^24.9.0" - browser-resolve "^1.11.3" - chalk "^2.0.1" - jest-pnp-resolver "^1.2.1" - realpath-native "^1.1.0" - -jest-runner@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.9.0.tgz#574fafdbd54455c2b34b4bdf4365a23857fcdf42" - integrity sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg== - dependencies: - "@jest/console" "^24.7.1" - "@jest/environment" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.4.2" + "@jest/types" "^26.6.2" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.2" + pretty-format "^26.6.2" + slash "^3.0.0" + stack-utils "^2.0.2" + +jest-mock@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.6.2.tgz#d6cb712b041ed47fe0d9b6fc3474bc6543feb302" + integrity sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew== + dependencies: + "@jest/types" "^26.6.2" + "@types/node" "*" + +jest-pnp-resolver@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" + integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== + +jest-regex-util@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" + integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== + +jest-resolve-dependencies@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz#6680859ee5d22ee5dcd961fe4871f59f4c784fb6" + integrity sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg== + dependencies: + "@jest/types" "^26.6.2" + jest-regex-util "^26.0.0" + jest-snapshot "^26.6.2" + +jest-resolve@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" + integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== + dependencies: + "@jest/types" "^26.6.2" + chalk "^4.0.0" + graceful-fs "^4.2.4" + jest-pnp-resolver "^1.2.2" + jest-util "^26.6.2" + read-pkg-up "^7.0.1" + resolve "^1.18.1" + slash "^3.0.0" + +jest-runner@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.6.3.tgz#2d1fed3d46e10f233fd1dbd3bfaa3fe8924be159" + integrity sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ== + dependencies: + "@jest/console" "^26.6.2" + "@jest/environment" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.7.1" exit "^0.1.2" - graceful-fs "^4.1.15" - jest-config "^24.9.0" - jest-docblock "^24.3.0" - jest-haste-map "^24.9.0" - jest-jasmine2 "^24.9.0" - jest-leak-detector "^24.9.0" - jest-message-util "^24.9.0" - jest-resolve "^24.9.0" - jest-runtime "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.6.0" + graceful-fs "^4.2.4" + jest-config "^26.6.3" + jest-docblock "^26.0.0" + jest-haste-map "^26.6.2" + jest-leak-detector "^26.6.2" + jest-message-util "^26.6.2" + jest-resolve "^26.6.2" + jest-runtime "^26.6.3" + jest-util "^26.6.2" + jest-worker "^26.6.2" source-map-support "^0.5.6" - throat "^4.0.0" - -jest-runtime@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.9.0.tgz#9f14583af6a4f7314a6a9d9f0226e1a781c8e4ac" - integrity sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw== - dependencies: - "@jest/console" "^24.7.1" - "@jest/environment" "^24.9.0" - "@jest/source-map" "^24.3.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/yargs" "^13.0.0" - chalk "^2.0.1" + throat "^5.0.0" + +jest-runtime@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.6.3.tgz#4f64efbcfac398331b74b4b3c82d27d401b8fa2b" + integrity sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw== + dependencies: + "@jest/console" "^26.6.2" + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/globals" "^26.6.2" + "@jest/source-map" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + cjs-module-lexer "^0.6.0" + collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" - graceful-fs "^4.1.15" - jest-config "^24.9.0" - jest-haste-map "^24.9.0" - jest-message-util "^24.9.0" - jest-mock "^24.9.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.9.0" - jest-snapshot "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - realpath-native "^1.1.0" - slash "^2.0.0" - strip-bom "^3.0.0" - yargs "^13.3.0" - -jest-serializer@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.9.0.tgz#e6d7d7ef96d31e8b9079a714754c5d5c58288e73" - integrity sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ== - -jest-snapshot@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.9.0.tgz#ec8e9ca4f2ec0c5c87ae8f925cf97497b0e951ba" - integrity sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew== + graceful-fs "^4.2.4" + jest-config "^26.6.3" + jest-haste-map "^26.6.2" + jest-message-util "^26.6.2" + jest-mock "^26.6.2" + jest-regex-util "^26.0.0" + jest-resolve "^26.6.2" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" + slash "^3.0.0" + strip-bom "^4.0.0" + yargs "^15.4.1" + +jest-serializer@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" + integrity sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g== + dependencies: + "@types/node" "*" + graceful-fs "^4.2.4" + +jest-snapshot@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" + integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" - expect "^24.9.0" - jest-diff "^24.9.0" - jest-get-type "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-resolve "^24.9.0" - mkdirp "^0.5.1" + "@jest/types" "^26.6.2" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.0.0" + chalk "^4.0.0" + expect "^26.6.2" + graceful-fs "^4.2.4" + jest-diff "^26.6.2" + jest-get-type "^26.3.0" + jest-haste-map "^26.6.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-resolve "^26.6.2" natural-compare "^1.4.0" - pretty-format "^24.9.0" - semver "^6.2.0" - -jest-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.9.0.tgz#7396814e48536d2e85a37de3e4c431d7cb140162" - integrity sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg== - dependencies: - "@jest/console" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/source-map" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - callsites "^3.0.0" - chalk "^2.0.1" - graceful-fs "^4.1.15" + pretty-format "^26.6.2" + semver "^7.3.2" + +jest-util@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" + integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== + dependencies: + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + graceful-fs "^4.2.4" is-ci "^2.0.0" - mkdirp "^0.5.1" - slash "^2.0.0" - source-map "^0.6.0" + micromatch "^4.0.2" -jest-validate@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.9.0.tgz#0775c55360d173cd854e40180756d4ff52def8ab" - integrity sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ== +jest-validate@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.2.tgz#23d380971587150467342911c3d7b4ac57ab20ec" + integrity sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ== dependencies: - "@jest/types" "^24.9.0" - camelcase "^5.3.1" - chalk "^2.0.1" - jest-get-type "^24.9.0" + "@jest/types" "^26.6.2" + camelcase "^6.0.0" + chalk "^4.0.0" + jest-get-type "^26.3.0" leven "^3.1.0" - pretty-format "^24.9.0" - -jest-watcher@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.9.0.tgz#4b56e5d1ceff005f5b88e528dc9afc8dd4ed2b3b" - integrity sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw== - dependencies: - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/yargs" "^13.0.0" - ansi-escapes "^3.0.0" - chalk "^2.0.1" - jest-util "^24.9.0" - string-length "^2.0.0" - -jest-worker@^24.6.0, jest-worker@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" - integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== - dependencies: + pretty-format "^26.6.2" + +jest-watcher@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.6.2.tgz#a5b683b8f9d68dbcb1d7dae32172d2cca0592975" + integrity sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ== + dependencies: + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + jest-util "^26.6.2" + string-length "^4.0.1" + +jest-worker@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" + integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== + dependencies: + "@types/node" "*" merge-stream "^2.0.0" - supports-color "^6.1.0" + supports-color "^7.0.0" -jest@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.9.0.tgz#987d290c05a08b52c56188c1002e368edb007171" - integrity sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw== +jest@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.3.tgz#40e8fdbe48f00dfa1f0ce8121ca74b88ac9148ef" + integrity sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q== dependencies: - import-local "^2.0.0" - jest-cli "^24.9.0" + "@jest/core" "^26.6.3" + import-local "^3.0.2" + jest-cli "^26.6.3" js-levenshtein@^1.1.3: version "1.1.6" @@ -3284,41 +3819,49 @@ js-levenshtein@^1.1.3: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -jsdom@^11.5.1: - version "11.12.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" - integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== - dependencies: - abab "^2.0.0" - acorn "^5.5.3" - acorn-globals "^4.1.0" - array-equal "^1.0.0" - cssom ">= 0.3.2 < 0.4.0" - cssstyle "^1.0.0" - data-urls "^1.0.0" - domexception "^1.0.1" - escodegen "^1.9.1" - html-encoding-sniffer "^1.0.2" - left-pad "^1.3.0" - nwsapi "^2.0.7" - parse5 "4.0.0" - pn "^1.1.0" - request "^2.87.0" - request-promise-native "^1.0.5" - sax "^1.2.4" - symbol-tree "^3.2.2" - tough-cookie "^2.3.4" - w3c-hr-time "^1.0.1" - webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.3" - whatwg-mimetype "^2.1.0" - whatwg-url "^6.4.1" - ws "^5.2.0" +jsdom@^16.4.0: + version "16.5.3" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.5.3.tgz#13a755b3950eb938b4482c407238ddf16f0d2136" + integrity sha512-Qj1H+PEvUsOtdPJ056ewXM4UJPCi4hhLA8wpiz9F2YvsRBhuFsXxtrIFAgGBDynQA9isAMGE91PfUYbdMPXuTA== + dependencies: + abab "^2.0.5" + acorn "^8.1.0" + acorn-globals "^6.0.0" + cssom "^0.4.4" + cssstyle "^2.3.0" + data-urls "^2.0.0" + decimal.js "^10.2.1" + domexception "^2.0.1" + escodegen "^2.0.0" + html-encoding-sniffer "^2.0.1" + is-potential-custom-element-name "^1.0.0" + nwsapi "^2.2.0" + parse5 "6.0.1" + request "^2.88.2" + request-promise-native "^1.0.9" + saxes "^5.0.1" + symbol-tree "^3.2.4" + tough-cookie "^4.0.0" + w3c-hr-time "^1.0.2" + w3c-xmlserializer "^2.0.0" + webidl-conversions "^6.1.0" + whatwg-encoding "^1.0.5" + whatwg-mimetype "^2.3.0" + whatwg-url "^8.5.0" + ws "^7.4.4" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -3331,11 +3874,16 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= -json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: +json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -3365,6 +3913,13 @@ json5@^2.1.0: dependencies: minimist "^1.2.0" +json5@^2.1.2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== + dependencies: + minimist "^1.2.5" + jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -3404,11 +3959,6 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -left-pad@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" - integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== - leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -3422,15 +3972,10 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= loader-runner@^2.4.0: version "2.4.0" @@ -3454,16 +3999,23 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" -lodash@^4.17.13, lodash@^4.17.15: +lodash@^4.17.13: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== +lodash@^4.17.19, lodash@^4.7.0: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -3478,6 +4030,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -3486,6 +4045,13 @@ make-dir@^2.0.0, make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" +make-dir@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -3559,6 +4125,14 @@ micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -3579,6 +4153,11 @@ mime-types@^2.1.12, mime-types@~2.1.19: dependencies: mime-db "1.42.0" +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -3606,11 +4185,6 @@ minimist@^1.2.0, minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" @@ -3696,11 +4270,6 @@ neo-async@^2.5.0, neo-async@^2.6.1: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -neo-async@^2.6.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" - integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== - nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -3745,16 +4314,17 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-notifier@^5.4.2: - version "5.4.3" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.3.tgz#cb72daf94c93904098e28b9c590fd866e464bd50" - integrity sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q== +node-notifier@^8.0.0: + version "8.0.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.2.tgz#f3167a38ef0d2c8a866a83e318c1ba0efeb702c5" + integrity sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg== dependencies: growly "^1.3.0" - is-wsl "^1.1.0" - semver "^5.5.0" + is-wsl "^2.2.0" + semver "^7.3.2" shellwords "^0.1.1" - which "^1.3.0" + uuid "^8.3.0" + which "^2.0.2" node-releases@^1.1.42: version "1.1.43" @@ -3763,7 +4333,12 @@ node-releases@^1.1.42: dependencies: semver "^6.3.0" -normalize-package-data@^2.3.2: +node-releases@^1.1.71: + version "1.1.71" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" + integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== + +normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== @@ -3792,12 +4367,19 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" +npm-run-path@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + nwmatcher@1.4.4: version "1.4.4" resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.4.tgz#2285631f34a95f0d0395cd900c96ed39b58f346e" integrity sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ== -nwsapi@^2.0.7: +nwsapi@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== @@ -3821,12 +4403,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.0.11, object-keys@^1.0.12: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -3848,14 +4425,6 @@ object.assign@^4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" -object.getownpropertydescriptors@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" - integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -3870,13 +4439,12 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" + mimic-fn "^2.1.0" optionator@^0.8.1: version "0.8.3" @@ -3895,19 +4463,17 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= -p-each-series@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" - integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= - dependencies: - p-reduce "^1.0.0" +p-each-series@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" + integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= -p-limit@^2.0.0: +p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== @@ -3921,10 +4487,12 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" -p-reduce@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" - integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" p-try@^2.0.0: version "2.2.0" @@ -3956,18 +4524,20 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= +parse-json@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== dependencies: + "@babel/code-frame" "^7.0.0" error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" -parse5@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" - integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== +parse5@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== pascalcase@^0.1.1: version "0.1.1" @@ -3989,6 +4559,11 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -3999,18 +4574,16 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" @@ -4027,16 +4600,11 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picomatch@^2.0.4, picomatch@^2.2.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - pify@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" @@ -4056,10 +4624,12 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" posix-character-classes@^0.1.0: version "0.1.1" @@ -4071,15 +4641,15 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -pretty-format@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" - integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== +pretty-format@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" + integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== dependencies: - "@jest/types" "^24.9.0" - ansi-regex "^4.0.0" - ansi-styles "^3.2.0" - react-is "^16.8.4" + "@jest/types" "^26.6.2" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^17.0.1" private@^0.1.6: version "0.1.8" @@ -4114,11 +4684,16 @@ prr@~1.0.1: resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= -psl@^1.1.24, psl@^1.1.28: +psl@^1.1.28: version "1.6.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.6.0.tgz#60557582ee23b6c43719d9890fb4170ecd91e110" integrity sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA== +psl@^1.1.33: + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" @@ -4161,7 +4736,7 @@ punycode@1.3.2: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= -punycode@^1.2.4, punycode@^1.4.1: +punycode@^1.2.4: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= @@ -4210,27 +4785,29 @@ randomfill@^1.0.3: randombytes "^2.0.5" safe-buffer "^5.1.0" -react-is@^16.8.4: - version "16.12.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c" - integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q== +react-is@^17.0.1: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" + integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" "readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" @@ -4270,13 +4847,6 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" -realpath-native@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" - integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== - dependencies: - util.promisify "^1.0.0" - regenerate-unicode-properties@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" @@ -4343,26 +4913,26 @@ repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -request-promise-core@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9" - integrity sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ== +request-promise-core@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" + integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== dependencies: - lodash "^4.17.15" + lodash "^4.17.19" -request-promise-native@^1.0.5: - version "1.0.8" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.8.tgz#a455b960b826e44e2bf8999af64dff2bfe58cb36" - integrity sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ== +request-promise-native@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" + integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== dependencies: - request-promise-core "1.1.3" + request-promise-core "1.1.4" stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.87.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== +request@^2.88.2: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -4371,7 +4941,7 @@ request@^2.87.0: extend "~3.0.2" forever-agent "~0.6.1" form-data "~2.3.2" - har-validator "~5.1.0" + har-validator "~5.1.3" http-signature "~1.2.0" is-typedarray "~1.0.0" isstream "~0.1.2" @@ -4381,7 +4951,7 @@ request@^2.87.0: performance-now "^2.1.0" qs "~6.5.2" safe-buffer "^5.1.2" - tough-cookie "~2.4.3" + tough-cookie "~2.5.0" tunnel-agent "^0.6.0" uuid "^3.3.2" @@ -4395,28 +4965,23 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -resolve-cwd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" - integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== dependencies: - resolve-from "^3.0.0" + resolve-from "^5.0.0" -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - resolve@^1.10.0, resolve@^1.3.2: version "1.14.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.1.tgz#9e018c540fcf0c427d678b9931cbf45e984bcaff" @@ -4424,6 +4989,14 @@ resolve@^1.10.0, resolve@^1.3.2: dependencies: path-parse "^1.0.6" +resolve@^1.18.1: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -4436,6 +5009,13 @@ rimraf@^2.5.4, rimraf@^2.6.3: dependencies: glob "^7.1.3" +rimraf@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -4493,10 +5073,12 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +saxes@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" + integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== + dependencies: + xmlchars "^2.2.0" schema-utils@^1.0.0: version "1.0.0" @@ -4517,11 +5099,18 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.3.2: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + serialize-javascript@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" @@ -4564,11 +5153,23 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -4589,6 +5190,11 @@ slash@^2.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -4666,6 +5272,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@^0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + spdx-correct@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" @@ -4699,6 +5310,11 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + sshpk@1.16.1, sshpk@^1.7.0: version "1.16.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" @@ -4721,10 +5337,12 @@ ssri@^6.0.1: dependencies: figgy-pudding "^3.5.1" -stack-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" - integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== +stack-utils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" + integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== + dependencies: + escape-string-regexp "^2.0.0" static-extend@^0.1.1: version "0.1.2" @@ -4771,13 +5389,13 @@ stream-shift@^1.0.0: resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== -string-length@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" - integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= +string-length@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== dependencies: - astral-regex "^1.0.0" - strip-ansi "^4.0.0" + char-regex "^1.0.2" + strip-ansi "^6.0.0" string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" @@ -4788,21 +5406,14 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string.prototype.trimleft@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" - integrity sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - -string.prototype.trimright@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz#440314b15996c866ce8a0341894d45186200c5d9" - integrity sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" @@ -4818,13 +5429,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" @@ -4832,16 +5436,28 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -4849,14 +5465,22 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== +supports-color@^7.0.0, supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: - has-flag "^3.0.0" + has-flag "^4.0.0" -symbol-tree@^3.2.2: +supports-hyperlinks@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" + integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== + dependencies: + has-flag "^4.0.0" + supports-color "^7.0.0" + +symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== @@ -4866,6 +5490,14 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== +terminal-link@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" + integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== + dependencies: + ansi-escapes "^4.2.1" + supports-hyperlinks "^2.0.0" + terser-webpack-plugin@^1.4.3: version "1.4.5" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b" @@ -4890,20 +5522,19 @@ terser@^4.1.2: source-map "~0.6.1" source-map-support "~0.5.12" -test-exclude@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== dependencies: - glob "^7.1.3" + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" -throat@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" - integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= +throat@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" + integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== through2@^2.0.0: version "2.0.5" @@ -4967,7 +5598,7 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@^2.3.3, tough-cookie@^2.3.4: +tough-cookie@^2.3.3, tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== @@ -4975,20 +5606,21 @@ tough-cookie@^2.3.3, tough-cookie@^2.3.4: psl "^1.1.28" punycode "^2.1.1" -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== +tough-cookie@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" + integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg== dependencies: - psl "^1.1.24" - punycode "^1.4.1" + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.1.2" -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= +tr46@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479" + integrity sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg== dependencies: - punycode "^2.1.0" + punycode "^2.1.1" tty-browserify@0.0.0: version "0.0.0" @@ -5014,19 +5646,38 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -uglify-js@^3.1.4: - version "3.7.2" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.2.tgz#cb1a601e67536e9ed094a92dd1e333459643d3f9" - integrity sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA== - dependencies: - commander "~2.20.3" - source-map "~0.6.1" - unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" @@ -5074,6 +5725,11 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" +universalify@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -5117,14 +5773,6 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -util.promisify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" - integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== - dependencies: - define-properties "^1.1.2" - object.getownpropertydescriptors "^2.0.3" - util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" @@ -5144,6 +5792,20 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== +uuid@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +v8-to-istanbul@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.1.tgz#04bfd1026ba4577de5472df4f5e89af49de5edda" + integrity sha512-p0BB09E5FRjx0ELN6RgusIPsSPhtgexSRcKETybEs6IGOTXJSZqfwxp7r//55nnu0f1AxltY5VvdVqy2vZf9AA== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^1.6.0" + source-map "^0.7.3" + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -5166,12 +5828,19 @@ vm-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== -w3c-hr-time@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" - integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= +w3c-hr-time@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" + integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== + dependencies: + browser-process-hrtime "^1.0.0" + +w3c-xmlserializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" + integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== dependencies: - browser-process-hrtime "^0.1.2" + xml-name-validator "^3.0.0" walker@^1.0.7, walker@~1.0.5: version "1.0.7" @@ -5198,10 +5867,15 @@ watchpack@^1.7.4: chokidar "^3.4.1" watchpack-chokidar2 "^2.0.1" -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== +webidl-conversions@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" + integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== + +webidl-conversions@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" + integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== webpack-sources@^1.4.0, webpack-sources@^1.4.1: version "1.4.3" @@ -5240,58 +5914,51 @@ webpack@^4.41.0: watchpack "^1.7.4" webpack-sources "^1.4.1" -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: +whatwg-encoding@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== dependencies: iconv-lite "0.4.24" -whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: +whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@^6.4.1: - version "6.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" - integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== +whatwg-url@^8.0.0, whatwg-url@^8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.5.0.tgz#7752b8464fc0903fec89aa9846fc9efe07351fd3" + integrity sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg== dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" + lodash "^4.7.0" + tr46 "^2.0.2" + webidl-conversions "^6.1.0" which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@^1.2.9, which@^1.3.0: +which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" +which@^2.0.1, which@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - worker-farm@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" @@ -5308,32 +5975,45 @@ wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" - integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== dependencies: - graceful-fs "^4.1.11" imurmurhash "^0.1.4" + is-typedarray "^1.0.0" signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" -ws@^5.2.0: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" +ws@^7.4.4: + version "7.4.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1" + integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g== xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + xtend@^4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -5349,13 +6029,10 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yargs-parser@^13.1.1: - version "13.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" - integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yargs-parser@^15.0.0: version "15.0.0" @@ -5365,12 +6042,21 @@ yargs-parser@^15.0.0: camelcase "^5.0.0" decamelize "^1.2.0" -yargs@^13.3.0: - version "13.3.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" - integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== +yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^14.2.0: + version "14.2.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.2.tgz#2769564379009ff8597cdd38fba09da9b493c4b5" + integrity sha512-/4ld+4VV5RnrynMhPZJ/ZpOCGSCeghMykZ3BhdFBDa9Wy/RH6uEGNWDJog+aUlq+9OM1CFTgtYRW5Is1Po9NOA== dependencies: cliui "^5.0.0" + decamelize "^1.2.0" find-up "^3.0.0" get-caller-file "^2.0.1" require-directory "^2.1.1" @@ -5379,21 +6065,21 @@ yargs@^13.3.0: string-width "^3.0.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^13.1.1" + yargs-parser "^15.0.0" -yargs@^14.2.0: - version "14.2.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.2.tgz#2769564379009ff8597cdd38fba09da9b493c4b5" - integrity sha512-/4ld+4VV5RnrynMhPZJ/ZpOCGSCeghMykZ3BhdFBDa9Wy/RH6uEGNWDJog+aUlq+9OM1CFTgtYRW5Is1Po9NOA== +yargs@^15.4.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== dependencies: - cliui "^5.0.0" + cliui "^6.0.0" decamelize "^1.2.0" - find-up "^3.0.0" + find-up "^4.1.0" get-caller-file "^2.0.1" require-directory "^2.1.1" require-main-filename "^2.0.0" set-blocking "^2.0.0" - string-width "^3.0.0" + string-width "^4.2.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^15.0.0" + yargs-parser "^18.1.2" From 9d489354ae373614b20cd91f588eb25743686ee0 Mon Sep 17 00:00:00 2001 From: Nadiia D Date: Mon, 26 Apr 2021 22:56:28 -0700 Subject: [PATCH 071/259] Stabilize RootTagContext Summary: Changelog: [General][Added] - Stabilize RootTagContext. And temporarily export both `unstable_RootTagContext` and `RootTagContext` Reviewed By: TheSavior Differential Revision: D27951427 fbshipit-source-id: dff8d4ca07c89edeeb517a42a3922e4e23899d8e --- index.js | 3 +++ .../js/examples/TurboModule/SampleTurboModuleExample.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6062f45ea064a1..9f1b2333699016 100644 --- a/index.js +++ b/index.js @@ -482,6 +482,9 @@ module.exports = { get unstable_RootTagContext(): RootTagContext { return require('./Libraries/ReactNative/RootTag').RootTagContext; }, + get RootTagContext(): RootTagContext { + return require('./Libraries/ReactNative/RootTag').RootTagContext; + }, get unstable_enableLogBox(): () => void { return () => console.warn( diff --git a/packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js b/packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js index 08f4701edfcefd..6526ea5a9c6638 100644 --- a/packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js +++ b/packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js @@ -17,7 +17,7 @@ import { FlatList, Platform, TouchableOpacity, - unstable_RootTagContext, + RootTagContext, } from 'react-native'; import * as React from 'react'; @@ -33,7 +33,7 @@ type State = {| |}; class SampleTurboModuleExample extends React.Component<{||}, State> { - static contextType: React$Context = unstable_RootTagContext; + static contextType: React$Context = RootTagContext; state: State = { testResults: {}, From 9b98edcd0155a4a8a1f71d19e565c485910a6137 Mon Sep 17 00:00:00 2001 From: Nadiia D Date: Mon, 26 Apr 2021 22:56:28 -0700 Subject: [PATCH 072/259] Stabilize RootTagContext Summary: Changelog: [General][Removed] - Stabilize RootTagContext Reviewed By: TheSavior Differential Revision: D27954168 fbshipit-source-id: ff04375f00229b1a601cbd1182001885d8b687ec --- index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/index.js b/index.js index 9f1b2333699016..52b818554ecb7c 100644 --- a/index.js +++ b/index.js @@ -479,9 +479,6 @@ module.exports = { ) => HostComponent { return require('./Libraries/ReactNative/requireNativeComponent'); }, - get unstable_RootTagContext(): RootTagContext { - return require('./Libraries/ReactNative/RootTag').RootTagContext; - }, get RootTagContext(): RootTagContext { return require('./Libraries/ReactNative/RootTag').RootTagContext; }, From 46ffe84453aaf3836da6abfe4c0b078ca0ac4f21 Mon Sep 17 00:00:00 2001 From: Nadiia D Date: Mon, 26 Apr 2021 22:56:28 -0700 Subject: [PATCH 073/259] Make RootTag an opaque type Summary: Changelog: [General][Changed] Make the RootTag an opaque type Reviewed By: yungsters Differential Revision: D27992320 fbshipit-source-id: 2901f0e59f573106295b986fe04db227134235da --- Libraries/Image/Image.android.js | 3 ++- Libraries/Image/Image.ios.js | 5 ++++- Libraries/Image/NativeImageLoaderIOS.js | 3 ++- Libraries/ReactNative/AppContainer.js | 3 ++- Libraries/ReactNative/AppRegistry.js | 5 ++++- Libraries/ReactNative/DummyUIManager.js | 4 +++- Libraries/ReactNative/FabricUIManager.js | 7 ++++--- Libraries/ReactNative/NativeUIManager.js | 3 ++- Libraries/ReactNative/PaperUIManager.js | 3 ++- Libraries/ReactNative/RootTag.js | 4 ++-- Libraries/ReactNative/UIManager.js | 3 ++- Libraries/TurboModule/RCTExport.js | 2 +- Libraries/Types/RootTagTypes.js | 11 +++++++++++ .../src/androidTest/js/UIManagerTestModule.js | 13 +++++++------ 14 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 Libraries/Types/RootTagTypes.js diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index 08f81303528264..2f9aec0d6666a9 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -27,6 +27,7 @@ import NativeImageLoaderAndroid from './NativeImageLoaderAndroid'; const TextInlineImageNativeComponent = require('./TextInlineImageNativeComponent'); import type {ImageProps as ImagePropsType} from './ImageProps'; +import type {RootTag} from '../Types/RootTagTypes'; let _requestId = 1; function generateRequestId() { @@ -195,7 +196,7 @@ function getSizeWithHeaders( function prefetchWithMetadata( url: string, queryRootName: string, - rootTag?: ?number, + rootTag?: ?RootTag, callback: ?Function, ): any { // TODO: T79192300 Log queryRootName and rootTag diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 850ccfa7067bdc..45905817540189 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -23,6 +23,7 @@ import type {ImageStyleProp} from '../StyleSheet/StyleSheet'; import NativeImageLoaderIOS from './NativeImageLoaderIOS'; import ImageViewNativeComponent from './ImageViewNativeComponent'; +import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes'; function getSize( uri: string, @@ -60,13 +61,15 @@ function getSizeWithHeaders( function prefetchWithMetadata( url: string, queryRootName: string, - rootTag?: ?number, + rootTag?: ?RootTag, ): any { if (NativeImageLoaderIOS.prefetchImageWithMetadata) { // number params like rootTag cannot be nullable before TurboModules is available return NativeImageLoaderIOS.prefetchImageWithMetadata( url, queryRootName, + // NOTE: RootTag type + // $FlowFixMe[incompatible-call] RootTag: number is incompatible with RootTag rootTag ? rootTag : 0, ); } else { diff --git a/Libraries/Image/NativeImageLoaderIOS.js b/Libraries/Image/NativeImageLoaderIOS.js index cbebf34e2d1167..91c65a6e245cad 100644 --- a/Libraries/Image/NativeImageLoaderIOS.js +++ b/Libraries/Image/NativeImageLoaderIOS.js @@ -8,6 +8,7 @@ * @format */ +import type {RootTag} from '../TurboModule/RCTExport'; import type {TurboModule} from '../TurboModule/RCTExport'; import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; @@ -27,7 +28,7 @@ export interface Spec extends TurboModule { +prefetchImageWithMetadata?: ( uri: string, queryRootName: string, - rootTag: number, + rootTag: RootTag, ) => Promise; +queryCache: (uris: Array) => Promise; } diff --git a/Libraries/ReactNative/AppContainer.js b/Libraries/ReactNative/AppContainer.js index 7740178689de09..5d96cc739b9c6b 100644 --- a/Libraries/ReactNative/AppContainer.js +++ b/Libraries/ReactNative/AppContainer.js @@ -13,12 +13,13 @@ import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter'; import StyleSheet from '../StyleSheet/StyleSheet'; import {type EventSubscription} from '../vendor/emitter/EventEmitter'; import {RootTagContext, createRootTag} from './RootTag'; +import type {RootTag} from './RootTag'; import * as React from 'react'; type Props = $ReadOnly<{| children?: React.Node, fabric?: boolean, - rootTag: number, + rootTag: number | RootTag, initialProps?: {...}, showArchitectureIndicator?: boolean, WrapperComponent?: ?React.ComponentType, diff --git a/Libraries/ReactNative/AppRegistry.js b/Libraries/ReactNative/AppRegistry.js index 96edccc10963f1..0bb8a8658f7ef0 100644 --- a/Libraries/ReactNative/AppRegistry.js +++ b/Libraries/ReactNative/AppRegistry.js @@ -22,6 +22,7 @@ import {coerceDisplayMode} from './DisplayMode'; import createPerformanceLogger from '../Utilities/createPerformanceLogger'; import NativeHeadlessJsTaskSupport from './NativeHeadlessJsTaskSupport'; import HeadlessJsTaskError from './HeadlessJsTaskError'; +import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes'; type Task = (taskData: any) => Promise; export type TaskProvider = () => Task; @@ -243,7 +244,9 @@ const AppRegistry = { * * See https://reactnative.dev/docs/appregistry.html#unmountapplicationcomponentatroottag */ - unmountApplicationComponentAtRootTag(rootTag: number): void { + unmountApplicationComponentAtRootTag(rootTag: RootTag): void { + // NOTE: RootTag type + // $FlowFixMe[incompatible-call] RootTag: RootTag is incompatible with number, needs an updated synced version of the ReactNativeTypes.js file ReactNative.unmountComponentAtNodeAndRemoveContainer(rootTag); }, diff --git a/Libraries/ReactNative/DummyUIManager.js b/Libraries/ReactNative/DummyUIManager.js index 0d380f0a276f86..fd66374dc083cf 100644 --- a/Libraries/ReactNative/DummyUIManager.js +++ b/Libraries/ReactNative/DummyUIManager.js @@ -10,6 +10,8 @@ 'use strict'; +import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes'; + module.exports = { getViewManagerConfig: (viewManagerName: string): mixed => { console.warn( @@ -30,7 +32,7 @@ module.exports = { createView: ( reactTag: ?number, viewName: string, - rootTag: number, + rootTag: RootTag, props: Object, ) => {}, updateView: (reactTag: number, viewName: string, props: Object) => {}, diff --git a/Libraries/ReactNative/FabricUIManager.js b/Libraries/ReactNative/FabricUIManager.js index 62c17e8e4ad996..987ef84f3812da 100644 --- a/Libraries/ReactNative/FabricUIManager.js +++ b/Libraries/ReactNative/FabricUIManager.js @@ -16,6 +16,7 @@ import type { MeasureLayoutOnSuccessCallback, LayoutAnimationConfig, } from '../Renderer/shims/ReactNativeTypes'; +import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes'; // TODO: type these properly. type Node = {...}; @@ -26,7 +27,7 @@ export type Spec = {| +createNode: ( reactTag: number, viewName: string, - rootTag: number, + rootTag: RootTag, props: NodeProps, instanceHandle: InstanceHandle, ) => Node, @@ -34,10 +35,10 @@ export type Spec = {| +cloneNodeWithNewChildren: (node: Node) => Node, +cloneNodeWithNewProps: (node: Node, newProps: NodeProps) => Node, +cloneNodeWithNewChildrenAndProps: (node: Node, newProps: NodeProps) => Node, - +createChildSet: (rootTag: number) => NodeSet, + +createChildSet: (rootTag: RootTag) => NodeSet, +appendChild: (parentNode: Node, child: Node) => Node, +appendChildToSet: (childSet: NodeSet, child: Node) => void, - +completeRoot: (rootTag: number, childSet: NodeSet) => void, + +completeRoot: (rootTag: RootTag, childSet: NodeSet) => void, +measure: (node: Node, callback: MeasureOnSuccessCallback) => void, +measureInWindow: ( node: Node, diff --git a/Libraries/ReactNative/NativeUIManager.js b/Libraries/ReactNative/NativeUIManager.js index 53fa251eed93d5..ce77d2d4db341d 100644 --- a/Libraries/ReactNative/NativeUIManager.js +++ b/Libraries/ReactNative/NativeUIManager.js @@ -8,6 +8,7 @@ * @format */ +import type {RootTag} from '../TurboModule/RCTExport'; import type {TurboModule} from '../TurboModule/RCTExport'; import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; @@ -19,7 +20,7 @@ export interface Spec extends TurboModule { +createView: ( reactTag: ?number, viewName: string, - rootTag: number, + rootTag: RootTag, props: Object, ) => void; +updateView: (reactTag: number, viewName: string, props: Object) => void; diff --git a/Libraries/ReactNative/PaperUIManager.js b/Libraries/ReactNative/PaperUIManager.js index fe9cc014cc6e01..c468958e566320 100644 --- a/Libraries/ReactNative/PaperUIManager.js +++ b/Libraries/ReactNative/PaperUIManager.js @@ -15,6 +15,7 @@ const UIManagerProperties = require('./UIManagerProperties'); const defineLazyObjectProperty = require('../Utilities/defineLazyObjectProperty'); import NativeUIManager from './NativeUIManager'; +import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes'; const viewManagerConfigs = {}; @@ -84,7 +85,7 @@ const UIManagerJS = { createView( reactTag: ?number, viewName: string, - rootTag: number, + rootTag: RootTag, props: Object, ): void { if (Platform.OS === 'ios' && viewManagerConfigs[viewName] === undefined) { diff --git a/Libraries/ReactNative/RootTag.js b/Libraries/ReactNative/RootTag.js index 0470e42487e322..03c83a86af9713 100644 --- a/Libraries/ReactNative/RootTag.js +++ b/Libraries/ReactNative/RootTag.js @@ -11,7 +11,7 @@ import * as React from 'react'; // TODO: Make this into an opaque type. -export type RootTag = number; +export opaque type RootTag = number; export const RootTagContext: React$Context = React.createContext( 0, @@ -24,6 +24,6 @@ if (__DEV__) { /** * Intended to only be used by `AppContainer`. */ -export function createRootTag(rootTag: number): RootTag { +export function createRootTag(rootTag: number | RootTag): RootTag { return rootTag; } diff --git a/Libraries/ReactNative/UIManager.js b/Libraries/ReactNative/UIManager.js index 668961338d2d10..ac916e66a2410b 100644 --- a/Libraries/ReactNative/UIManager.js +++ b/Libraries/ReactNative/UIManager.js @@ -10,6 +10,7 @@ import UIManagerInjection from './UIManagerInjection'; import type {Spec} from './NativeUIManager'; +import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes'; interface UIManagerJSInterface extends Spec { +getViewManagerConfig: (viewManagerName: string) => Object; @@ -17,7 +18,7 @@ interface UIManagerJSInterface extends Spec { +createView: ( reactTag: ?number, viewName: string, - rootTag: number, + rootTag: RootTag, props: Object, ) => void; +updateView: (reactTag: number, viewName: string, props: Object) => void; diff --git a/Libraries/TurboModule/RCTExport.js b/Libraries/TurboModule/RCTExport.js index bbf236ed452d3d..d68194adb36194 100644 --- a/Libraries/TurboModule/RCTExport.js +++ b/Libraries/TurboModule/RCTExport.js @@ -35,4 +35,4 @@ export interface DEPRECATED_RCTExport { export interface TurboModule extends DEPRECATED_RCTExport {} -export type {RootTag} from '../ReactNative/RootTag.js'; +export type {RootTag} from '../Types/RootTagTypes.js'; diff --git a/Libraries/Types/RootTagTypes.js b/Libraries/Types/RootTagTypes.js new file mode 100644 index 00000000000000..4fde211e5f02b0 --- /dev/null +++ b/Libraries/Types/RootTagTypes.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict + * @format + */ + +export type {RootTag} from '../ReactNative/RootTag'; diff --git a/ReactAndroid/src/androidTest/js/UIManagerTestModule.js b/ReactAndroid/src/androidTest/js/UIManagerTestModule.js index 61b0d0b2f384dd..25c7c5e0cc75c1 100644 --- a/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +++ b/ReactAndroid/src/androidTest/js/UIManagerTestModule.js @@ -16,6 +16,7 @@ const React = require('react'); const renderApplication = require('react-native/Libraries/ReactNative/renderApplication'); const {StyleSheet, Text, View} = require('react-native'); +import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes'; type FlexTestAppProps = $ReadOnly<{||}>; class FlexTestApp extends React.Component { @@ -234,26 +235,26 @@ const UpdatePositionInListTestAppStyles = StyleSheet.create({ const emptyExactProps = Object.freeze({}); const UIManagerTestModule = { - renderFlexTestApplication(rootTag: number) { + renderFlexTestApplication(rootTag: RootTag) { renderApplication(FlexTestApp, emptyExactProps, rootTag); }, - renderFlexWithTextApplication(rootTag: number) { + renderFlexWithTextApplication(rootTag: RootTag) { renderApplication(FlexWithText, emptyExactProps, rootTag); }, - renderAbsolutePositionBottomRightTestApplication(rootTag: number) { + renderAbsolutePositionBottomRightTestApplication(rootTag: RootTag) { renderApplication( AbsolutePositionBottomRightTestApp, emptyExactProps, rootTag, ); }, - renderAbsolutePositionTestApplication(rootTag: number) { + renderAbsolutePositionTestApplication(rootTag: RootTag) { renderApplication(AbsolutePositionTestApp, emptyExactProps, rootTag); }, - renderCenteredTextViewTestApplication(rootTag: number, text: string) { + renderCenteredTextViewTestApplication(rootTag: RootTag, text: string) { renderApplication(CenteredTextView, {text: text}, rootTag); }, - renderUpdatePositionInListTestApplication(rootTag: number) { + renderUpdatePositionInListTestApplication(rootTag: RootTag) { renderApplication(UpdatePositionInListTestApp, emptyExactProps, rootTag); }, flushUpdatePositionInList, From 841756b150d7809acf9c747d9ca1a5c143d6b779 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 27 Apr 2021 00:26:47 -0700 Subject: [PATCH 074/259] Implement RuntimeScheduler::getCurrentPriorityLevel Summary: Changelog: [internal] Implement `RuntimeScheduler::getCurrentPriorityLevel`. JavaScript implementation: https://github.com/facebook/react/blob/master/packages/scheduler/src/forks/SchedulerNoDOM.js#L63 Reviewed By: ShikaSD Differential Revision: D27998510 fbshipit-source-id: 634c09185f9eae8f7afcdb6acd9b74effd587da7 --- .../runtimescheduler/RuntimeScheduler.cpp | 17 +++++--- .../runtimescheduler/RuntimeScheduler.h | 3 ++ .../RuntimeSchedulerBinding.cpp | 5 +++ .../tests/RuntimeSchedulerTest.cpp | 39 +++++++++++++++++++ 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp index 0c1942f102cd13..d899151723b01c 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp @@ -29,27 +29,28 @@ std::shared_ptr RuntimeScheduler::scheduleTask( isCallbackScheduled_ = true; runtimeExecutor_([this](jsi::Runtime &runtime) { isCallbackScheduled_ = false; - + auto previousPriority = currentPriority_; while (!taskQueue_.empty()) { - auto topPriority = taskQueue_.top(); + auto topPriorityTask = taskQueue_.top(); auto now = now_(); - auto didUserCallbackTimeout = topPriority->expirationTime <= now; + auto didUserCallbackTimeout = topPriorityTask->expirationTime <= now; if (!didUserCallbackTimeout && shouldYield_) { // This task hasn't expired and we need to yield. break; } - - auto result = topPriority->execute(runtime); + currentPriority_ = topPriorityTask->priority; + auto result = topPriorityTask->execute(runtime); if (result.isObject() && result.getObject(runtime).isFunction(runtime)) { - topPriority->callback = + topPriorityTask->callback = result.getObject(runtime).getFunction(runtime); } else { taskQueue_.pop(); } } + currentPriority_ = previousPriority; }); } @@ -64,6 +65,10 @@ bool RuntimeScheduler::getShouldYield() const { return shouldYield_; } +SchedulerPriority RuntimeScheduler::getCurrentPriorityLevel() const { + return currentPriority_; +} + RuntimeSchedulerTimePoint RuntimeScheduler::now() const { return now_(); } diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h index 5b1b65efd2f936..ee261fa9c033d3 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h @@ -31,6 +31,8 @@ class RuntimeScheduler final { bool getShouldYield() const; + SchedulerPriority getCurrentPriorityLevel() const; + RuntimeSchedulerTimePoint now() const; private: @@ -40,6 +42,7 @@ class RuntimeScheduler final { TaskPriorityComparer> taskQueue_; RuntimeExecutor const runtimeExecutor_; + SchedulerPriority currentPriority_{SchedulerPriority::NormalPriority}; std::atomic_bool shouldYield_{false}; /* diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp index 749389b9bc0857..7745851e2cde65 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp @@ -133,6 +133,11 @@ jsi::Value RuntimeSchedulerBinding::get( }); } + if (propertyName == "unstable_getCurrentPriorityLevel") { + auto currentPriorityLevel = runtimeScheduler_->getCurrentPriorityLevel(); + return jsi::Value(runtime, serialize(currentPriorityLevel)); + } + if (propertyName == "unstable_ImmediatePriority") { return jsi::Value(runtime, serialize(SchedulerPriority::ImmediatePriority)); } diff --git a/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp b/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp index 412dbeb093d29c..e7e106921ff086 100644 --- a/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp @@ -273,4 +273,43 @@ TEST_F(RuntimeSchedulerTest, continuationTask) { EXPECT_EQ(stubQueue_->size(), 0); } +TEST_F(RuntimeSchedulerTest, getCurrentPriorityLevel) { + auto callback = + createHostFunctionFromLambda([this](bool didUserCallbackTimeout) { + EXPECT_EQ( + runtimeScheduler_->getCurrentPriorityLevel(), + SchedulerPriority::ImmediatePriority); + return jsi::Value::undefined(); + }); + + EXPECT_EQ( + runtimeScheduler_->getCurrentPriorityLevel(), + SchedulerPriority::NormalPriority); + + runtimeScheduler_->scheduleTask( + SchedulerPriority::ImmediatePriority, std::move(callback)); + + stubQueue_->tick(); + + EXPECT_EQ( + runtimeScheduler_->getCurrentPriorityLevel(), + SchedulerPriority::NormalPriority); + + callback = createHostFunctionFromLambda([this](bool didUserCallbackTimeout) { + EXPECT_EQ( + runtimeScheduler_->getCurrentPriorityLevel(), + SchedulerPriority::IdlePriority); + return jsi::Value::undefined(); + }); + + runtimeScheduler_->scheduleTask( + SchedulerPriority::IdlePriority, std::move(callback)); + + stubQueue_->tick(); + + EXPECT_EQ( + runtimeScheduler_->getCurrentPriorityLevel(), + SchedulerPriority::NormalPriority); +} + } // namespace facebook::react From ef0db95300b5ed0a4f0af3423558f633ba9ed1af Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Tue, 27 Apr 2021 03:58:38 -0700 Subject: [PATCH 075/259] Back out "Adjust animation batch numbers to be consistent when controlled by native" Summary: This change caused crashes in animations on some surfaces. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D28013969 fbshipit-source-id: 95845c69d6e67d59582ea14ad08cbf42fd3e2f8f --- Libraries/Animated/__tests__/Animated-test.js | 11 +++++-- .../Animated/__tests__/AnimatedNative-test.js | 12 +++++-- Libraries/Animated/createAnimatedComponent.js | 16 +++++---- .../react/animated/NativeAnimatedModule.java | 17 ++-------- jest/setup.js | 33 ------------------- 5 files changed, 29 insertions(+), 60 deletions(-) diff --git a/Libraries/Animated/__tests__/Animated-test.js b/Libraries/Animated/__tests__/Animated-test.js index d5b05cc49a63bc..f7a8bb05ace086 100644 --- a/Libraries/Animated/__tests__/Animated-test.js +++ b/Libraries/Animated/__tests__/Animated-test.js @@ -11,9 +11,14 @@ import TestRenderer from 'react-test-renderer'; import * as React from 'react'; -jest.mock('../NativeAnimatedHelper', () => { - return jest.requireActual('../NativeAnimatedHelper'); -}); +jest.mock('../../BatchedBridge/NativeModules', () => ({ + NativeAnimatedModule: {}, + PlatformConstants: { + getConstants() { + return {}; + }, + }, +})); let Animated = require('../Animated'); describe('Animated tests', () => { diff --git a/Libraries/Animated/__tests__/AnimatedNative-test.js b/Libraries/Animated/__tests__/AnimatedNative-test.js index 8466b15483c50b..e5ecec1fb7d648 100644 --- a/Libraries/Animated/__tests__/AnimatedNative-test.js +++ b/Libraries/Animated/__tests__/AnimatedNative-test.js @@ -10,9 +10,15 @@ jest .clearAllMocks() - .mock('../NativeAnimatedHelper', () => { - return jest.requireActual('../NativeAnimatedHelper'); - }) + .mock('../../BatchedBridge/NativeModules', () => ({ + NativeAnimatedModule: {}, + PlatformConstants: { + getConstants() { + return {}; + }, + }, + })) + .mock('../NativeAnimatedModule') .mock('../../EventEmitter/NativeEventEmitter') // findNodeHandle is imported from ReactNative so mock that whole module. .setMock('../../Renderer/shims/ReactNative', {findNodeHandle: () => 1}); diff --git a/Libraries/Animated/createAnimatedComponent.js b/Libraries/Animated/createAnimatedComponent.js index c86e63cd88cd29..596c6cfc75c58c 100644 --- a/Libraries/Animated/createAnimatedComponent.js +++ b/Libraries/Animated/createAnimatedComponent.js @@ -121,15 +121,19 @@ function createAnimatedComponent( }; _waitForUpdate = (): void => { - NativeAnimatedHelper.API.setWaitingForIdentifier( - this._animatedComponentId, - ); + if (this._isFabric()) { + NativeAnimatedHelper.API.setWaitingForIdentifier( + this._animatedComponentId, + ); + } }; _markUpdateComplete = (): void => { - NativeAnimatedHelper.API.unsetWaitingForIdentifier( - this._animatedComponentId, - ); + if (this._isFabric()) { + NativeAnimatedHelper.API.unsetWaitingForIdentifier( + this._animatedComponentId, + ); + } }; // The system is best designed when setNativeProps is implemented. It is diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java index b12d75c86a6fe0..9d6f4299db2ba3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java @@ -174,7 +174,7 @@ public void onHostResume() { } private void addOperation(UIThreadOperation operation) { - operation.setBatchNumber(getCurrentBatchNumber()); + operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1); mOperations.add(operation); } @@ -184,7 +184,7 @@ private void addUnbatchedOperation(UIThreadOperation operation) { } private void addPreOperation(UIThreadOperation operation) { - operation.setBatchNumber(getCurrentBatchNumber()); + operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1); mPreOperations.add(operation); } @@ -342,13 +342,6 @@ private void enqueueFrameCallback() { ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE, mAnimatedFrameCallback); } - private long getCurrentBatchNumber() { - if (mBatchingControlledByJS && !mIsInBatch) { - return -1; - } - return mCurrentBatchNumber; - } - @VisibleForTesting public void setNodesManager(NativeAnimatedNodesManager nodesManager) { mNodesManager.set(nodesManager); @@ -433,9 +426,6 @@ private void decrementInFlightAnimationsForViewTag(final int viewTag) { @Override public void startOperationBatch() { - if (ANIMATED_MODULE_DEBUG) { - FLog.d(NAME, "Start JS operation batch " + mCurrentBatchNumber); - } mBatchingControlledByJS = true; mIsInBatch = true; mCurrentBatchNumber++; @@ -443,9 +433,6 @@ public void startOperationBatch() { @Override public void finishOperationBatch() { - if (ANIMATED_MODULE_DEBUG) { - FLog.d(NAME, "Finish JS operation batch " + mCurrentBatchNumber); - } mBatchingControlledByJS = true; mIsInBatch = false; mCurrentBatchNumber++; diff --git a/jest/setup.js b/jest/setup.js index a37cbb3865e24c..c759924d23c38b 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -332,30 +332,6 @@ jest doLeftAndRightSwapInRTL: true, }), }, - NativeAnimatedModule: { - startOperationBatch: jest.fn(), - finishOperationBatch: jest.fn(), - createAnimatedNode: jest.fn(), - getValue: jest.fn(), - startListeningToAnimatedNodeValue: jest.fn(), - stopListeningToAnimatedNodeValue: jest.fn(), - connectAnimatedNodes: jest.fn(), - disconnectAnimatedNodes: jest.fn(), - startAnimatingNode: jest.fn(), - stopAnimation: jest.fn(), - setAnimatedNodeValue: jest.fn(), - setAnimatedNodeOffset: jest.fn(), - flattenAnimatedNodeOffset: jest.fn(), - extractAnimatedNodeOffset: jest.fn(), - connectAnimatedNodeToView: jest.fn(), - disconnectAnimatedNodeFromView: jest.fn(), - restoreDefaultValues: jest.fn(), - dropAnimatedNode: jest.fn(), - addAnimatedEventToView: jest.fn(), - removeAnimatedEventFromView: jest.fn(), - addListener: jest.fn(), - removeListeners: jest.fn(), - }, })) .mock('../Libraries/NativeComponent/NativeComponentRegistry', () => { return { @@ -389,13 +365,4 @@ jest __esModule: true, default: Component, }; - }) - .mock('../Libraries/Animated/NativeAnimatedHelper.js', () => { - const NativeAnimatedHelper = jest.requireActual( - '../Libraries/Animated/NativeAnimatedHelper.js', - ); - return { - ...NativeAnimatedHelper, - shouldUseNativeDriver: jest.fn(false), - }; }); From 0aa7e5b5d4e427f9d3aa320f74b5a1adc56629ea Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Tue, 27 Apr 2021 03:58:38 -0700 Subject: [PATCH 076/259] Back out "Assign batch number to only batched animated instructions" Summary: This change broke some animations on non-Fabric surfaces due to inconsistent batching of animation operations. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D28013968 fbshipit-source-id: 2f65c799dbe00168f1e756ef0af60206df5a8fcc --- .../com/facebook/react/animated/NativeAnimatedModule.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java index 9d6f4299db2ba3..dd7a0c1b2f3c0d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java @@ -118,7 +118,6 @@ public long getBatchNumber() { private boolean mBatchingControlledByJS = false; // TODO T71377544: delete private volatile long mCurrentFrameNumber; // TODO T71377544: delete private volatile long mCurrentBatchNumber; - private volatile boolean mIsInBatch = false; private boolean mInitializedForFabric = false; private boolean mInitializedForNonFabric = false; @@ -174,7 +173,7 @@ public void onHostResume() { } private void addOperation(UIThreadOperation operation) { - operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1); + operation.setBatchNumber(mCurrentBatchNumber); mOperations.add(operation); } @@ -184,7 +183,7 @@ private void addUnbatchedOperation(UIThreadOperation operation) { } private void addPreOperation(UIThreadOperation operation) { - operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1); + operation.setBatchNumber(mCurrentBatchNumber); mPreOperations.add(operation); } @@ -427,14 +426,12 @@ private void decrementInFlightAnimationsForViewTag(final int viewTag) { @Override public void startOperationBatch() { mBatchingControlledByJS = true; - mIsInBatch = true; mCurrentBatchNumber++; } @Override public void finishOperationBatch() { mBatchingControlledByJS = true; - mIsInBatch = false; mCurrentBatchNumber++; } From 7131791ab16c2a49a9695d89047a4309f107dffd Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Tue, 27 Apr 2021 09:37:13 -0700 Subject: [PATCH 077/259] Differ: dedupe more code in main differ loop Summary: I am deduping a duplicated block, and adding comments to explain when we create INSERT/REMOVE mutations immediately and when we defer creation. Theoretically the ordering of mutations will be more consistent now, which ~shouldn't matter, but is probably a decent property to have. In particular, before, in some cases both of these orderings were possible in various scenarios: ``` INSERT X -> Y INSERT Y -> Z ``` and ``` INSERT Y -> Z INSERT X -> Y ``` Both of those are fine/correct/won't cause issues on any known platforms. But now, at least for the two cases touched here, only this ordering will be produced: ``` INSERT Y -> Z INSERT X -> Y ``` meaning we build the tree from the bottom-up (the "bottom" being the root) and do out-of-order inserts less frequently. Again, the biggest part of this diff should be readability/refactoring/de-duplicating logic, but more consistent orderings is a nice-to-have. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28017926 fbshipit-source-id: 5941588d0c8bba8b0df7d0084d5d198f4b7c2427 --- .../renderer/mounting/Differentiator.cpp | 167 ++++++++++-------- .../react/renderer/mounting/ShadowView.h | 2 +- 2 files changed, 96 insertions(+), 73 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index f66dfa0a8969e3..5445d70c43319f 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -365,6 +365,15 @@ static void updateMatchedPairSubtrees( ShadowViewNodePair const &oldPair, ShadowViewNodePair const &newPair); +static void updateMatchedPair( + BREADCRUMB_TYPE breadcrumb, + OrderedMutationInstructionContainer &mutationContainer, + bool oldNodeFoundInOrder, + bool newNodeFoundInOrder, + ShadowView const &parentShadowView, + ShadowViewNodePair const &oldPair, + ShadowViewNodePair const &newPair); + static void calculateShadowViewMutationsFlattener( BREADCRUMB_TYPE breadcrumb, ViewNodePairScope &scope, @@ -505,6 +514,71 @@ static void updateMatchedPairSubtrees( } } +/** + * Handle updates to a matched node pair, but NOT to their subtrees. + * + * Here we have (and need) knowledge of whether a node was found during + * in-order traversal, or out-of-order via a map lookup. Nodes are only REMOVEd + * or INSERTed when they are encountered via in-order-traversal, to ensure + * correct ordering of INSERT and REMOVE mutations. + */ +static void updateMatchedPair( + BREADCRUMB_TYPE breadcrumb, + OrderedMutationInstructionContainer &mutationContainer, + bool oldNodeFoundInOrder, + bool newNodeFoundInOrder, + ShadowView const &parentShadowView, + ShadowViewNodePair const &oldPair, + ShadowViewNodePair const &newPair) { + oldPair.otherTreePair = &newPair; + newPair.otherTreePair = &oldPair; + + // Check concrete-ness of views + // Create/Delete and Insert/Remove if necessary + if (oldPair.isConcreteView != newPair.isConcreteView) { + if (newPair.isConcreteView) { + if (newNodeFoundInOrder) { + mutationContainer.insertMutations.push_back( + ShadowViewMutation::InsertMutation( + parentShadowView, + newPair.shadowView, + static_cast(newPair.mountIndex))); + } + mutationContainer.createMutations.push_back( + ShadowViewMutation::CreateMutation(newPair.shadowView)); + } else { + if (oldNodeFoundInOrder) { + mutationContainer.removeMutations.push_back( + ShadowViewMutation::RemoveMutation( + parentShadowView, + oldPair.shadowView, + static_cast(oldPair.mountIndex))); + } + mutationContainer.deleteMutations.push_back( + ShadowViewMutation::DeleteMutation(oldPair.shadowView)); + } + } else if (oldPair.isConcreteView && newPair.isConcreteView) { + // If we found the old node by traversing, but not the new node, + // it means that there's some reordering requiring a REMOVE mutation. + if (oldNodeFoundInOrder && !newNodeFoundInOrder) { + mutationContainer.removeMutations.push_back( + ShadowViewMutation::RemoveMutation( + parentShadowView, + newPair.shadowView, + static_cast(oldPair.mountIndex))); + } + + // Even if node's children are flattened, it might still be a + // concrete view. The case where they're different is handled + // above. + if (oldPair.shadowView != newPair.shadowView) { + mutationContainer.updateMutations.push_back( + ShadowViewMutation::UpdateMutation( + oldPair.shadowView, newPair.shadowView)); + } + } +} + /** * Here we flatten or unflatten a subtree, given an unflattened node in either * the old or new tree, and a list of flattened nodes in the other tree. @@ -1255,37 +1329,16 @@ static void calculateShadowViewMutationsV2( << " with parent: [" << parentShadowView.tag << "]"; }); - // Check concrete-ness of views - // Create/Delete and Insert/Remove if necessary - if (oldChildPair.isConcreteView != newChildPair.isConcreteView) { - if (newChildPair.isConcreteView) { - mutationContainer.insertMutations.push_back( - ShadowViewMutation::InsertMutation( - parentShadowView, - newChildPair.shadowView, - static_cast(newChildPair.mountIndex))); - mutationContainer.createMutations.push_back( - ShadowViewMutation::CreateMutation(newChildPair.shadowView)); - } else { - mutationContainer.removeMutations.push_back( - ShadowViewMutation::RemoveMutation( - parentShadowView, - oldChildPair.shadowView, - static_cast(oldChildPair.mountIndex))); - mutationContainer.deleteMutations.push_back( - ShadowViewMutation::DeleteMutation(oldChildPair.shadowView)); - } - } else if ( - oldChildPair.isConcreteView && newChildPair.isConcreteView) { - // Even if node's children are flattened, it might still be a - // concrete view. The case where they're different is handled - // above. - if (oldChildPair.shadowView != newChildPair.shadowView) { - mutationContainer.updateMutations.push_back( - ShadowViewMutation::UpdateMutation( - oldChildPair.shadowView, newChildPair.shadowView)); - } - } + updateMatchedPair( + DIFF_BREADCRUMB( + "Update Matched Pairs (1): " + + std::to_string(oldChildPair.shadowView.tag)), + mutationContainer, + true, + true, + parentShadowView, + oldChildPair, + newChildPair); updateMatchedPairSubtrees( DIFF_BREADCRUMB( @@ -1321,6 +1374,17 @@ static void calculateShadowViewMutationsV2( if (insertedIt != newInsertedPairs.end()) { auto const &newChildPair = *insertedIt->second; + updateMatchedPair( + DIFF_BREADCRUMB( + "Update Matched Pairs (2): " + + std::to_string(oldChildPair.shadowView.tag)), + mutationContainer, + true, + false, + parentShadowView, + oldChildPair, + newChildPair); + updateMatchedPairSubtrees( DIFF_BREADCRUMB( "Update Matched Pair Subtrees (2): " + @@ -1334,47 +1398,6 @@ static void calculateShadowViewMutationsV2( oldChildPair, newChildPair); - // Check concrete-ness of views - // Create/Delete and Insert/Remove if necessary - // TODO: document: Insert should already be handled by outermost - // loop, but not Remove - if (oldChildPair.isConcreteView != newChildPair.isConcreteView) { - if (newChildPair.isConcreteView) { - mutationContainer.createMutations.push_back( - ShadowViewMutation::CreateMutation(newChildPair.shadowView)); - } else { - mutationContainer.removeMutations.push_back( - ShadowViewMutation::RemoveMutation( - parentShadowView, - oldChildPair.shadowView, - static_cast(oldChildPair.mountIndex))); - mutationContainer.deleteMutations.push_back( - ShadowViewMutation::DeleteMutation(oldChildPair.shadowView)); - } - } - - // old and new child pairs are both either flattened or unflattened - // at this point. If they're not views, we don't need to update - // subtrees. - if (oldChildPair.isConcreteView && newChildPair.isConcreteView) { - // TODO: do we always want to remove here? There are cases where - // we might be able to remove this to prevent unnecessary - // removes/inserts in cases of (un)flattening + reorders? - // If removing here, we must remove the newest version of the View - // - which will always be in the "new" tree. - mutationContainer.removeMutations.push_back( - ShadowViewMutation::RemoveMutation( - parentShadowView, - newChildPair.shadowView, - static_cast(oldChildPair.mountIndex))); - - if (oldChildPair.shadowView != newChildPair.shadowView) { - mutationContainer.updateMutations.push_back( - ShadowViewMutation::UpdateMutation( - oldChildPair.shadowView, newChildPair.shadowView)); - } - } - newInsertedPairs.erase(insertedIt); oldIndex++; continue; diff --git a/ReactCommon/react/renderer/mounting/ShadowView.h b/ReactCommon/react/renderer/mounting/ShadowView.h index cd1e1fa040c88e..3631551ae1903f 100644 --- a/ReactCommon/react/renderer/mounting/ShadowView.h +++ b/ReactCommon/react/renderer/mounting/ShadowView.h @@ -83,7 +83,7 @@ struct ShadowViewNodePair final { * rely on this more heavily to simplify the diffing algorithm * overall? */ - ShadowViewNodePair const *otherTreePair{nullptr}; + mutable ShadowViewNodePair const *otherTreePair{nullptr}; /* * The stored pointer to `ShadowNode` represents an identity of the pair. From 121a84496c8475a326cf758de2f2f22d854dd769 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Tue, 27 Apr 2021 09:37:13 -0700 Subject: [PATCH 078/259] Differ: remove incorrect comment Summary: This is no longer true because of the "scope" mechanism. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28018995 fbshipit-source-id: 91470234bb15f7feeb92b41613b0bbdbe42ccb27 --- ReactCommon/react/renderer/mounting/Differentiator.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index 5445d70c43319f..2fdf9410b8ca20 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -937,8 +937,6 @@ static void calculateShadowViewMutationsFlattener( else { // Construct unvisited nodes map auto unvisitedOldChildPairs = TinyMap{}; - // Memory note: these oldFlattenedNodes all disappear at the end - // of this "else" block, including any annotations we put on them. auto oldFlattenedNodes = sliceChildShadowNodeViewPairsFromViewNodePair( oldTreeNodePair, scope, true); From 1e68a5f573a06706d7cf1756739c06ed626d8e0b Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Tue, 27 Apr 2021 09:37:13 -0700 Subject: [PATCH 079/259] Differ: simplify nested flattening/unflattening code Summary: There's a case here where we do a loop, with a map loopup, and nested map lookup inside of that. It's not particularly efficient and was done because we have multiple distinct pointers to distinct ShadowViews that are backed by the same ShadowNode. Now due to previous, recent refactoring, we can simplify this case a lot. The code WAS correct before, just confusing and not particularly efficient. Tests can prove that this is still correct. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28018996 fbshipit-source-id: a7c8148802650c88888960c9c099954e0f8bc357 --- .../renderer/mounting/Differentiator.cpp | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index 2fdf9410b8ca20..335e2187840dbd 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -978,36 +978,29 @@ static void calculateShadowViewMutationsFlattener( // If old nodes were not visited, we know that we can delete them // now. They will be removed from the hierarchy by the outermost // loop of this function. - for (auto oldFlattenedNode : oldFlattenedNodes) { - auto unvisitedOldChildPairIt = - unvisitedOldChildPairs.find(oldFlattenedNode->shadowView.tag); - if (unvisitedOldChildPairIt != unvisitedOldChildPairs.end()) { - // Node unvisited - mark the entire subtree for deletion - if (oldFlattenedNode->isConcreteView) { - Tag tag = oldFlattenedNode->shadowView.tag; - auto oldRemainingChildInListIt = std::find_if( - treeChildren.begin(), - treeChildren.end(), - [&tag](ShadowViewNodePair *nodePair) { - return nodePair->shadowView.tag == tag; - }); - react_native_assert( - oldRemainingChildInListIt != treeChildren.end()); - if (oldRemainingChildInListIt != treeChildren.end()) { - auto deleteCreateIt = deletionCreationCandidatePairs.find( - oldFlattenedNode->shadowView.tag); - if (deleteCreateIt == - deletionCreationCandidatePairs.end()) { - deletionCreationCandidatePairs.insert( - {tag, *oldRemainingChildInListIt}); - } - } + for (auto unvisitedOldChildPairIt = unvisitedOldChildPairs.begin(); + unvisitedOldChildPairIt != unvisitedOldChildPairs.end(); + unvisitedOldChildPairIt++) { + if (unvisitedOldChildPairIt->first == 0) { + continue; + } + auto &oldFlattenedNode = *unvisitedOldChildPairIt->second; + + // Node unvisited - mark the entire subtree for deletion + if (oldFlattenedNode.isConcreteView && + !oldFlattenedNode.inOtherTree()) { + Tag tag = oldFlattenedNode.shadowView.tag; + auto deleteCreateIt = deletionCreationCandidatePairs.find( + oldFlattenedNode.shadowView.tag); + if (deleteCreateIt == deletionCreationCandidatePairs.end()) { + deletionCreationCandidatePairs.insert( + {tag, &oldFlattenedNode}); } } else { // Node was visited - make sure to remove it from // "newRemainingPairs" map auto newRemainingIt = - unvisitedOtherNodes.find(oldFlattenedNode->shadowView.tag); + unvisitedOtherNodes.find(oldFlattenedNode.shadowView.tag); if (newRemainingIt != unvisitedOtherNodes.end()) { unvisitedOtherNodes.erase(newRemainingIt); } From 119e8f4cd8872459d497f9c82fe8a5ad3f95b37d Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Tue, 27 Apr 2021 09:37:13 -0700 Subject: [PATCH 080/259] Differ: in flattening/unflattening nested case, reduce code duplication Summary: Refactor a code block that is duplicated 2x. Logic stays the same besides renaming, and a ternary operator to decide between getting the children from "old" or "new" tree. Tests can help us refactor knowing that the logic is still correct. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28018994 fbshipit-source-id: d34a033444e67091e44ff6a747fd39846c165238 --- .../renderer/mounting/Differentiator.cpp | 75 +++++++------------ 1 file changed, 29 insertions(+), 46 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index 335e2187840dbd..36810596a6f935 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -887,30 +887,32 @@ static void calculateShadowViewMutationsFlattener( subVisitedNewMap, subVisitedOldMap); } else { - // Unflatten parent, flatten child - if (childReparentMode == ReparentMode::Flatten) { - // Construct unvisited nodes map - auto unvisitedNewChildPairs = TinyMap{}; - // Memory note: these oldFlattenedNodes all disappear at the end - // of this "else" block, including any annotations we put on them. - auto newFlattenedNodes = - sliceChildShadowNodeViewPairsFromViewNodePair( - newTreeNodePair, scope, true); - for (size_t i = 0; i < newFlattenedNodes.size(); i++) { - auto &newChild = *newFlattenedNodes[i]; - - auto unvisitedOtherNodesIt = - unvisitedOtherNodes.find(newChild.shadowView.tag); - if (unvisitedOtherNodesIt != unvisitedOtherNodes.end()) { - auto unvisitedItPair = *unvisitedOtherNodesIt->second; - unvisitedNewChildPairs.insert( - {unvisitedItPair.shadowView.tag, &unvisitedItPair}); - } else { - unvisitedNewChildPairs.insert( - {newChild.shadowView.tag, &newChild}); - } + // Get flattened nodes from either new or old tree + auto flattenedNodes = sliceChildShadowNodeViewPairsFromViewNodePair( + (childReparentMode == ReparentMode::Flatten ? newTreeNodePair + : oldTreeNodePair), + scope, + true); + // Construct unvisited nodes map + auto unvisitedRecursiveChildPairs = + TinyMap{}; + for (size_t i = 0; i < flattenedNodes.size(); i++) { + auto &newChild = *flattenedNodes[i]; + + auto unvisitedOtherNodesIt = + unvisitedOtherNodes.find(newChild.shadowView.tag); + if (unvisitedOtherNodesIt != unvisitedOtherNodes.end()) { + auto unvisitedItPair = *unvisitedOtherNodesIt->second; + unvisitedRecursiveChildPairs.insert( + {unvisitedItPair.shadowView.tag, &unvisitedItPair}); + } else { + unvisitedRecursiveChildPairs.insert( + {newChild.shadowView.tag, &newChild}); } + } + // Unflatten parent, flatten child + if (childReparentMode == ReparentMode::Flatten) { // Flatten old tree into new list // At the end of this loop we still want to know which of these // children are visited, so we reuse the `newRemainingPairs` map. @@ -928,33 +930,13 @@ static void calculateShadowViewMutationsFlattener( (reparentMode == ReparentMode::Flatten ? parentShadowView : newTreeNodePair.shadowView), - unvisitedNewChildPairs, + unvisitedRecursiveChildPairs, oldTreeNodePair, subVisitedNewMap, subVisitedOldMap); } // Flatten parent, unflatten child else { - // Construct unvisited nodes map - auto unvisitedOldChildPairs = TinyMap{}; - auto oldFlattenedNodes = - sliceChildShadowNodeViewPairsFromViewNodePair( - oldTreeNodePair, scope, true); - for (size_t i = 0; i < oldFlattenedNodes.size(); i++) { - auto &oldChild = *oldFlattenedNodes[i]; - - auto unvisitedOtherNodesIt = - unvisitedOtherNodes.find(oldChild.shadowView.tag); - if (unvisitedOtherNodesIt != unvisitedOtherNodes.end()) { - auto &unvisitedItPair = *unvisitedOtherNodesIt->second; - unvisitedOldChildPairs.insert( - {unvisitedItPair.shadowView.tag, &unvisitedItPair}); - } else { - unvisitedOldChildPairs.insert( - {oldChild.shadowView.tag, &oldChild}); - } - } - // Unflatten old list into new tree calculateShadowViewMutationsFlattener( DIFF_BREADCRUMB( @@ -970,7 +952,7 @@ static void calculateShadowViewMutationsFlattener( (reparentMode == ReparentMode::Flatten ? parentShadowView : newTreeNodePair.shadowView), - unvisitedOldChildPairs, + unvisitedRecursiveChildPairs, newTreeNodePair, subVisitedNewMap, subVisitedOldMap); @@ -978,8 +960,9 @@ static void calculateShadowViewMutationsFlattener( // If old nodes were not visited, we know that we can delete them // now. They will be removed from the hierarchy by the outermost // loop of this function. - for (auto unvisitedOldChildPairIt = unvisitedOldChildPairs.begin(); - unvisitedOldChildPairIt != unvisitedOldChildPairs.end(); + for (auto unvisitedOldChildPairIt = + unvisitedRecursiveChildPairs.begin(); + unvisitedOldChildPairIt != unvisitedRecursiveChildPairs.end(); unvisitedOldChildPairIt++) { if (unvisitedOldChildPairIt->first == 0) { continue; From d6cd2e6559ff8698833dc277810e2e7e80af760a Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 27 Apr 2021 09:39:07 -0700 Subject: [PATCH 081/259] Upgrade to Jest 26.6.3 Summary: Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D27996469 fbshipit-source-id: 41f11be8477f5c1314e87f365d09a0c03f272284 --- repo-config/package.json | 2 +- yarn.lock | 692 ++++++++++++++++++++------------------- 2 files changed, 348 insertions(+), 346 deletions(-) diff --git a/repo-config/package.json b/repo-config/package.json index 39de2a2d542e8b..52fd00245df3d9 100644 --- a/repo-config/package.json +++ b/repo-config/package.json @@ -34,7 +34,7 @@ "eslint-plugin-react-native": "3.10.0", "eslint-plugin-relay": "1.8.1", "flow-bin": "^0.149.0", - "jest": "^26.5.2", + "jest": "^26.6.3", "jest-junit": "^10.0.0", "jscodeshift": "^0.11.0", "mkdirp": "^0.5.1", diff --git a/yarn.lock b/yarn.lock index 57afa9f5ce04c5..1eb2e64e2ce58d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -174,6 +174,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== +"@babel/helper-plugin-utils@^7.12.13": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" + integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== + "@babel/helper-regex@^7.10.4": version "7.10.5" resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.10.5.tgz#32dfbb79899073c415557053a19bd055aae50ae0" @@ -419,6 +424,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-top-level-await@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" + integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/plugin-syntax-typescript@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz#460ba9d77077653803c3dd2e673f76d66b4029e5" @@ -810,46 +822,46 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@jest/console@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.5.2.tgz#94fc4865b1abed7c352b5e21e6c57be4b95604a6" - integrity sha512-lJELzKINpF1v74DXHbCRIkQ/+nUV1M+ntj+X1J8LxCgpmJZjfLmhFejiMSbjjD66fayxl5Z06tbs3HMyuik6rw== +"@jest/console@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.2.tgz#4e04bc464014358b03ab4937805ee36a0aeb98f2" + integrity sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^26.5.2" - jest-util "^26.5.2" + jest-message-util "^26.6.2" + jest-util "^26.6.2" slash "^3.0.0" -"@jest/core@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.5.2.tgz#e39f14676f4ba4632ecabfdc374071ab22131f22" - integrity sha512-LLTo1LQMg7eJjG/+P1NYqFof2B25EV1EqzD5FonklihG4UJKiK2JBIvWonunws6W7e+DhNLoFD+g05tCY03eyA== +"@jest/core@^26.6.3": + version "26.6.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.6.3.tgz#7639fcb3833d748a4656ada54bde193051e45fad" + integrity sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw== dependencies: - "@jest/console" "^26.5.2" - "@jest/reporters" "^26.5.2" - "@jest/test-result" "^26.5.2" - "@jest/transform" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/console" "^26.6.2" + "@jest/reporters" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^26.5.2" - jest-config "^26.5.2" - jest-haste-map "^26.5.2" - jest-message-util "^26.5.2" + jest-changed-files "^26.6.2" + jest-config "^26.6.3" + jest-haste-map "^26.6.2" + jest-message-util "^26.6.2" jest-regex-util "^26.0.0" - jest-resolve "^26.5.2" - jest-resolve-dependencies "^26.5.2" - jest-runner "^26.5.2" - jest-runtime "^26.5.2" - jest-snapshot "^26.5.2" - jest-util "^26.5.2" - jest-validate "^26.5.2" - jest-watcher "^26.5.2" + jest-resolve "^26.6.2" + jest-resolve-dependencies "^26.6.3" + jest-runner "^26.6.3" + jest-runtime "^26.6.3" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" + jest-watcher "^26.6.2" micromatch "^4.0.2" p-each-series "^2.1.0" rimraf "^3.0.0" @@ -857,51 +869,53 @@ strip-ansi "^6.0.0" "@jest/create-cache-key-function@^26.5.0": - version "26.5.0" - resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-26.5.0.tgz#1d07947adc51ea17766d9f0ccf5a8d6ea94c47dc" - integrity sha512-DJ+pEBUIqarrbv1W/C39f9YH0rJ4wsXZ/VC6JafJPlHW2HOucKceeaqTOQj9MEDQZjySxMLkOq5mfXZXNZcmWw== + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-26.6.2.tgz#04cf439207a4fd12418d8aee551cddc86f9ac5f5" + integrity sha512-LgEuqU1f/7WEIPYqwLPIvvHuc1sB6gMVbT6zWhin3txYUNYK/kGQrC1F2WR4gR34YlI9bBtViTm5z98RqVZAaw== + dependencies: + "@jest/types" "^26.6.2" -"@jest/environment@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.5.2.tgz#eba3cfc698f6e03739628f699c28e8a07f5e65fe" - integrity sha512-YjhCD/Zhkz0/1vdlS/QN6QmuUdDkpgBdK4SdiVg4Y19e29g4VQYN5Xg8+YuHjdoWGY7wJHMxc79uDTeTOy9Ngw== +"@jest/environment@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.6.2.tgz#ba364cc72e221e79cc8f0a99555bf5d7577cf92c" + integrity sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA== dependencies: - "@jest/fake-timers" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" "@types/node" "*" - jest-mock "^26.5.2" + jest-mock "^26.6.2" -"@jest/fake-timers@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.5.2.tgz#1291ac81680ceb0dc7daa1f92c059307eea6400a" - integrity sha512-09Hn5Oraqt36V1akxQeWMVL0fR9c6PnEhpgLaYvREXZJAh2H2Y+QLCsl0g7uMoJeoWJAuz4tozk1prbR1Fc1sw== +"@jest/fake-timers@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.6.2.tgz#459c329bcf70cee4af4d7e3f3e67848123535aad" + integrity sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" "@sinonjs/fake-timers" "^6.0.1" "@types/node" "*" - jest-message-util "^26.5.2" - jest-mock "^26.5.2" - jest-util "^26.5.2" + jest-message-util "^26.6.2" + jest-mock "^26.6.2" + jest-util "^26.6.2" -"@jest/globals@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.5.2.tgz#c333f82c29e19ecb609a75d1a532915a5c956c59" - integrity sha512-9PmnFsAUJxpPt1s/stq02acS1YHliVBDNfAWMe1bwdRr1iTCfhbNt3ERQXrO/ZfZSweftoA26Q/2yhSVSWQ3sw== +"@jest/globals@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.6.2.tgz#5b613b78a1aa2655ae908eba638cc96a20df720a" + integrity sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA== dependencies: - "@jest/environment" "^26.5.2" - "@jest/types" "^26.5.2" - expect "^26.5.2" + "@jest/environment" "^26.6.2" + "@jest/types" "^26.6.2" + expect "^26.6.2" -"@jest/reporters@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.5.2.tgz#0f1c900c6af712b46853d9d486c9c0382e4050f6" - integrity sha512-zvq6Wvy6MmJq/0QY0YfOPb49CXKSf42wkJbrBPkeypVa8I+XDxijvFuywo6TJBX/ILPrdrlE/FW9vJZh6Rf9vA== +"@jest/reporters@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.6.2.tgz#1f518b99637a5f18307bd3ecf9275f6882a667f6" + integrity sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^26.5.2" - "@jest/test-result" "^26.5.2" - "@jest/transform" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/console" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -912,63 +926,63 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^26.5.2" - jest-resolve "^26.5.2" - jest-util "^26.5.2" - jest-worker "^26.5.0" + jest-haste-map "^26.6.2" + jest-resolve "^26.6.2" + jest-util "^26.6.2" + jest-worker "^26.6.2" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^5.0.1" + v8-to-istanbul "^7.0.0" optionalDependencies: node-notifier "^8.0.0" -"@jest/source-map@^26.5.0": - version "26.5.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.5.0.tgz#98792457c85bdd902365cd2847b58fff05d96367" - integrity sha512-jWAw9ZwYHJMe9eZq/WrsHlwF8E3hM9gynlcDpOyCb9bR8wEd9ZNBZCi7/jZyzHxC7t3thZ10gO2IDhu0bPKS5g== +"@jest/source-map@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.6.2.tgz#29af5e1e2e324cafccc936f218309f54ab69d535" + integrity sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA== dependencies: callsites "^3.0.0" graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.5.2.tgz#cc1a44cfd4db2ecee3fb0bc4e9fe087aa54b5230" - integrity sha512-E/Zp6LURJEGSCWpoMGmCFuuEI1OWuI3hmZwmULV0GsgJBh7u0rwqioxhRU95euUuviqBDN8ruX/vP/4bwYolXw== +"@jest/test-result@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.2.tgz#55da58b62df134576cc95476efa5f7949e3f5f18" + integrity sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ== dependencies: - "@jest/console" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/console" "^26.6.2" + "@jest/types" "^26.6.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.5.2.tgz#c4559c7e134b27b020317303ee5399bf62917a4b" - integrity sha512-XmGEh7hh07H2B8mHLFCIgr7gA5Y6Hw1ZATIsbz2fOhpnQ5AnQtZk0gmP0Q5/+mVB2xygO64tVFQxOajzoptkNA== +"@jest/test-sequencer@^26.6.3": + version "26.6.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz#98e8a45100863886d074205e8ffdc5a7eb582b17" + integrity sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw== dependencies: - "@jest/test-result" "^26.5.2" + "@jest/test-result" "^26.6.2" graceful-fs "^4.2.4" - jest-haste-map "^26.5.2" - jest-runner "^26.5.2" - jest-runtime "^26.5.2" + jest-haste-map "^26.6.2" + jest-runner "^26.6.3" + jest-runtime "^26.6.3" -"@jest/transform@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.5.2.tgz#6a0033a1d24316a1c75184d010d864f2c681bef5" - integrity sha512-AUNjvexh+APhhmS8S+KboPz+D3pCxPvEAGduffaAJYxIFxGi/ytZQkrqcKDUU0ERBAo5R7087fyOYr2oms1seg== +"@jest/transform@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.6.2.tgz#5ac57c5fa1ad17b2aae83e73e45813894dcf2e4b" + integrity sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^26.5.2" + jest-haste-map "^26.6.2" jest-regex-util "^26.0.0" - jest-util "^26.5.2" + jest-util "^26.6.2" micromatch "^4.0.2" pirates "^4.0.1" slash "^3.0.0" @@ -984,18 +998,7 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" -"@jest/types@^26.5.2": - version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.5.2.tgz#44c24f30c8ee6c7f492ead9ec3f3c62a5289756d" - integrity sha512-QDs5d0gYiyetI8q+2xWdkixVQMklReZr4ltw7GFDtb4fuJIBCE6mzj2LnitGqCuAlLap6wPyb8fpoHgwZz5fdg== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^15.0.0" - chalk "^4.0.0" - -"@jest/types@^26.6.2": +"@jest/types@^26.5.2", "@jest/types@^26.6.2": version "26.6.2" resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== @@ -1606,16 +1609,16 @@ babel-eslint@^10.1.0: eslint-visitor-keys "^1.0.0" resolve "^1.12.0" -babel-jest@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.5.2.tgz#164f367a35946c6cf54eaccde8762dec50422250" - integrity sha512-U3KvymF3SczA3vOL/cgiUFOznfMET+XDIXiWnoJV45siAp2pLMG8i2+/MGZlAC3f/F6Q40LR4M4qDrWZ9wkK8A== +babel-jest@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" + integrity sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA== dependencies: - "@jest/transform" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" "@types/babel__core" "^7.1.7" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^26.5.0" + babel-preset-jest "^26.6.2" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -1638,10 +1641,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^26.5.0: - version "26.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.5.0.tgz#3916b3a28129c29528de91e5784a44680db46385" - integrity sha512-ck17uZFD3CDfuwCLATWZxkkuGGFhMij8quP8CNhwj8ek1mqFgbFzRJ30xwC04LLscj/aKsVFfRST+b5PT7rSuw== +babel-plugin-jest-hoist@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz#8185bd030348d254c6d7dd974355e6a28b21e62d" + integrity sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -1653,10 +1656,10 @@ babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz#aa213c1435e2bffeb6fca842287ef534ad05d5cf" integrity sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ== -babel-preset-current-node-syntax@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz#826f1f8e7245ad534714ba001f84f7e906c3b615" - integrity sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w== +babel-preset-current-node-syntax@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" + integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" @@ -1669,6 +1672,7 @@ babel-preset-current-node-syntax@^0.1.3: "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-top-level-await" "^7.8.3" babel-preset-fbjs@^3.3.0: version "3.3.0" @@ -1703,13 +1707,13 @@ babel-preset-fbjs@^3.3.0: "@babel/plugin-transform-template-literals" "^7.0.0" babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" -babel-preset-jest@^26.5.0: - version "26.5.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.5.0.tgz#f1b166045cd21437d1188d29f7fba470d5bdb0e7" - integrity sha512-F2vTluljhqkiGSJGBg/jOruA8vIIIL11YrxRcO7nviNTMbbofPSHwnm8mgP7d/wS7wRSexRoI6X1A6T74d4LQA== +babel-preset-jest@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz#747872b1171df032252426586881d62d31798fee" + integrity sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ== dependencies: - babel-plugin-jest-hoist "^26.5.0" - babel-preset-current-node-syntax "^0.1.3" + babel-plugin-jest-hoist "^26.6.2" + babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: version "1.0.0" @@ -1946,6 +1950,11 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +cjs-module-lexer@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" + integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== + clang-format@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/clang-format/-/clang-format-1.2.4.tgz#4bb4b0a98180428deb093cf20982e9fc1af20b6c" @@ -2381,10 +2390,10 @@ detox@16.7.2: yargs "^13.0.0" yargs-parser "^13.0.0" -diff-sequences@^26.5.0: - version "26.5.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.5.0.tgz#ef766cf09d43ed40406611f11c6d8d9dd8b2fefd" - integrity sha512-ZXx86srb/iYy6jG71k++wBN9P9J05UNQ5hQHQd9MtMPvcqXPx/vKU69jfHV637D00Q2gSgPk2D+jSx3l1lDW/Q== +diff-sequences@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" + integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== doctrine@^2.1.0: version "2.1.0" @@ -2863,16 +2872,16 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-26.5.2.tgz#3e0631c4a657a83dbec769ad246a2998953a55a6" - integrity sha512-ccTGrXZd8DZCcvCz4htGXTkd/LOoy6OEtiDS38x3/VVf6E4AQL0QoeksBiw7BtGR5xDNiRYPB8GN6pfbuTOi7w== +expect@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" + integrity sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" ansi-styles "^4.0.0" jest-get-type "^26.3.0" - jest-matcher-utils "^26.5.2" - jest-message-util "^26.5.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" jest-regex-util "^26.0.0" extend-shallow@^2.0.1: @@ -3771,67 +3780,67 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.5.2.tgz#330232c6a5c09a7f040a5870e8f0a9c6abcdbed5" - integrity sha512-qSmssmiIdvM5BWVtyK/nqVpN3spR5YyvkvPqz1x3BR1bwIxsWmU/MGwLoCrPNLbkG2ASAKfvmJpOduEApBPh2w== +jest-changed-files@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" + integrity sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" execa "^4.0.0" throat "^5.0.0" -jest-cli@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.5.2.tgz#0df114399b4036a3f046f0a9f25c50372c76b3a2" - integrity sha512-usm48COuUvRp8YEG5OWOaxbSM0my7eHn3QeBWxiGUuFhvkGVBvl1fic4UjC02EAEQtDv8KrNQUXdQTV6ZZBsoA== +jest-cli@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.6.3.tgz#43117cfef24bc4cd691a174a8796a532e135e92a" + integrity sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg== dependencies: - "@jest/core" "^26.5.2" - "@jest/test-result" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/core" "^26.6.3" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^26.5.2" - jest-util "^26.5.2" - jest-validate "^26.5.2" + jest-config "^26.6.3" + jest-util "^26.6.2" + jest-validate "^26.6.2" prompts "^2.0.1" yargs "^15.4.1" -jest-config@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.5.2.tgz#6e828e25f10124433dd008fbd83348636de0972a" - integrity sha512-dqJOnSegNdE5yDiuGHsjTM5gec7Z4AcAMHiW+YscbOYJAlb3LEtDSobXCq0or9EmGQI5SFmKy4T7P1FxetJOfg== +jest-config@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.6.3.tgz#64f41444eef9eb03dc51d5c53b75c8c71f645349" + integrity sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^26.5.2" - "@jest/types" "^26.5.2" - babel-jest "^26.5.2" + "@jest/test-sequencer" "^26.6.3" + "@jest/types" "^26.6.2" + babel-jest "^26.6.3" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-environment-jsdom "^26.5.2" - jest-environment-node "^26.5.2" + jest-environment-jsdom "^26.6.2" + jest-environment-node "^26.6.2" jest-get-type "^26.3.0" - jest-jasmine2 "^26.5.2" + jest-jasmine2 "^26.6.3" jest-regex-util "^26.0.0" - jest-resolve "^26.5.2" - jest-util "^26.5.2" - jest-validate "^26.5.2" + jest-resolve "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" micromatch "^4.0.2" - pretty-format "^26.5.2" + pretty-format "^26.6.2" -jest-diff@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.5.2.tgz#8e26cb32dc598e8b8a1b9deff55316f8313c8053" - integrity sha512-HCSWDUGwsov5oTlGzrRM+UPJI/Dpqi9jzeV0fdRNi3Ch5bnoXhnyJMmVg2juv9081zLIy3HGPI5mcuGgXM2xRA== +jest-diff@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" + integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== dependencies: chalk "^4.0.0" - diff-sequences "^26.5.0" + diff-sequences "^26.6.2" jest-get-type "^26.3.0" - pretty-format "^26.5.2" + pretty-format "^26.6.2" jest-docblock@^21.0.0: version "21.2.0" @@ -3845,41 +3854,41 @@ jest-docblock@^26.0.0: dependencies: detect-newline "^3.0.0" -jest-each@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.5.2.tgz#35e68d6906a7f826d3ca5803cfe91d17a5a34c31" - integrity sha512-w7D9FNe0m2D3yZ0Drj9CLkyF/mGhmBSULMQTypzAKR746xXnjUrK8GUJdlLTWUF6dd0ks3MtvGP7/xNFr9Aphg== +jest-each@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.6.2.tgz#02526438a77a67401c8a6382dfe5999952c167cb" + integrity sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" chalk "^4.0.0" jest-get-type "^26.3.0" - jest-util "^26.5.2" - pretty-format "^26.5.2" + jest-util "^26.6.2" + pretty-format "^26.6.2" -jest-environment-jsdom@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.5.2.tgz#5feab05b828fd3e4b96bee5e0493464ddd2bb4bc" - integrity sha512-fWZPx0bluJaTQ36+PmRpvUtUlUFlGGBNyGX1SN3dLUHHMcQ4WseNEzcGGKOw4U5towXgxI4qDoI3vwR18H0RTw== +jest-environment-jsdom@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz#78d09fe9cf019a357009b9b7e1f101d23bd1da3e" + integrity sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q== dependencies: - "@jest/environment" "^26.5.2" - "@jest/fake-timers" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" "@types/node" "*" - jest-mock "^26.5.2" - jest-util "^26.5.2" + jest-mock "^26.6.2" + jest-util "^26.6.2" jsdom "^16.4.0" -jest-environment-node@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.5.2.tgz#275a0f01b5e47447056f1541a15ed4da14acca03" - integrity sha512-YHjnDsf/GKFCYMGF1V+6HF7jhY1fcLfLNBDjhAOvFGvt6d8vXvNdJGVM7uTZ2VO/TuIyEFhPGaXMX5j3h7fsrA== +jest-environment-node@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.6.2.tgz#824e4c7fb4944646356f11ac75b229b0035f2b0c" + integrity sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag== dependencies: - "@jest/environment" "^26.5.2" - "@jest/fake-timers" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" "@types/node" "*" - jest-mock "^26.5.2" - jest-util "^26.5.2" + jest-mock "^26.6.2" + jest-util "^26.6.2" jest-get-type@^24.9.0: version "24.9.0" @@ -3891,49 +3900,49 @@ jest-get-type@^26.3.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== -jest-haste-map@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.5.2.tgz#a15008abfc502c18aa56e4919ed8c96304ceb23d" - integrity sha512-lJIAVJN3gtO3k4xy+7i2Xjtwh8CfPcH08WYjZpe9xzveDaqGw9fVNCpkYu6M525wKFVkLmyi7ku+DxCAP1lyMA== +jest-haste-map@^26.5.2, jest-haste-map@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" + integrity sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.4" jest-regex-util "^26.0.0" - jest-serializer "^26.5.0" - jest-util "^26.5.2" - jest-worker "^26.5.0" + jest-serializer "^26.6.2" + jest-util "^26.6.2" + jest-worker "^26.6.2" micromatch "^4.0.2" sane "^4.0.3" walker "^1.0.7" optionalDependencies: fsevents "^2.1.2" -jest-jasmine2@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.5.2.tgz#0e33819d31b1f2aab5efd1e02ce502209c0e64a2" - integrity sha512-2J+GYcgLVPTkpmvHEj0/IDTIAuyblGNGlyGe4fLfDT2aktEPBYvoxUwFiOmDDxxzuuEAD2uxcYXr0+1Yw4tjFA== +jest-jasmine2@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" + integrity sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^26.5.2" - "@jest/source-map" "^26.5.0" - "@jest/test-result" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/environment" "^26.6.2" + "@jest/source-map" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^26.5.2" + expect "^26.6.2" is-generator-fn "^2.0.0" - jest-each "^26.5.2" - jest-matcher-utils "^26.5.2" - jest-message-util "^26.5.2" - jest-runtime "^26.5.2" - jest-snapshot "^26.5.2" - jest-util "^26.5.2" - pretty-format "^26.5.2" + jest-each "^26.6.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-runtime "^26.6.3" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + pretty-format "^26.6.2" throat "^5.0.0" jest-junit@^10.0.0: @@ -3947,44 +3956,45 @@ jest-junit@^10.0.0: uuid "^3.3.3" xml "^1.0.1" -jest-leak-detector@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.5.2.tgz#83fcf9a4a6ef157549552cb4f32ca1d6221eea69" - integrity sha512-h7ia3dLzBFItmYERaLPEtEKxy3YlcbcRSjj0XRNJgBEyODuu+3DM2o62kvIFvs3PsaYoIIv+e+nLRI61Dj1CNw== +jest-leak-detector@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af" + integrity sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg== dependencies: jest-get-type "^26.3.0" - pretty-format "^26.5.2" + pretty-format "^26.6.2" -jest-matcher-utils@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.5.2.tgz#6aa2c76ce8b9c33e66f8856ff3a52bab59e6c85a" - integrity sha512-W9GO9KBIC4gIArsNqDUKsLnhivaqf8MSs6ujO/JDcPIQrmY+aasewweXVET8KdrJ6ADQaUne5UzysvF/RR7JYA== +jest-matcher-utils@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" + integrity sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw== dependencies: chalk "^4.0.0" - jest-diff "^26.5.2" + jest-diff "^26.6.2" jest-get-type "^26.3.0" - pretty-format "^26.5.2" + pretty-format "^26.6.2" -jest-message-util@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.5.2.tgz#6c4c4c46dcfbabb47cd1ba2f6351559729bc11bb" - integrity sha512-Ocp9UYZ5Jl15C5PNsoDiGEk14A4NG0zZKknpWdZGoMzJuGAkVt10e97tnEVMYpk7LnQHZOfuK2j/izLBMcuCZw== +jest-message-util@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" + integrity sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.2" + pretty-format "^26.6.2" slash "^3.0.0" stack-utils "^2.0.2" -jest-mock@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.5.2.tgz#c9302e8ef807f2bfc749ee52e65ad11166a1b6a1" - integrity sha512-9SiU4b5PtO51v0MtJwVRqeGEroH66Bnwtq4ARdNP7jNXbpT7+ByeWNAk4NeT/uHfNSVDXEXgQo1XRuwEqS6Rdw== +jest-mock@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.6.2.tgz#d6cb712b041ed47fe0d9b6fc3474bc6543feb302" + integrity sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -3997,123 +4007,124 @@ jest-regex-util@^26.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== -jest-resolve-dependencies@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.5.2.tgz#ee30b7cfea81c81bf5e195a9287d7ec07f893170" - integrity sha512-LLkc8LuRtxqOx0AtX/Npa2C4I23WcIrwUgNtHYXg4owYF/ZDQShcwBAHjYZIFR06+HpQcZ43+kCTMlQ3aDCYTg== +jest-resolve-dependencies@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz#6680859ee5d22ee5dcd961fe4871f59f4c784fb6" + integrity sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" jest-regex-util "^26.0.0" - jest-snapshot "^26.5.2" + jest-snapshot "^26.6.2" -jest-resolve@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.5.2.tgz#0d719144f61944a428657b755a0e5c6af4fc8602" - integrity sha512-XsPxojXGRA0CoDD7Vis59ucz2p3cQFU5C+19tz3tLEAlhYKkK77IL0cjYjikY9wXnOaBeEdm1rOgSJjbZWpcZg== +jest-resolve@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" + integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" chalk "^4.0.0" graceful-fs "^4.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^26.5.2" + jest-util "^26.6.2" read-pkg-up "^7.0.1" - resolve "^1.17.0" + resolve "^1.18.1" slash "^3.0.0" -jest-runner@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.5.2.tgz#4f9e6b0bb7eb4710c209a9e145b8a10894f4c19f" - integrity sha512-GKhYxtSX5+tXZsd2QwfkDqPIj5C2HqOdXLRc2x2qYqWE26OJh17xo58/fN/mLhRkO4y6o60ZVloan7Kk5YA6hg== +jest-runner@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.6.3.tgz#2d1fed3d46e10f233fd1dbd3bfaa3fe8924be159" + integrity sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ== dependencies: - "@jest/console" "^26.5.2" - "@jest/environment" "^26.5.2" - "@jest/test-result" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/console" "^26.6.2" + "@jest/environment" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.7.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-config "^26.5.2" + jest-config "^26.6.3" jest-docblock "^26.0.0" - jest-haste-map "^26.5.2" - jest-leak-detector "^26.5.2" - jest-message-util "^26.5.2" - jest-resolve "^26.5.2" - jest-runtime "^26.5.2" - jest-util "^26.5.2" - jest-worker "^26.5.0" + jest-haste-map "^26.6.2" + jest-leak-detector "^26.6.2" + jest-message-util "^26.6.2" + jest-resolve "^26.6.2" + jest-runtime "^26.6.3" + jest-util "^26.6.2" + jest-worker "^26.6.2" source-map-support "^0.5.6" throat "^5.0.0" -jest-runtime@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.5.2.tgz#b72f5f79eb2fe0c46bfef4cdb9c1e01d1c69ba41" - integrity sha512-zArr4DatX/Sn0wswX/AnAuJgmwgAR5rNtrUz36HR8BfMuysHYNq5sDbYHuLC4ICyRdy5ae/KQ+sczxyS9G6Qvw== - dependencies: - "@jest/console" "^26.5.2" - "@jest/environment" "^26.5.2" - "@jest/fake-timers" "^26.5.2" - "@jest/globals" "^26.5.2" - "@jest/source-map" "^26.5.0" - "@jest/test-result" "^26.5.2" - "@jest/transform" "^26.5.2" - "@jest/types" "^26.5.2" +jest-runtime@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.6.3.tgz#4f64efbcfac398331b74b4b3c82d27d401b8fa2b" + integrity sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw== + dependencies: + "@jest/console" "^26.6.2" + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/globals" "^26.6.2" + "@jest/source-map" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" "@types/yargs" "^15.0.0" chalk "^4.0.0" + cjs-module-lexer "^0.6.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-config "^26.5.2" - jest-haste-map "^26.5.2" - jest-message-util "^26.5.2" - jest-mock "^26.5.2" + jest-config "^26.6.3" + jest-haste-map "^26.6.2" + jest-message-util "^26.6.2" + jest-mock "^26.6.2" jest-regex-util "^26.0.0" - jest-resolve "^26.5.2" - jest-snapshot "^26.5.2" - jest-util "^26.5.2" - jest-validate "^26.5.2" + jest-resolve "^26.6.2" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" slash "^3.0.0" strip-bom "^4.0.0" yargs "^15.4.1" -jest-serializer@^26.5.0: - version "26.5.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.5.0.tgz#f5425cc4c5f6b4b355f854b5f0f23ec6b962bc13" - integrity sha512-+h3Gf5CDRlSLdgTv7y0vPIAoLgX/SI7T4v6hy+TEXMgYbv+ztzbg5PSN6mUXAT/hXYHvZRWm+MaObVfqkhCGxA== +jest-serializer@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" + integrity sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g== dependencies: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.5.2.tgz#0cf7642eaf8e8d2736bd443f619959bf237f9ccf" - integrity sha512-MkXIDvEefzDubI/WaDVSRH4xnkuirP/Pz8LhAIDXcVQTmcEfwxywj5LGwBmhz+kAAIldA7XM4l96vbpzltSjqg== +jest-snapshot@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" + integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.0.0" chalk "^4.0.0" - expect "^26.5.2" + expect "^26.6.2" graceful-fs "^4.2.4" - jest-diff "^26.5.2" + jest-diff "^26.6.2" jest-get-type "^26.3.0" - jest-haste-map "^26.5.2" - jest-matcher-utils "^26.5.2" - jest-message-util "^26.5.2" - jest-resolve "^26.5.2" + jest-haste-map "^26.6.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-resolve "^26.6.2" natural-compare "^1.4.0" - pretty-format "^26.5.2" + pretty-format "^26.6.2" semver "^7.3.2" -jest-util@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.5.2.tgz#8403f75677902cc52a1b2140f568e91f8ed4f4d7" - integrity sha512-WTL675bK+GSSAYgS8z9FWdCT2nccO1yTIplNLPlP0OD8tUk/H5IrWKMMRudIQQ0qp8bb4k+1Qa8CxGKq9qnYdg== +jest-util@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" + integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" @@ -4132,32 +4143,32 @@ jest-validate@^24.9.0: leven "^3.1.0" pretty-format "^24.9.0" -jest-validate@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.5.2.tgz#7ea266700b64234cd1c0cee982490c5a80e9b0f0" - integrity sha512-FmJks0zY36mp6Af/5sqO6CTL9bNMU45yKCJk3hrz8d2aIqQIlN1pr9HPIwZE8blLaewOla134nt5+xAmWsx3SQ== +jest-validate@^26.5.2, jest-validate@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.2.tgz#23d380971587150467342911c3d7b4ac57ab20ec" + integrity sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ== dependencies: - "@jest/types" "^26.5.2" + "@jest/types" "^26.6.2" camelcase "^6.0.0" chalk "^4.0.0" jest-get-type "^26.3.0" leven "^3.1.0" - pretty-format "^26.5.2" + pretty-format "^26.6.2" -jest-watcher@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.5.2.tgz#2957f4461007e0769d74b537379ecf6b7c696916" - integrity sha512-i3m1NtWzF+FXfJ3ljLBB/WQEp4uaNhX7QcQUWMokcifFTUQBDFyUMEwk0JkJ1kopHbx7Een3KX0Q7+9koGM/Pw== +jest-watcher@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.6.2.tgz#a5b683b8f9d68dbcb1d7dae32172d2cca0592975" + integrity sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ== dependencies: - "@jest/test-result" "^26.5.2" - "@jest/types" "^26.5.2" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^26.5.2" + jest-util "^26.6.2" string-length "^4.0.1" -jest-worker@^26.0.0: +jest-worker@^26.0.0, jest-worker@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== @@ -4166,23 +4177,14 @@ jest-worker@^26.0.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^26.5.0: - version "26.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.5.0.tgz#87deee86dbbc5f98d9919e0dadf2c40e3152fa30" - integrity sha512-kTw66Dn4ZX7WpjZ7T/SUDgRhapFRKWmisVAF0Rv4Fu8SLFD7eLbqpLvbxVqYhSgaWa7I+bW7pHnbyfNsH6stug== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^7.0.0" - -jest@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-26.5.2.tgz#c6791642b331fe7abd2f993b0a74aa546f7be0fb" - integrity sha512-4HFabJVwsgDwul/7rhXJ3yFAF/aUkVIXiJWmgFxb+WMdZG39fVvOwYAs8/3r4AlFPc4m/n5sTMtuMbOL3kNtrQ== +jest@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.3.tgz#40e8fdbe48f00dfa1f0ce8121ca74b88ac9148ef" + integrity sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q== dependencies: - "@jest/core" "^26.5.2" + "@jest/core" "^26.6.3" import-local "^3.0.2" - jest-cli "^26.5.2" + jest-cli "^26.6.3" jetifier@^1.6.2: version "1.6.4" @@ -5987,7 +5989,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.3.2, resolve@^1.8.1: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.18.1, resolve@^1.3.2, resolve@^1.8.1: version "1.18.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.18.1.tgz#018fcb2c5b207d2a6424aee361c5a266da8f4130" integrity sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA== @@ -6992,10 +6994,10 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== -v8-to-istanbul@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-5.0.1.tgz#0608f5b49a481458625edb058488607f25498ba5" - integrity sha512-mbDNjuDajqYe3TXFk5qxcQy8L1msXNE37WTlLoqqpBfRsimbNcrlhQlDPntmECEcUvdC+AQ8CyMMf6EUx1r74Q== +v8-to-istanbul@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.1.tgz#04bfd1026ba4577de5472df4f5e89af49de5edda" + integrity sha512-p0BB09E5FRjx0ELN6RgusIPsSPhtgexSRcKETybEs6IGOTXJSZqfwxp7r//55nnu0f1AxltY5VvdVqy2vZf9AA== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" From af6bcfa3ab0ef6e1b0f669dda6cd7d6a5e8975ba Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 27 Apr 2021 15:00:51 -0700 Subject: [PATCH 082/259] RCTImageLoader: Use RCTModuleRegistry to load loaders/decoders Summary: ## Context A React Native application can configure its RCTImageLoader by initializing it with two different sets of objects: - id - id Therefore, RCTImageLoader supports this initializer: ``` - (instancetype)initWithRedirectDelegate:(id)redirectDelegate loadersProvider:(NSArray> * (^)(void))getLoaders decodersProvider:(NSArray> * (^)(void))getHandlers ``` Right now, both the ids and ids are NativeModules. So, they need to be loaded using the Bridge/TurboModuleManager. ## Problem The method [that constructs RCTImageLoader](https://www.internalfb.com/code/fbsource/[6530647879a5e6d5edcfad029b39879c87e97bb3]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/FBReactModule.mm?lines=1462-1469) is shared between bridge mode and bridgeless mode. So, the shared constructor needs to know what infra to use to load the loaders/decoders: the TurboModuleManager, when called from a bridgeless context; the bridge, when called from a bridge context. There's no easy way to let this shared constructor know what context it's being called from. We could fork the constructor, but that's not very clean. ## Changes In this refactor, RCTImageLoader gives its loadersProvider and decodersProvider its RCTModuleRegistry. If the module was instantiated in bridgeless mode, RCTModuleRegistry will use the TurboModuleManager. If the module was instantiated in bridge mode, RCTModuleRegistry will use the bridge. Using RCTModuleRegistry allows these two blocks to load the RCTImageURLLoaders and RCTImageDataDecoder from correct infra, in both contexts. Changelog: [iOS][Changed] - Give RCTImageURLLoader's loader/decoder provider blocks RCTModuleRegistry Reviewed By: PeteTheHeat Differential Revision: D28012999 fbshipit-source-id: 09c787923b57bbf72aff95b504f88ee1f2f44283 --- Libraries/Image/RCTImageLoader.h | 4 ++-- Libraries/Image/RCTImageLoader.mm | 12 ++++++------ packages/rn-tester/RNTester/AppDelegate.mm | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Libraries/Image/RCTImageLoader.h b/Libraries/Image/RCTImageLoader.h index b7040e1a4c77d0..da0df284e6f6b8 100644 --- a/Libraries/Image/RCTImageLoader.h +++ b/Libraries/Image/RCTImageLoader.h @@ -21,8 +21,8 @@ - (instancetype)init; - (instancetype)initWithRedirectDelegate:(id)redirectDelegate NS_DESIGNATED_INITIALIZER; - (instancetype)initWithRedirectDelegate:(id)redirectDelegate - loadersProvider:(NSArray> * (^)(void))getLoaders - decodersProvider:(NSArray> * (^)(void))getDecoders; + loadersProvider:(NSArray> * (^)(RCTModuleRegistry *))getLoaders + decodersProvider:(NSArray> * (^)(RCTModuleRegistry *))getDecoders; @end /** diff --git a/Libraries/Image/RCTImageLoader.mm b/Libraries/Image/RCTImageLoader.mm index cf63f937eeeaf6..90bdfbb01296a0 100644 --- a/Libraries/Image/RCTImageLoader.mm +++ b/Libraries/Image/RCTImageLoader.mm @@ -80,8 +80,8 @@ - (void)setReactDecodedImageBytes:(NSInteger)bytes @implementation RCTImageLoader { - NSArray> * (^_loadersProvider)(void); - NSArray> * (^_decodersProvider)(void); + NSArray> * (^_loadersProvider)(RCTModuleRegistry *); + NSArray> * (^_decodersProvider)(RCTModuleRegistry *); NSArray> *_loaders; NSArray> *_decoders; NSOperationQueue *_imageDecodeQueue; @@ -123,8 +123,8 @@ - (instancetype)initWithRedirectDelegate:(id)redirectD } - (instancetype)initWithRedirectDelegate:(id)redirectDelegate - loadersProvider:(NSArray> * (^)(void))getLoaders - decodersProvider:(NSArray> * (^)(void))getHandlers + loadersProvider:(NSArray> * (^)(RCTModuleRegistry *))getLoaders + decodersProvider:(NSArray> * (^)(RCTModuleRegistry *))getHandlers { if (self = [self initWithRedirectDelegate:redirectDelegate]) { _loadersProvider = getLoaders; @@ -178,7 +178,7 @@ - (void)setImageCache:(id)cache // Get loaders, sorted in reverse priority order (highest priority first) if (_loadersProvider) { - _loaders = _loadersProvider(); + _loaders = _loadersProvider(self.moduleRegistry); } else { RCTAssert(_bridge, @"Trying to find RCTImageURLLoaders and bridge not set."); _loaders = [_bridge modulesConformingToProtocol:@protocol(RCTImageURLLoader)]; @@ -245,7 +245,7 @@ - (void)setImageCache:(id)cache // Get decoders, sorted in reverse priority order (highest priority first) if (_decodersProvider) { - _decoders = _decodersProvider(); + _decoders = _decodersProvider(self.moduleRegistry); } else { RCTAssert(_bridge, @"Trying to find RCTImageDataDecoders and bridge not set."); _decoders = [_bridge modulesConformingToProtocol:@protocol(RCTImageDataDecoder)]; diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm index 70c973bd8de7b4..03cf01c9302e41 100644 --- a/packages/rn-tester/RNTester/AppDelegate.mm +++ b/packages/rn-tester/RNTester/AppDelegate.mm @@ -208,10 +208,10 @@ - (Class)getModuleClassFromName:(const char *)name { if (moduleClass == RCTImageLoader.class) { return [[moduleClass alloc] initWithRedirectDelegate:nil - loadersProvider:^NSArray> * { + loadersProvider:^NSArray> *(RCTModuleRegistry * moduleRegistry) { return @ [[RCTLocalAssetImageLoader new]]; } - decodersProvider:^NSArray> * { + decodersProvider:^NSArray> *(RCTModuleRegistry * moduleRegistry) { return @ [[RCTGIFImageDecoder new]]; }]; } else if (moduleClass == RCTNetworking.class) { From 4c5182c1cc8bafb15490adf602c87cb5bf289ffd Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 27 Apr 2021 15:00:51 -0700 Subject: [PATCH 083/259] RCTNetworking: Use RCTModuleRegistry to load handlers Summary: ## Context A React Native application can configure its RCTNetworking by initializing it with id objects. Therefore, RCTNetworking supports this initializer: ``` - (instancetype)initWithHandlersProvider:(NSArray> * (^)(void))getHandlers ``` Right now, all id are NativeModules. So, they need to be loaded using the Bridge/TurboModuleManager. ## Problem The method [that constructs RCTNetworking](https://www.internalfb.com/code/fbsource/[6530647879a5e6d5edcfad029b39879c87e97bb3]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/FBReactModule.mm?lines=1471) is shared between bridge mode and bridgeless mode. So, the shared constructor needs to know what infra to use to load the request handlers: the TurboModuleManager, when called from a bridgeless context; the bridge, when called from a bridge context. There's no easy way to let this shared constructor know what context it's being called from. We could fork the constructor, but that's not very clean. ## Changes In this refactor, RCTNetworking gives its _handlersProvider its RCTModuleRegistry. If the module was instantiated in bridgeless mode, RCTModuleRegistry will use the TurboModuleManager. If the module was instantiated in bridge mode, RCTModuleRegistry will use the bridge. Using RCTModuleRegistry allows the _handlersProvider to load id from correct infra, in both contexts. Changelog: [iOS][Changed] - Give RCTNetworking handler provider block RCTModuleRegistry Reviewed By: PeteTheHeat Differential Revision: D28013000 fbshipit-source-id: 956d660771ab18f5e7f24fcc28792f9a217146e7 --- Libraries/Network/RCTNetworking.h | 2 +- Libraries/Network/RCTNetworking.mm | 6 +++--- packages/rn-tester/RNTester/AppDelegate.mm | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Libraries/Network/RCTNetworking.h b/Libraries/Network/RCTNetworking.h index 18344302ea8034..2068f32b803038 100644 --- a/Libraries/Network/RCTNetworking.h +++ b/Libraries/Network/RCTNetworking.h @@ -31,7 +31,7 @@ * Allows RCTNetworking instances to be initialized with handlers. * The handlers will be requested via the bridge's moduleForName method when required. */ -- (instancetype)initWithHandlersProvider:(NSArray> * (^)(void))getHandlers; +- (instancetype)initWithHandlersProvider:(NSArray> * (^)(RCTModuleRegistry *))getHandlers; /** * Does a handler exist for the specified request? diff --git a/Libraries/Network/RCTNetworking.mm b/Libraries/Network/RCTNetworking.mm index 0f9c3d61c0b104..22ca45b0fa3ff4 100644 --- a/Libraries/Network/RCTNetworking.mm +++ b/Libraries/Network/RCTNetworking.mm @@ -148,7 +148,7 @@ @implementation RCTNetworking NSMutableDictionary *_tasksByRequestID; std::mutex _handlersLock; NSArray> *_handlers; - NSArray> * (^_handlersProvider)(void); + NSArray> * (^_handlersProvider)(RCTModuleRegistry *); NSMutableArray> *_requestHandlers; NSMutableArray> *_responseHandlers; } @@ -167,7 +167,7 @@ - (instancetype)init return [super initWithDisabledObservation]; } -- (instancetype)initWithHandlersProvider:(NSArray> * (^)(void))getHandlers +- (instancetype)initWithHandlersProvider:(NSArray> * (^)(RCTModuleRegistry *moduleRegistry))getHandlers { if (self = [super initWithDisabledObservation]) { _handlersProvider = getHandlers; @@ -209,7 +209,7 @@ - (void)invalidate if (!_handlers) { if (_handlersProvider) { - _handlers = _handlersProvider(); + _handlers = _handlersProvider(self.moduleRegistry); } else { _handlers = [self.bridge modulesConformingToProtocol:@protocol(RCTURLRequestHandler)]; } diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm index 03cf01c9302e41..c54f94fae65bef 100644 --- a/packages/rn-tester/RNTester/AppDelegate.mm +++ b/packages/rn-tester/RNTester/AppDelegate.mm @@ -215,7 +215,7 @@ - (Class)getModuleClassFromName:(const char *)name return @ [[RCTGIFImageDecoder new]]; }]; } else if (moduleClass == RCTNetworking.class) { - return [[moduleClass alloc] initWithHandlersProvider:^NSArray> * { + return [[moduleClass alloc] initWithHandlersProvider:^NSArray> *(RCTModuleRegistry * moduleRegistry) { return @[ [RCTHTTPRequestHandler new], [RCTDataRequestHandler new], From 3178e80c889ccff194c7ac3fc7c5b91eaffa75ca Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 27 Apr 2021 19:43:56 -0700 Subject: [PATCH 084/259] Cleanup unused variables Summary: EZ cleanup of unused variables in TextLayoutManager changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D28015819 fbshipit-source-id: 8e380926ebff9256e89e6cd654fa96eeb938d797 --- .../java/com/facebook/react/views/text/TextLayoutManager.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index 0b88a8a28d9fbb..cae80df050d618 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -375,10 +375,6 @@ public static long measureText( } BoringLayout.Metrics boring = BoringLayout.isBoring(text, textPaint); - float desiredWidth = boring == null ? Layout.getDesiredWidth(text, textPaint) : Float.NaN; - - // technically, width should never be negative, but there is currently a bug in - boolean unconstrainedWidth = widthYogaMeasureMode == YogaMeasureMode.UNDEFINED || width < 0; Layout layout = createLayout( From 3d0cf8dcf88c529f262ab91af0e0c0b58839c4b5 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 27 Apr 2021 19:43:56 -0700 Subject: [PATCH 085/259] Fix IllegalArgumentException when creating layout with negative width Summary: This diff fixes an IllegalArgumentException that's thrown when creating layout with negative width. This is not a new bug, but it started firing recently (probably caused by a change in text being measured) stacktrace: ``` stack_trace: java.lang.IllegalArgumentException: Layout: -2 < 0 at android.text.Layout.(Layout.java:265) at android.text.Layout.(Layout.java:241) at android.text.BoringLayout.(BoringLayout.java:179) at android.text.BoringLayout.make(BoringLayout.java:61) at com.facebook.react.views.text.TextLayoutManager.createLayout(TextLayoutManager.java:290) at com.facebook.react.views.text.TextLayoutManager.measureText(TextLayoutManager.java:384) [inlined] at com.facebook.react.views.text.ReactTextViewManager.measure(ReactTextViewManager.java:172) [inlined] at com.facebook.react.fabric.mounting.MountingManager.measure(MountingManager.java:349) [inlined] at com.facebook.react.fabric.FabricUIManager.measure(FabricUIManager.java:461) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) ``` changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D28015820 fbshipit-source-id: 129cd2a4c492d95d57fcdf3883b967a0b5df639a --- .../react/views/text/ReactTextShadowNode.java | 9 ++++++++- .../facebook/react/views/text/TextLayoutManager.java | 11 ++++++++++- .../react/views/text/TextLayoutManagerMapBuffer.java | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index 53111f412758ff..f350bccf872f58 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -231,7 +231,14 @@ private Layout measureSpannedText(Spannable text, float width, YogaMeasureMode w // than the width of the text. layout = BoringLayout.make( - text, textPaint, boring.width, alignment, 1.f, 0.f, boring, mIncludeFontPadding); + text, + textPaint, + Math.max(boring.width, 0), + alignment, + 1.f, + 0.f, + boring, + mIncludeFontPadding); } else { // Is used for multiline, boring text and the width is known. diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index cae80df050d618..bbb57f87e88c0d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -24,6 +24,8 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.facebook.common.logging.FLog; +import com.facebook.react.bridge.ReactNoCrashSoftException; +import com.facebook.react.bridge.ReactSoftException; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.ReadableNativeMap; @@ -284,13 +286,20 @@ private static Layout createLayout( } } else if (boring != null && (unconstrainedWidth || boring.width <= width)) { + int boringLayoutWidth = boring.width; + if (boring.width < 0) { + ReactSoftException.logSoftException( + TAG, new ReactNoCrashSoftException("Text width is invalid: " + boring.width)); + boringLayoutWidth = 0; + } + // Is used for single-line, boring text when the width is either unknown or bigger // than the width of the text. layout = BoringLayout.make( text, textPaint, - boring.width, + boringLayoutWidth, Layout.Alignment.ALIGN_NORMAL, 1.f, 0.f, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java index 7af9a540f8644f..422d986a636170 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java @@ -24,6 +24,8 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.facebook.common.logging.FLog; +import com.facebook.react.bridge.ReactNoCrashSoftException; +import com.facebook.react.bridge.ReactSoftException; import com.facebook.react.bridge.WritableArray; import com.facebook.react.common.build.ReactBuildConfig; import com.facebook.react.common.mapbuffer.ReadableMapBuffer; @@ -298,13 +300,19 @@ private static Layout createLayout( } } else if (boring != null && (unconstrainedWidth || boring.width <= width)) { + int boringLayoutWidth = boring.width; + if (boring.width < 0) { + ReactSoftException.logSoftException( + TAG, new ReactNoCrashSoftException("Text width is invalid: " + boring.width)); + boringLayoutWidth = 0; + } // Is used for single-line, boring text when the width is either unknown or bigger // than the width of the text. layout = BoringLayout.make( text, textPaint, - boring.width, + boringLayoutWidth, Layout.Alignment.ALIGN_NORMAL, 1.f, 0.f, From a56c15894afcdef46f1aac67568cfc75bcb945be Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 27 Apr 2021 19:43:56 -0700 Subject: [PATCH 086/259] Enable Fabric in logbox Summary: This diff enables Fabric in logbox in the facebook app changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D28031255 fbshipit-source-id: 8abc301651ad09e4e48c88961bc7f3b91e6c4ae3 --- .../src/main/java/com/facebook/react/ReactInstanceManager.java | 3 +-- .../main/java/com/facebook/react/config/ReactFeatureFlags.java | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 2b97586881aec9..2b0d89aa19adbc 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -318,9 +318,8 @@ public JavaScriptExecutorFactory getJavaScriptExecutorFactory() { Activity currentActivity = getCurrentActivity(); if (currentActivity != null) { ReactRootView rootView = new ReactRootView(currentActivity); - + rootView.setIsFabric(ReactFeatureFlags.enableFabricInLogBox); rootView.startReactApplication(ReactInstanceManager.this, appKey, null); - return rootView; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index 23668c8a3ffd7e..07a9e870090804 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -92,4 +92,7 @@ public static boolean enableRuntimeExecutorFlushing() { return false; } + + /** Enables Fabric for LogBox */ + public static boolean enableFabricInLogBox = false; } From 74d35599246d1c976a9db9882b6f85f1fda46e77 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Wed, 28 Apr 2021 04:18:12 -0700 Subject: [PATCH 087/259] Clean up extract_uimanagerbinding_on_demand experiment Summary: Changelog: [internal] Cleanup the experiment. Reviewed By: mdvacca Differential Revision: D27995976 fbshipit-source-id: dd6b25f5ad225243765d64b7d92b97f4423005a2 --- .../react/renderer/scheduler/Scheduler.cpp | 3 --- .../react/renderer/uimanager/UIManager.cpp | 15 +++------------ ReactCommon/react/renderer/uimanager/UIManager.h | 3 --- .../react/renderer/uimanager/UIManagerBinding.cpp | 15 --------------- 4 files changed, 3 insertions(+), 33 deletions(-) diff --git a/ReactCommon/react/renderer/scheduler/Scheduler.cpp b/ReactCommon/react/renderer/scheduler/Scheduler.cpp index 40a37fe1c23d33..be88fc673c68bd 100644 --- a/ReactCommon/react/renderer/scheduler/Scheduler.cpp +++ b/ReactCommon/react/renderer/scheduler/Scheduler.cpp @@ -139,9 +139,6 @@ Scheduler::Scheduler( enableNewDiffer_ = reactNativeConfig_->getBool("react_fabric:enable_new_differ_h1_2021_ios"); #endif - - uiManager->extractUIManagerBindingOnDemand_ = reactNativeConfig_->getBool( - "react_fabric:extract_uimanagerbinding_on_demand"); } Scheduler::~Scheduler() { diff --git a/ReactCommon/react/renderer/uimanager/UIManager.cpp b/ReactCommon/react/renderer/uimanager/UIManager.cpp index 74634904d77e95..e938163509e3a2 100644 --- a/ReactCommon/react/renderer/uimanager/UIManager.cpp +++ b/ReactCommon/react/renderer/uimanager/UIManager.cpp @@ -364,19 +364,10 @@ UIManagerDelegate *UIManager::getDelegate() { void UIManager::visitBinding( std::function callback, jsi::Runtime &runtime) const { - if (extractUIManagerBindingOnDemand_) { - auto uiManagerBinding = UIManagerBinding::getBinding(runtime); - if (uiManagerBinding) { - callback(*uiManagerBinding_); - } - return; + auto uiManagerBinding = UIManagerBinding::getBinding(runtime); + if (uiManagerBinding) { + callback(*uiManagerBinding); } - - if (!uiManagerBinding_) { - return; - } - - callback(*uiManagerBinding_); } ShadowTreeRegistry const &UIManager::getShadowTreeRegistry() const { diff --git a/ReactCommon/react/renderer/uimanager/UIManager.h b/ReactCommon/react/renderer/uimanager/UIManager.h index 0133b1cb710747..052a35ae5d1d1b 100644 --- a/ReactCommon/react/renderer/uimanager/UIManager.h +++ b/ReactCommon/react/renderer/uimanager/UIManager.h @@ -187,7 +187,6 @@ class UIManager final : public ShadowTreeDelegate { SharedComponentDescriptorRegistry componentDescriptorRegistry_; UIManagerDelegate *delegate_; UIManagerAnimationDelegate *animationDelegate_{nullptr}; - UIManagerBinding *uiManagerBinding_; RuntimeExecutor const runtimeExecutor_{}; ShadowTreeRegistry shadowTreeRegistry_{}; BackgroundExecutor const backgroundExecutor_{}; @@ -195,8 +194,6 @@ class UIManager final : public ShadowTreeDelegate { mutable better::shared_mutex commitHookMutex_; mutable std::vector commitHooks_; - bool extractUIManagerBindingOnDemand_{}; - std::unique_ptr leakChecker_; }; diff --git a/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index 744de426797861..31b91339b211a0 100644 --- a/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -96,25 +96,10 @@ std::shared_ptr UIManagerBinding::getBinding( UIManagerBinding::~UIManagerBinding() { LOG(WARNING) << "UIManagerBinding::~UIManagerBinding() was called (address: " << this << ")."; - - // We must detach the `UIBinding` on deallocation to prevent accessing - // deallocated `UIManagerBinding`. - // Since `UIManagerBinding` retains `UIManager`, `UIManager` always overlive - // `UIManagerBinding`, therefore we don't need similar logic in `UIManager`'s - // destructor. - attach(nullptr); } void UIManagerBinding::attach(std::shared_ptr const &uiManager) { - if (uiManager_) { - uiManager_->uiManagerBinding_ = nullptr; - } - uiManager_ = uiManager; - - if (uiManager_) { - uiManager_->uiManagerBinding_ = this; - } } static jsi::Value callMethodOfModule( From 050f84fd2b3bd15c98e530700d8902925920d839 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Wed, 28 Apr 2021 10:58:37 -0700 Subject: [PATCH 088/259] EventQueue::enqueueStateUpdate now accepts rvalue reference Summary: Changelog: [internal] state infra uses rvalue references until this point. I assume the original author intended to rvalue reference even here. This way, we avoid unnecessary copy. Reviewed By: JoshuaGross Differential Revision: D28057570 fbshipit-source-id: 19af480234d44acffcdbb22606607279e25c8aed --- ReactCommon/react/renderer/core/EventQueue.cpp | 4 ++-- ReactCommon/react/renderer/core/EventQueue.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReactCommon/react/renderer/core/EventQueue.cpp b/ReactCommon/react/renderer/core/EventQueue.cpp index 639d29a4751729..14e0be0998760b 100644 --- a/ReactCommon/react/renderer/core/EventQueue.cpp +++ b/ReactCommon/react/renderer/core/EventQueue.cpp @@ -33,7 +33,7 @@ void EventQueue::enqueueEvent(const RawEvent &rawEvent) const { onEnqueue(); } -void EventQueue::enqueueStateUpdate(const StateUpdate &stateUpdate) const { +void EventQueue::enqueueStateUpdate(StateUpdate &&stateUpdate) const { { std::lock_guard lock(queueMutex_); if (!stateUpdateQueue_.empty()) { @@ -42,7 +42,7 @@ void EventQueue::enqueueStateUpdate(const StateUpdate &stateUpdate) const { stateUpdateQueue_.pop_back(); } } - stateUpdateQueue_.push_back(stateUpdate); + stateUpdateQueue_.push_back(std::move(stateUpdate)); } onEnqueue(); diff --git a/ReactCommon/react/renderer/core/EventQueue.h b/ReactCommon/react/renderer/core/EventQueue.h index ed77cad3f6157d..5db0d88385da79 100644 --- a/ReactCommon/react/renderer/core/EventQueue.h +++ b/ReactCommon/react/renderer/core/EventQueue.h @@ -43,7 +43,7 @@ class EventQueue { * Enqueues and (probably later) dispatch a given state update. * Can be called on any thread. */ - void enqueueStateUpdate(const StateUpdate &stateUpdate) const; + void enqueueStateUpdate(StateUpdate &&stateUpdate) const; protected: /* From 08ea434ba8b0142500584199c941760c10384902 Mon Sep 17 00:00:00 2001 From: Adam Cmiel Date: Wed, 28 Apr 2021 11:05:46 -0700 Subject: [PATCH 089/259] Migrate xplat autoglob targets (#31400) Summary: ## Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/31400 Pull Request resolved: https://github.com/facebook/react-native/pull/31411 Annotate autolgob mode for apple library targets Reviewed By: adamjernst Differential Revision: D27890473 fbshipit-source-id: 75239c6c1871310e1ccd6576569161eb4163a3c1 --- Libraries/FBLazyVector/BUCK | 6 +++++- Libraries/RCTRequired/BUCK | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Libraries/FBLazyVector/BUCK b/Libraries/FBLazyVector/BUCK index d526718e2de05b..089bca264b12ab 100644 --- a/Libraries/FBLazyVector/BUCK +++ b/Libraries/FBLazyVector/BUCK @@ -2,7 +2,11 @@ load("//tools/build_defs/oss:rn_defs.bzl", "fb_apple_library") fb_apple_library( name = "FBLazyVector", - autoglob = True, + exported_headers = [ + "FBLazyVector/FBLazyIterator.h", + "FBLazyVector/FBLazyVector.h", + ], + autoglob = False, complete_nullability = True, contacts = ["oncall+react_native@xmail.facebook.com"], enable_exceptions = False, diff --git a/Libraries/RCTRequired/BUCK b/Libraries/RCTRequired/BUCK index 18d34dc7750d91..53eb8a475d3ba7 100644 --- a/Libraries/RCTRequired/BUCK +++ b/Libraries/RCTRequired/BUCK @@ -2,7 +2,10 @@ load("//tools/build_defs/oss:rn_defs.bzl", "fb_apple_library") fb_apple_library( name = "RCTRequired", - autoglob = True, + exported_headers = [ + "RCTRequired/RCTRequired.h", + ], + autoglob = False, complete_nullability = True, contacts = ["oncall+react_native@xmail.facebook.com"], extension_api_only = True, From 2f62c2892d9979f80752350d1b949f2770511956 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Wed, 28 Apr 2021 13:28:01 -0700 Subject: [PATCH 090/259] Fix crash in RCTCoreModulesClassProvider during quit Summary: This intentionally leaks the static map, since it still might be accessed after static destructors are run. This is a common approach to this problem, see https://github.com/facebook/react-native/pull/22607 and https://github.com/facebook/componentkit/pull/906 as examples. It also sets up an autorelease pool from `RCTNativeModule::invoke` as a precaution since there's no strict guarantee one exists when it is called. Changelog: [iOS][Fixed] - Fix crash in RCTCoreModulesClassProvider during quit Reviewed By: RSNara Differential Revision: D27932062 fbshipit-source-id: fa75da4b78290027a762440ac6943c81b8594a57 --- Libraries/Blob/RCTBlobPlugins.mm | 7 ++++--- Libraries/Image/RCTImagePlugins.mm | 7 ++++--- Libraries/LinkingIOS/RCTLinkingPlugins.mm | 7 ++++--- Libraries/NativeAnimation/RCTAnimationPlugins.mm | 7 ++++--- Libraries/Network/RCTNetworkPlugins.mm | 7 ++++--- .../PushNotificationIOS/RCTPushNotificationPlugins.mm | 7 ++++--- Libraries/Settings/RCTSettingsPlugins.mm | 7 ++++--- Libraries/Vibration/RCTVibrationPlugins.mm | 7 ++++--- React/CoreModules/CoreModulesPlugins.mm | 7 ++++--- React/CxxModule/RCTNativeModule.mm | 4 +++- 10 files changed, 39 insertions(+), 28 deletions(-) diff --git a/Libraries/Blob/RCTBlobPlugins.mm b/Libraries/Blob/RCTBlobPlugins.mm index d06f40e5d21120..289094f35d43a0 100644 --- a/Libraries/Blob/RCTBlobPlugins.mm +++ b/Libraries/Blob/RCTBlobPlugins.mm @@ -17,13 +17,14 @@ #import Class RCTBlobClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"FileReaderModule", RCTFileReaderModuleCls}, {"BlobModule", RCTBlobManagerCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/Libraries/Image/RCTImagePlugins.mm b/Libraries/Image/RCTImagePlugins.mm index 3cde9e95650e5b..1e03e76066e244 100644 --- a/Libraries/Image/RCTImagePlugins.mm +++ b/Libraries/Image/RCTImagePlugins.mm @@ -17,7 +17,8 @@ #import Class RCTImageClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"GIFImageDecoder", RCTGIFImageDecoderCls}, {"ImageEditingManager", RCTImageEditingManagerCls}, {"ImageLoader", RCTImageLoaderCls}, @@ -25,8 +26,8 @@ Class RCTImageClassProvider(const char *name) { {"LocalAssetImageLoader", RCTLocalAssetImageLoaderCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/Libraries/LinkingIOS/RCTLinkingPlugins.mm b/Libraries/LinkingIOS/RCTLinkingPlugins.mm index b2549557558b23..b5993a9b306ff5 100644 --- a/Libraries/LinkingIOS/RCTLinkingPlugins.mm +++ b/Libraries/LinkingIOS/RCTLinkingPlugins.mm @@ -17,12 +17,13 @@ #import Class RCTLinkingClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"LinkingManager", RCTLinkingManagerCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/Libraries/NativeAnimation/RCTAnimationPlugins.mm b/Libraries/NativeAnimation/RCTAnimationPlugins.mm index 6b9768b5257e10..b0eecfc9b8826a 100644 --- a/Libraries/NativeAnimation/RCTAnimationPlugins.mm +++ b/Libraries/NativeAnimation/RCTAnimationPlugins.mm @@ -17,13 +17,14 @@ #import Class RCTAnimationClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"NativeAnimatedModule", RCTNativeAnimatedModuleCls}, {"NativeAnimatedTurboModule", RCTNativeAnimatedTurboModuleCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/Libraries/Network/RCTNetworkPlugins.mm b/Libraries/Network/RCTNetworkPlugins.mm index 6a00252c5679b8..f1a016e1d209c8 100644 --- a/Libraries/Network/RCTNetworkPlugins.mm +++ b/Libraries/Network/RCTNetworkPlugins.mm @@ -17,15 +17,16 @@ #import Class RCTNetworkClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"Networking", RCTNetworkingCls}, {"DataRequestHandler", RCTDataRequestHandlerCls}, {"FileRequestHandler", RCTFileRequestHandlerCls}, {"HTTPRequestHandler", RCTHTTPRequestHandlerCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/Libraries/PushNotificationIOS/RCTPushNotificationPlugins.mm b/Libraries/PushNotificationIOS/RCTPushNotificationPlugins.mm index 587a7b17a86688..434829371738ec 100644 --- a/Libraries/PushNotificationIOS/RCTPushNotificationPlugins.mm +++ b/Libraries/PushNotificationIOS/RCTPushNotificationPlugins.mm @@ -17,12 +17,13 @@ #import Class RCTPushNotificationClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"PushNotificationManager", RCTPushNotificationManagerCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/Libraries/Settings/RCTSettingsPlugins.mm b/Libraries/Settings/RCTSettingsPlugins.mm index 09438ed1fc31f3..7ce46c64c84a4d 100644 --- a/Libraries/Settings/RCTSettingsPlugins.mm +++ b/Libraries/Settings/RCTSettingsPlugins.mm @@ -17,12 +17,13 @@ #import Class RCTSettingsClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"SettingsManager", RCTSettingsManagerCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/Libraries/Vibration/RCTVibrationPlugins.mm b/Libraries/Vibration/RCTVibrationPlugins.mm index 61421c2ef21e1c..d98ae4aae82b57 100644 --- a/Libraries/Vibration/RCTVibrationPlugins.mm +++ b/Libraries/Vibration/RCTVibrationPlugins.mm @@ -17,12 +17,13 @@ #import Class RCTVibrationClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"Vibration", RCTVibrationCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/React/CoreModules/CoreModulesPlugins.mm b/React/CoreModules/CoreModulesPlugins.mm index c2d1b268b4fa6a..42ba5e45c9ecf5 100644 --- a/React/CoreModules/CoreModulesPlugins.mm +++ b/React/CoreModules/CoreModulesPlugins.mm @@ -17,7 +17,8 @@ #import Class RCTCoreModulesClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { + // Intentionally leak to avoid crashing after static destructors are run. + static const auto sCoreModuleClassMap = new const std::unordered_map{ {"AccessibilityManager", RCTAccessibilityManagerCls}, {"Appearance", RCTAppearanceCls}, {"DeviceInfo", RCTDeviceInfoCls}, @@ -45,8 +46,8 @@ Class RCTCoreModulesClassProvider(const char *name) { {"EventDispatcher", RCTEventDispatcherCls}, }; - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { + auto p = sCoreModuleClassMap->find(name); + if (p != sCoreModuleClassMap->end()) { auto classFunc = p->second; return classFunc(); } diff --git a/React/CxxModule/RCTNativeModule.mm b/React/CxxModule/RCTNativeModule.mm index be74794fc572c0..cea144f5f469da 100644 --- a/React/CxxModule/RCTNativeModule.mm +++ b/React/CxxModule/RCTNativeModule.mm @@ -100,7 +100,9 @@ static MethodCallResult invokeInner( #else (void)(callId); #endif - invokeInner(weakBridge, weakModuleData, methodId, std::move(params), callId, isSyncModule ? Sync : Async); + @autoreleasepool { + invokeInner(weakBridge, weakModuleData, methodId, std::move(params), callId, isSyncModule ? Sync : Async); + } }; if (isSyncModule) { From 84d55868e8b4e5a555d324c6162b8e38571524d8 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Wed, 28 Apr 2021 13:47:11 -0700 Subject: [PATCH 091/259] Fix DatePicker sizing issue Summary: Changelog: Fix possible sizing issue with DatePicker Changing `preferredDatePickerStyle` changes size of the component without triggering re-layout of the react native screen. The fix is to make sure the size stays the same after changing the style. Reviewed By: mdvacca Differential Revision: D28035226 fbshipit-source-id: 2dcb50fd5ebaa0c0d01d3289c4ffa77a053cfc4a --- React/Views/RCTDatePickerManager.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/React/Views/RCTDatePickerManager.m b/React/Views/RCTDatePickerManager.m index 3fb37eeadb8691..f6fec6d739f17a 100644 --- a/React/Views/RCTDatePickerManager.m +++ b/React/Views/RCTDatePickerManager.m @@ -85,11 +85,17 @@ - (UIView *)view RCT_CUSTOM_VIEW_PROPERTY(pickerStyle, UIDatePickerStyle, RCTDatePicker) { if (@available(iOS 14, *)) { + // If the style changed, then the date picker may need to be resized and will generate a layout pass to display + // correctly. We need to prevent that to get consistent layout. That's why we memorise the old frame and set it + // after style is changed. + CGRect oldFrame = view.frame; if (json) { - view.preferredDatePickerStyle = [RCTConvert UIDatePickerStyle:json]; + UIDatePickerStyle style = [RCTConvert UIDatePickerStyle:json]; + view.preferredDatePickerStyle = style; } else { view.preferredDatePickerStyle = UIDatePickerStyleWheels; } + view.frame = oldFrame; } } #endif From c68c151cda24bba04d3e621a70d8bb4ed4a8d920 Mon Sep 17 00:00:00 2001 From: Kacie Bawiec Date: Wed, 28 Apr 2021 14:15:43 -0700 Subject: [PATCH 092/259] React Native sync for revisions a632f7d...2a7bb41 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This sync includes the following changes: - **[9a2591681](https://github.com/facebook/react/commit/9a2591681 )**: Fix export //// - **[4a8deb083](https://github.com/facebook/react/commit/4a8deb083 )**: Switch the isPrimaryRender flag based on the stream config ([#21357](https://github.com/facebook/react/pull/21357)) //// - **[bd4f056a3](https://github.com/facebook/react/commit/bd4f056a3 )**: [Fizz] Implement lazy components and nodes ([#21355](https://github.com/facebook/react/pull/21355)) //// - **[fc33f12bd](https://github.com/facebook/react/commit/fc33f12bd )**: Remove unstable scheduler/tracing API ([#20037](https://github.com/facebook/react/pull/20037)) //// - **[721238394](https://github.com/facebook/react/commit/721238394 )**: Enable strict effects mode for React Native Facebook builds ([#21354](https://github.com/facebook/react/pull/21354)) //// - **[48740429b](https://github.com/facebook/react/commit/48740429b )**: Expiration: Do nothing except disable time slicing ([#21345](https://github.com/facebook/react/pull/21345)) //// - **[0f5ebf366](https://github.com/facebook/react/commit/0f5ebf366 )**: Delete unreferenced type ([#21343](https://github.com/facebook/react/pull/21343)) //// - **[9cd52b27f](https://github.com/facebook/react/commit/9cd52b27f )**: Restore context after an error happens ([#21341](https://github.com/facebook/react/pull/21341)) //// - **[ad091759a](https://github.com/facebook/react/commit/ad091759a )**: Revert "Emit reactroot attribute on the first element we discover ([#21154](https://github.com/facebook/react/pull/21154))" ([#21340](https://github.com/facebook/react/pull/21340)) //// - **[709f94841](https://github.com/facebook/react/commit/709f94841 )**: [Fizz] Add FB specific streaming API and build ([#21337](https://github.com/facebook/react/pull/21337)) //// - **[e8cdce40d](https://github.com/facebook/react/commit/e8cdce40d )**: Don't flush sync at end of discreteUpdates ([#21327](https://github.com/facebook/react/pull/21327)) //// - **[a15586001](https://github.com/facebook/react/commit/a15586001 )**: Fix: Don't flush discrete at end of batchedUpdates ([#21229](https://github.com/facebook/react/pull/21229)) //// - **[89847bf6e](https://github.com/facebook/react/commit/89847bf6e )**: Continuous updates should interrupt transitions ([#21323](https://github.com/facebook/react/pull/21323)) //// - **[ef37d55b6](https://github.com/facebook/react/commit/ef37d55b6 )**: Use performConcurrentWorkOnRoot for "sync default" ([#21322](https://github.com/facebook/react/pull/21322)) //// Changelog: [General][Changed] - React Native sync for revisions a632f7d...2a7bb41 jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D28063006 fbshipit-source-id: 7e3535f80961706863b6c2188ee44b5796b2f000 --- Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 679 +++++++++--------- .../implementations/ReactFabric-prod.fb.js | 192 +++-- .../ReactFabric-profiling.fb.js | 478 +++++------- .../ReactNativeRenderer-dev.fb.js | 679 +++++++++--------- .../ReactNativeRenderer-prod.fb.js | 192 +++-- .../ReactNativeRenderer-profiling.fb.js | 475 ++++-------- 7 files changed, 1198 insertions(+), 1499 deletions(-) diff --git a/Libraries/Renderer/REVISION b/Libraries/Renderer/REVISION index 2c1efdff048027..b96667b908e3af 100644 --- a/Libraries/Renderer/REVISION +++ b/Libraries/Renderer/REVISION @@ -1 +1 @@ -a632f7de3bd35eaf6d5082054af4da92dd37cf20 \ No newline at end of file +2a7bb4154809f1f4e17ffbdde1342bd4ce91ea37 \ No newline at end of file diff --git a/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index 978d18261fb538..cba73fe498dd0f 100644 --- a/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<85633cd599819668a18b16a0756284c2>> + * @generated SignedSource<<6573bbaed06f787c6bcc10b70eb3556b>> */ 'use strict'; @@ -20,7 +20,6 @@ var React = require("react"); require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"); var Scheduler = require("scheduler"); -var tracing = require("scheduler/tracing"); var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -2896,6 +2895,15 @@ var LayoutStatic = var PassiveStatic = /* */ 1048576; // These flags allow us to traverse to fibers that have effects on mount +// without traversing the entire tree after every commit for +// double invoking + +var MountLayoutDev = + /* */ + 2097152; +var MountPassiveDev = + /* */ + 4194304; // Groups of flags that are used in the commit phase to skip over trees that // don't contain effects, by checking subtreeFlags. var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visiblity @@ -3855,22 +3863,6 @@ var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; var NormalPriority = Scheduler.unstable_NormalPriority; var IdlePriority = Scheduler.unstable_IdlePriority; -{ - // Provide explicit error message when production+profiling bundle of e.g. - // react-dom is used with production (non-profiling) bundle of - // scheduler/tracing - if ( - !( - tracing.__interactionsRef != null && - tracing.__interactionsRef.current != null - ) - ) { - throw Error( - "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" - ); - } -} - var rendererID = null; var injectedHook = null; var hasLoggedError = false; @@ -4267,7 +4259,7 @@ function getNextLanes(root, wipLanes) { // Keep working on the existing in-progress tree. Do not interrupt. return wipLanes; } - } // Check for entangled lanes and add them to the batch. + } // // A lane is said to be entangled with another when it's not allowed to render // in a batch that does not also include the other lane. Typically we do this @@ -4402,7 +4394,6 @@ function markStarvedLanesAsExpired(root, currentTime) { // it as expired to force it to finish. var lanes = pendingLanes; - var expiredLanes = 0; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); @@ -4422,15 +4413,11 @@ function markStarvedLanesAsExpired(root, currentTime) { } } else if (expirationTime <= currentTime) { // This lane expired - expiredLanes |= lane; + root.expiredLanes |= lane; } lanes &= ~lane; } - - if (expiredLanes !== 0) { - markRootExpired(root, expiredLanes); - } } // This returns the highest priority pending lanes regardless of whether they function getLanesToRetrySynchronouslyOnError(root) { var everythingButOffscreen = root.pendingLanes & ~OffscreenLane; @@ -4454,6 +4441,17 @@ function includesOnlyRetries(lanes) { function includesOnlyTransitions(lanes) { return (lanes & TransitionLanes) === lanes; } +function shouldTimeSlice(root, lanes) { + if ((lanes & root.expiredLanes) !== NoLanes) { + // At least one of these lanes expired. To prevent additional starvation, + // finish rendering without yielding execution. + return false; + } + + { + return true; + } +} function isTransitionLane(lane) { return (lane & TransitionLanes) !== 0; } @@ -4572,13 +4570,6 @@ function markRootSuspended(root, suspendedLanes) { function markRootPinged(root, pingedLanes, eventTime) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } -function markRootExpired(root, expiredLanes) { - var entanglements = root.entanglements; - var SyncLaneIndex = 0; - entanglements[SyncLaneIndex] |= expiredLanes; - root.entangledLanes |= SyncLane; - root.pendingLanes |= SyncLane; -} function markRootMutableRead(root, updateLane) { root.mutableReadLanes |= updateLane & root.pendingLanes; } @@ -4588,6 +4579,7 @@ function markRootFinished(root, remainingLanes) { root.suspendedLanes = 0; root.pingedLanes = 0; + root.expiredLanes &= remainingLanes; root.mutableReadLanes &= remainingLanes; root.entangledLanes &= remainingLanes; @@ -5669,6 +5661,7 @@ var LegacyRoot = 0; var ConcurrentRoot = 1; var syncQueue = null; +var includesLegacySyncCallbacks = false; var isFlushingSyncQueue = false; function scheduleSyncCallback(callback) { // Push this callback into an internal queue. We'll flush these either in @@ -5681,7 +5674,21 @@ function scheduleSyncCallback(callback) { syncQueue.push(callback); } } -function flushSyncCallbackQueue() { +function scheduleLegacySyncCallback(callback) { + includesLegacySyncCallbacks = true; + scheduleSyncCallback(callback); +} +function flushSyncCallbacksOnlyInLegacyMode() { + // Only flushes the queue if there's a legacy sync callback scheduled. + // TODO: There's only a single type of callback: performSyncOnWorkOnRoot. So + // it might make more sense for the queue to be a list of roots instead of a + // list of generic callbacks. Then we can have two: one for legacy roots, one + // for concurrent roots. And this method would only flush the legacy ones. + if (includesLegacySyncCallbacks) { + flushSyncCallbacks(); + } +} +function flushSyncCallbacks() { if (!isFlushingSyncQueue && syncQueue !== null) { // Prevent re-entrancy. isFlushingSyncQueue = true; @@ -5704,13 +5711,14 @@ function flushSyncCallbackQueue() { } syncQueue = null; + includesLegacySyncCallbacks = false; } catch (error) { // If something throws, leave the remaining callbacks on the queue. if (syncQueue !== null) { syncQueue = syncQueue.slice(i + 1); } // Resume flushing in the next tick - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue); + scheduleCallback(ImmediatePriority, flushSyncCallbacks); throw error; } finally { setCurrentUpdatePriority(previousUpdatePriority); @@ -5759,6 +5767,9 @@ var DebugTracingMode = var StrictLegacyMode = /* */ 8; +var StrictEffectsMode = + /* */ + 16; var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; var NoTransition = 0; @@ -7933,6 +7944,11 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { if (typeof instance.componentDidMount === "function") { var fiberFlags = Update; + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + // Never double-invoke effects for legacy roots. + fiberFlags |= MountLayoutDev; + } + workInProgress.flags |= fiberFlags; } } @@ -7997,6 +8013,11 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { if (typeof instance.componentDidMount === "function") { var fiberFlags = Update; + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + // Never double-invoke effects for legacy roots. + fiberFlags |= MountLayoutDev; + } + workInProgress.flags |= fiberFlags; } @@ -8045,6 +8066,11 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { if (typeof instance.componentDidMount === "function") { var _fiberFlags = Update; + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + // Never double-invoke effects for legacy roots. + _fiberFlags |= MountLayoutDev; + } + workInProgress.flags |= _fiberFlags; } } else { @@ -8053,6 +8079,11 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { if (typeof instance.componentDidMount === "function") { var _fiberFlags2 = Update; + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + // Never double-invoke effects for legacy roots. + _fiberFlags2 |= MountLayoutDev; + } + workInProgress.flags |= _fiberFlags2; } // If shouldComponentUpdate returned false, we should still update the // memoized state to indicate that this work can be reused. @@ -10145,7 +10176,14 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the // complete phase (bubbleProperties). - { + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + workInProgress.flags &= ~( + MountPassiveDev | + MountLayoutDev | + Passive | + Update + ); + } else { workInProgress.flags &= ~(Passive | Update); } @@ -10926,7 +10964,14 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { } function mountEffect(create, deps) { - { + if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { + return mountEffectImpl( + MountPassiveDev | Passive | PassiveStatic, + Passive$1, + create, + deps + ); + } else { return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps); } } @@ -10938,6 +10983,10 @@ function updateEffect(create, deps) { function mountLayoutEffect(create, deps) { var fiberFlags = Update; + if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { + fiberFlags |= MountLayoutDev; + } + return mountEffectImpl(fiberFlags, Layout, create, deps); } @@ -10992,6 +11041,10 @@ function mountImperativeHandle(ref, create, deps) { deps !== null && deps !== undefined ? deps.concat([ref]) : null; var fiberFlags = Update; + if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { + fiberFlags |= MountLayoutDev; + } + return mountEffectImpl( fiberFlags, Layout, @@ -12601,10 +12654,6 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) { nextBaseLanes = renderLanes; } // Schedule this fiber to re-render at offscreen priority. Then bailout. - { - markSpawnedWork(OffscreenLane); - } - workInProgress.lanes = workInProgress.childLanes = laneToLanes( OffscreenLane ); @@ -13640,11 +13689,6 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { // it behind on this node. workInProgress.lanes = SomeRetryLane; - - { - markSpawnedWork(SomeRetryLane); - } - return _fallbackFragment; } else { return mountSuspensePrimaryChildren( @@ -15907,10 +15951,6 @@ function completeWork(current, workInProgress, renderLanes) { // since we're leaving it behind on this node. workInProgress.lanes = SomeRetryLane; - - { - markSpawnedWork(SomeRetryLane); - } } } else { cutOffTailIfNeeded(renderState, false); @@ -15967,10 +16007,6 @@ function completeWork(current, workInProgress, renderLanes) { // since we're leaving it behind on this node. workInProgress.lanes = SomeRetryLane; - - { - markSpawnedWork(SomeRetryLane); - } } } @@ -17229,17 +17265,14 @@ function commitLayoutEffectOnFiber( var phase = current === null ? "mount" : "update"; if (typeof onRender === "function") { - { - onRender( - finishedWork.memoizedProps.id, - phase, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - commitTime, - finishedRoot.memoizedInteractions - ); - } + onRender( + finishedWork.memoizedProps.id, + phase, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); } } @@ -17614,12 +17647,6 @@ function attachSuspenseRetryListeners(finishedWork) { var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); if (!retryCache.has(wakeable)) { - { - if (wakeable.__reactDoNotTraceInteractions !== true) { - retry = tracing.unstable_wrap(retry); - } - } - retryCache.add(wakeable); wakeable.then(retry, retry); @@ -18114,6 +18141,152 @@ function ensureCorrectReturnPointer(fiber, expectedReturnFiber) { fiber.return = expectedReturnFiber; } +function invokeLayoutEffectMountInDEV(fiber) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: { + invokeGuardedCallback( + null, + commitHookEffectListMount, + null, + Layout | HasEffect, + fiber + ); + + if (hasCaughtError()) { + var mountError = clearCaughtError(); + captureCommitPhaseError(fiber, fiber.return, mountError); + } + + break; + } + + case ClassComponent: { + var instance = fiber.stateNode; + invokeGuardedCallback(null, instance.componentDidMount, instance); + + if (hasCaughtError()) { + var _mountError = clearCaughtError(); + + captureCommitPhaseError(fiber, fiber.return, _mountError); + } + + break; + } + } + } +} + +function invokePassiveEffectMountInDEV(fiber) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: { + invokeGuardedCallback( + null, + commitHookEffectListMount, + null, + Passive$1 | HasEffect, + fiber + ); + + if (hasCaughtError()) { + var mountError = clearCaughtError(); + captureCommitPhaseError(fiber, fiber.return, mountError); + } + + break; + } + } + } +} + +function invokeLayoutEffectUnmountInDEV(fiber) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: { + invokeGuardedCallback( + null, + commitHookEffectListUnmount, + null, + Layout | HasEffect, + fiber, + fiber.return + ); + + if (hasCaughtError()) { + var unmountError = clearCaughtError(); + captureCommitPhaseError(fiber, fiber.return, unmountError); + } + + break; + } + + case ClassComponent: { + var instance = fiber.stateNode; + + if (typeof instance.componentWillUnmount === "function") { + invokeGuardedCallback( + null, + safelyCallComponentWillUnmount, + null, + fiber, + fiber.return, + instance + ); + + if (hasCaughtError()) { + var _unmountError = clearCaughtError(); + + captureCommitPhaseError(fiber, fiber.return, _unmountError); + } + } + + break; + } + } + } +} + +function invokePassiveEffectUnmountInDEV(fiber) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: { + invokeGuardedCallback( + null, + commitHookEffectListUnmount, + null, + Passive$1 | HasEffect, + fiber, + fiber.return + ); + + if (hasCaughtError()) { + var unmountError = clearCaughtError(); + captureCommitPhaseError(fiber, fiber.return, unmountError); + } + + break; + } + } + } +} + var COMPONENT_TYPE = 0; var HAS_PSEUDO_CLASS_TYPE = 1; var ROLE_TYPE = 2; @@ -18221,13 +18394,7 @@ var NESTED_UPDATE_LIMIT = 50; var nestedUpdateCount = 0; var rootWithNestedUpdates = null; var NESTED_PASSIVE_UPDATE_LIMIT = 50; -var nestedPassiveUpdateCount = 0; // Marks the need to reschedule pending interactions at these lanes -// during the commit phase. This enables them to be traced across components -// that spawn new work during render. E.g. hidden boundaries, suspended SSR -// hydration or SuspenseList. -// TODO: Can use a bitmask instead of an array - -var spawnedWorkDuringRender = null; // If two updates are scheduled within the same event, we should treat their +var nestedPassiveUpdateCount = 0; // If two updates are scheduled within the same event, we should treat their // event times as simultaneous, even if the actual clock time has advanced // between the first and second call. @@ -18296,7 +18463,6 @@ function requestUpdateLane(fiber) { // TODO: Move this type conversion to the event priority module. var eventLane = getCurrentEventPriority(); - return eventLane; } @@ -18356,15 +18522,12 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering (executionContext & (RenderContext | CommitContext)) === NoContext ) { - // Register pending interactions on the root to avoid losing traced interaction data. - schedulePendingInteractions(root, lane); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed + // This is a legacy edge case. The initial mount of a ReactDOM.render-ed // root inside of batchedUpdates should be synchronous, but layout updates // should be deferred until the end of the batch. - performSyncWorkOnRoot(root); } else { ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, lane); if ( executionContext === NoContext && @@ -18376,13 +18539,12 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { // without immediately flushing it. We only do this for user-initiated // updates, to preserve historical behavior of legacy mode. resetRenderTimer(); - flushSyncCallbackQueue(); + flushSyncCallbacksOnlyInLegacyMode(); } } } else { // Schedule other updates after in case the callback is sync. ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, lane); } return root; @@ -18510,11 +18672,15 @@ function ensureRootIsScheduled(root, currentTime) { if (newCallbackPriority === SyncLane) { // Special case: Sync React callbacks are scheduled on a special // internal queue - scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); + if (root.tag === LegacyRoot) { + scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root)); + } else { + scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); + } { // Flush the queue in an Immediate task. - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue); + scheduleCallback(ImmediatePriority, flushSyncCallbacks); } newCallbackNode = null; @@ -18588,20 +18754,17 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (lanes === NoLanes) { // Defensive coding. This is never expected to happen. return null; - } // TODO: We only check `didTimeout` defensively, to account for a Scheduler + } // We disable time-slicing in some cases: if the work has been CPU-bound + // for too long ("expired" work, to prevent starvation), or we're in + // sync-updates-by-default mode. + // TODO: We only check `didTimeout` defensively, to account for a Scheduler // bug we're still investigating. Once the bug in Scheduler is fixed, // we can remove this, since we track expiration ourselves. - if (didTimeout) { - // Something expired. Flush synchronously until there's no expired - // work left. - markRootExpired(root, lanes); // This will schedule a synchronous callback. - - ensureRootIsScheduled(root, now()); - return null; - } - - var exitStatus = renderRootConcurrent(root, lanes); + var exitStatus = + shouldTimeSlice(root, lanes) && !didTimeout + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes); if (exitStatus !== RootIncomplete) { if (exitStatus === RootErrored) { @@ -18792,16 +18955,7 @@ function performSyncWorkOnRoot(root) { flushPassiveEffects(); var lanes = getNextLanes(root, NoLanes); - if (includesSomeLane(lanes, SyncLane)) { - if ( - root === workInProgressRoot && - includesSomeLane(lanes, workInProgressRootRenderLanes) - ) { - // There's a partial tree, and at least one of its lanes has expired. Finish - // rendering it before rendering the rest of the expired work. - lanes = workInProgressRootRenderLanes; - } - } else { + if (!includesSomeLane(lanes, SyncLane)) { // There's no remaining sync work left. ensureRootIsScheduled(root, now()); return null; @@ -18846,15 +19000,12 @@ function performSyncWorkOnRoot(root) { var finishedWork = root.current.alternate; root.finishedWork = finishedWork; root.finishedLanes = lanes; - - { - commitRoot(root); - } // Before exiting, make sure there's a callback scheduled for the next + commitRoot(root); // Before exiting, make sure there's a callback scheduled for the next // pending level. ensureRootIsScheduled(root, now()); return null; -} // TODO: Do we still need this API? I think we can delete it. Was only used +} function batchedUpdates$1(fn, a) { var prevExecutionContext = executionContext; executionContext |= BatchedContext; @@ -18862,12 +19013,12 @@ function batchedUpdates$1(fn, a) { try { return fn(a); } finally { - executionContext = prevExecutionContext; + executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer + // most batchedUpdates-like method. if (executionContext === NoContext) { - // Flush the immediate callbacks that were scheduled during this batch resetRenderTimer(); - flushSyncCallbackQueue(); + flushSyncCallbacksOnlyInLegacyMode(); } } } @@ -18894,7 +19045,7 @@ function flushSync(fn, a) { // the stack. if ((executionContext & (RenderContext | CommitContext)) === NoContext) { - flushSyncCallbackQueue(); + flushSyncCallbacks(); } else { { error( @@ -18951,10 +19102,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; enqueueInterleavedUpdates(); - { - spawnedWorkDuringRender = null; - } - { ReactStrictModeWarnings.discardPendingWarnings(); } @@ -19043,20 +19190,6 @@ function popDispatcher(prevDispatcher) { ReactCurrentDispatcher$2.current = prevDispatcher; } -function pushInteractions(root) { - { - var prevInteractions = tracing.__interactionsRef.current; - tracing.__interactionsRef.current = root.memoizedInteractions; - return prevInteractions; - } -} - -function popInteractions(prevInteractions) { - { - tracing.__interactionsRef.current = prevInteractions; - } -} - function markCommitTimeOfFallback() { globalMostRecentFallbackTime = now(); } @@ -19116,11 +19249,8 @@ function renderRootSync(root, lanes) { if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { prepareFreshStack(root, lanes); - startWorkOnPendingInteractions(root, lanes); } - var prevInteractions = pushInteractions(root); - do { try { workLoopSync(); @@ -19131,11 +19261,6 @@ function renderRootSync(root, lanes) { } while (true); resetContextDependencies(); - - { - popInteractions(prevInteractions); - } - executionContext = prevExecutionContext; popDispatcher(prevDispatcher); @@ -19171,11 +19296,8 @@ function renderRootConcurrent(root, lanes) { if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { resetRenderTimer(); prepareFreshStack(root, lanes); - startWorkOnPendingInteractions(root, lanes); } - var prevInteractions = pushInteractions(root); - do { try { workLoopConcurrent(); @@ -19186,11 +19308,6 @@ function renderRootConcurrent(root, lanes) { } while (true); resetContextDependencies(); - - { - popInteractions(prevInteractions); - } - popDispatcher(prevDispatcher); executionContext = prevExecutionContext; @@ -19441,8 +19558,7 @@ function commitRootImpl(root, renderPriorityLevel) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(DiscreteEventPriority); var prevExecutionContext = executionContext; - executionContext |= CommitContext; - var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles + executionContext |= CommitContext; // Reset this to null before calling lifecycles ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass // of the effect list for each phase: all mutation effects come before all @@ -19475,11 +19591,6 @@ function commitRootImpl(root, renderPriorityLevel) { // opportunity to paint. requestPaint(); - - { - popInteractions(prevInteractions); - } - executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value. setCurrentUpdatePriority(previousPriority); @@ -19507,24 +19618,7 @@ function commitRootImpl(root, renderPriorityLevel) { remainingLanes = root.pendingLanes; // Check if there's remaining work on this root - if (remainingLanes !== NoLanes) { - { - if (spawnedWorkDuringRender !== null) { - var expirationTimes = spawnedWorkDuringRender; - spawnedWorkDuringRender = null; - - for (var i = 0; i < expirationTimes.length; i++) { - scheduleInteractions( - root, - expirationTimes[i], - root.memoizedInteractions - ); - } - } - - schedulePendingInteractions(root, remainingLanes); - } - } else { + if (remainingLanes === NoLanes) { // If there's no remaining work, we can clear the set of already failed // error boundaries. legacyErrorBoundariesThatAlreadyFailed = null; @@ -19532,11 +19626,7 @@ function commitRootImpl(root, renderPriorityLevel) { { if (!rootDidHavePassiveEffects) { - // If there are no passive effects, then we can complete the pending interactions. - // Otherwise, we'll wait until after the passive effects are flushed. - // Wait to do this until after remaining work has been scheduled, - // so that we don't prematurely signal complete for interactions when there's e.g. hidden work. - finishPendingInteractions(root, lanes); + commitDoubleInvokeEffectsInDEV(root.current, false); } } @@ -19587,7 +19677,7 @@ function commitRootImpl(root, renderPriorityLevel) { flushPassiveEffects(); } // If layout work was scheduled, flush it now. - flushSyncCallbackQueue(); + flushSyncCallbacks(); return null; } @@ -19624,7 +19714,6 @@ function flushPassiveEffectsImpl() { } var root = rootWithPendingPassiveEffects; - var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects. // Figure out why and fix it. It's not causing any known issues (probably // because it's only used for profiling), but it's a refactor hazard. @@ -19641,21 +19730,19 @@ function flushPassiveEffectsImpl() { var prevExecutionContext = executionContext; executionContext |= CommitContext; - var prevInteractions = pushInteractions(root); commitPassiveUnmountEffects(root.current); commitPassiveMountEffects(root, root.current); // TODO: Move to commitPassiveMountEffects { - popInteractions(prevInteractions); - finishPendingInteractions(root, lanes); + isFlushingPassiveEffects = false; } { - isFlushingPassiveEffects = false; + commitDoubleInvokeEffectsInDEV(root.current, true); } executionContext = prevExecutionContext; - flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this + flushSyncCallbacks(); // If additional passive effects were scheduled, increment a counter. If this // exceeds the limit, we'll fire a warning. nestedPassiveUpdateCount = @@ -19699,7 +19786,6 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { if (root !== null) { markRootUpdated(root, SyncLane, eventTime); ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, SyncLane); } } @@ -19739,7 +19825,6 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { if (root !== null) { markRootUpdated(root, SyncLane, eventTime); ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, SyncLane); } return; @@ -19807,7 +19892,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { } ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, pingedLanes); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -19827,7 +19911,6 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { if (root !== null) { markRootUpdated(root, retryLane, eventTime); ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, retryLane); } } function resolveRetryWakeable(boundaryFiber, wakeable) { @@ -19908,6 +19991,63 @@ function flushRenderPhaseStrictModeWarningsInDEV() { } } +function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { + { + // TODO (StrictEffects) Should we set a marker on the root if it contains strict effects + // so we don't traverse unnecessarily? similar to subtreeFlags but just at the root level. + // Maybe not a big deal since this is DEV only behavior. + setCurrentFiber(fiber); + invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV); + + if (hasPassiveEffects) { + invokeEffectsInDev( + fiber, + MountPassiveDev, + invokePassiveEffectUnmountInDEV + ); + } + + invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV); + + if (hasPassiveEffects) { + invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV); + } + + resetCurrentFiber(); + } +} + +function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + var current = firstChild; + var subtreeRoot = null; + + while (current !== null) { + var primarySubtreeFlag = current.subtreeFlags & fiberFlags; + + if ( + current !== subtreeRoot && + current.child !== null && + primarySubtreeFlag !== NoFlags + ) { + current = current.child; + } else { + if ((current.flags & fiberFlags) !== NoFlags) { + invokeEffectFn(current); + } + + if (current.sibling !== null) { + current = current.sibling; + } else { + current = subtreeRoot = current.return; + } + } + } + } +} + var didWarnStateUpdateForNotYetMountedComponent = null; function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { @@ -20213,144 +20353,6 @@ function warnIfUnmockedScheduler(fiber) { } } } -} - -function computeThreadID(root, lane) { - // Interaction threads are unique per root and expiration time. - // NOTE: Intentionally unsound cast. All that matters is that it's a number - // and it represents a batch of work. Could make a helper function instead, - // but meh this is fine for now. - return lane * 1000 + root.interactionThreadID; -} - -function markSpawnedWork(lane) { - if (spawnedWorkDuringRender === null) { - spawnedWorkDuringRender = [lane]; - } else { - spawnedWorkDuringRender.push(lane); - } -} - -function scheduleInteractions(root, lane, interactions) { - if (interactions.size > 0) { - var pendingInteractionMap = root.pendingInteractionMap; - var pendingInteractions = pendingInteractionMap.get(lane); - - if (pendingInteractions != null) { - interactions.forEach(function(interaction) { - if (!pendingInteractions.has(interaction)) { - // Update the pending async work count for previously unscheduled interaction. - interaction.__count++; - } - - pendingInteractions.add(interaction); - }); - } else { - pendingInteractionMap.set(lane, new Set(interactions)); // Update the pending async work count for the current interactions. - - interactions.forEach(function(interaction) { - interaction.__count++; - }); - } - - var subscriber = tracing.__subscriberRef.current; - - if (subscriber !== null) { - var threadID = computeThreadID(root, lane); - subscriber.onWorkScheduled(interactions, threadID); - } - } -} - -function schedulePendingInteractions(root, lane) { - scheduleInteractions(root, lane, tracing.__interactionsRef.current); -} - -function startWorkOnPendingInteractions(root, lanes) { - // we can accurately attribute time spent working on it, And so that cascading - // work triggered during the render phase will be associated with it. - - var interactions = new Set(); - root.pendingInteractionMap.forEach(function( - scheduledInteractions, - scheduledLane - ) { - if (includesSomeLane(lanes, scheduledLane)) { - scheduledInteractions.forEach(function(interaction) { - return interactions.add(interaction); - }); - } - }); // Store the current set of interactions on the FiberRoot for a few reasons: - // We can re-use it in hot functions like performConcurrentWorkOnRoot() - // without having to recalculate it. We will also use it in commitWork() to - // pass to any Profiler onRender() hooks. This also provides DevTools with a - // way to access it when the onCommitRoot() hook is called. - - root.memoizedInteractions = interactions; - - if (interactions.size > 0) { - var subscriber = tracing.__subscriberRef.current; - - if (subscriber !== null) { - var threadID = computeThreadID(root, lanes); - - try { - subscriber.onWorkStarted(interactions, threadID); - } catch (error) { - // If the subscriber throws, rethrow it in a separate task - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } - } - } -} - -function finishPendingInteractions(root, committedLanes) { - var remainingLanesAfterCommit = root.pendingLanes; - var subscriber; - - try { - subscriber = tracing.__subscriberRef.current; - - if (subscriber !== null && root.memoizedInteractions.size > 0) { - // FIXME: More than one lane can finish in a single commit. - var threadID = computeThreadID(root, committedLanes); - subscriber.onWorkStopped(root.memoizedInteractions, threadID); - } - } catch (error) { - // If the subscriber throws, rethrow it in a separate task - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } finally { - // Clear completed interactions from the pending Map. - // Unless the render was suspended or cascading work was scheduled, - // In which case– leave pending interactions until the subsequent render. - var pendingInteractionMap = root.pendingInteractionMap; - pendingInteractionMap.forEach(function(scheduledInteractions, lane) { - // Only decrement the pending interaction count if we're done. - // If there's still work at the current priority, - // That indicates that we are waiting for suspense data. - if (!includesSomeLane(remainingLanesAfterCommit, lane)) { - pendingInteractionMap.delete(lane); - scheduledInteractions.forEach(function(interaction) { - interaction.__count--; - - if (subscriber !== null && interaction.__count === 0) { - try { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } catch (error) { - // If the subscriber throws, rethrow it in a separate task - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } - } - }); - } - }); - } } // `act` testing API function shouldForceFlushFallbacksInDEV() { @@ -21105,6 +21107,12 @@ function createHostRootFiber(tag, strictModeLevelOverride) { if (strictModeLevelOverride >= 1) { mode |= StrictLegacyMode; } + + { + if (strictModeLevelOverride >= 2) { + mode |= StrictEffectsMode; + } + } } else { { mode |= StrictLegacyMode; @@ -21170,6 +21178,12 @@ function createFiberFromTypeAndProps( mode |= StrictLegacyMode; } + { + if (level >= 2) { + mode |= StrictEffectsMode; + } + } + break; case REACT_PROFILER_TYPE: @@ -21437,17 +21451,12 @@ function FiberRootNode(containerInfo, tag, hydrate) { this.pendingLanes = NoLanes; this.suspendedLanes = NoLanes; this.pingedLanes = NoLanes; + this.expiredLanes = NoLanes; this.mutableReadLanes = NoLanes; this.finishedLanes = NoLanes; this.entangledLanes = NoLanes; this.entanglements = createLaneMap(NoLanes); - { - this.interactionThreadID = tracing.unstable_getThreadID(); - this.memoizedInteractions = new Set(); - this.pendingInteractionMap = new Map(); - } - { switch (tag) { case ConcurrentRoot: diff --git a/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 1232dd04976f92..34af76c10eeb87 100644 --- a/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<9877a9ca3ef854c84fe796f0864c7089>> + * @generated SignedSource<<735771ab42202f7510ef3c1af459aa07>> */ "use strict"; @@ -930,7 +930,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_214 = { +var injectedNamesToPlugins$jscomp$inline_216 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -965,34 +965,34 @@ var injectedNamesToPlugins$jscomp$inline_214 = { } } }, - isOrderingDirty$jscomp$inline_215 = !1, - pluginName$jscomp$inline_216; -for (pluginName$jscomp$inline_216 in injectedNamesToPlugins$jscomp$inline_214) + isOrderingDirty$jscomp$inline_217 = !1, + pluginName$jscomp$inline_218; +for (pluginName$jscomp$inline_218 in injectedNamesToPlugins$jscomp$inline_216) if ( - injectedNamesToPlugins$jscomp$inline_214.hasOwnProperty( - pluginName$jscomp$inline_216 + injectedNamesToPlugins$jscomp$inline_216.hasOwnProperty( + pluginName$jscomp$inline_218 ) ) { - var pluginModule$jscomp$inline_217 = - injectedNamesToPlugins$jscomp$inline_214[pluginName$jscomp$inline_216]; + var pluginModule$jscomp$inline_219 = + injectedNamesToPlugins$jscomp$inline_216[pluginName$jscomp$inline_218]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_216) || - namesToPlugins[pluginName$jscomp$inline_216] !== - pluginModule$jscomp$inline_217 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_218) || + namesToPlugins[pluginName$jscomp$inline_218] !== + pluginModule$jscomp$inline_219 ) { - if (namesToPlugins[pluginName$jscomp$inline_216]) + if (namesToPlugins[pluginName$jscomp$inline_218]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_216 + + pluginName$jscomp$inline_218 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_216 - ] = pluginModule$jscomp$inline_217; - isOrderingDirty$jscomp$inline_215 = !0; + pluginName$jscomp$inline_218 + ] = pluginModule$jscomp$inline_219; + isOrderingDirty$jscomp$inline_217 = !0; } } -isOrderingDirty$jscomp$inline_215 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_217 && recomputePluginOrdering(); function getInstanceFromInstance(instanceHandle) { return instanceHandle; } @@ -1762,16 +1762,12 @@ function markRootUpdated(root, updateLane, eventTime) { updateLane = 31 - clz32(updateLane); root[updateLane] = eventTime; } -function markRootExpired(root, expiredLanes) { - root.entanglements[0] |= expiredLanes; - root.entangledLanes |= 1; - root.pendingLanes |= 1; -} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.expiredLanes &= remainingLanes; root.mutableReadLanes &= remainingLanes; root.entangledLanes &= remainingLanes; remainingLanes = root.entanglements; @@ -2028,8 +2024,9 @@ function invalidateContextProvider(workInProgress, type, didChange) { push(didPerformWorkStackCursor, didChange); } var syncQueue = null, + includesLegacySyncCallbacks = !1, isFlushingSyncQueue = !1; -function flushSyncCallbackQueue() { +function flushSyncCallbacks() { if (!isFlushingSyncQueue && null !== syncQueue) { isFlushingSyncQueue = !0; var i = 0, @@ -2042,9 +2039,10 @@ function flushSyncCallbackQueue() { while (null !== callback); } syncQueue = null; + includesLegacySyncCallbacks = !1; } catch (error) { throw (null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)), - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue), + scheduleCallback(ImmediatePriority, flushSyncCallbacks), error); } finally { (currentUpdatePriority = previousUpdatePriority), @@ -6010,7 +6008,7 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { 0 === executionContext && 0 === (fiber.mode & 1) && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncCallbackQueue())) + includesLegacySyncCallbacks && flushSyncCallbacks())) : ensureRootIsScheduled(root, eventTime); return root; } @@ -6033,8 +6031,7 @@ function ensureRootIsScheduled(root, currentTime) { suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes, expirationTimes = root.expirationTimes, - lanes = root.pendingLanes, - expiredLanes = 0; + lanes = root.pendingLanes; 0 < lanes; ) { @@ -6044,10 +6041,9 @@ function ensureRootIsScheduled(root, currentTime) { if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) expirationTimes[index$5] = computeExpirationTime(lane, currentTime); - } else expirationTime <= currentTime && (expiredLanes |= lane); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } - 0 !== expiredLanes && markRootExpired(root, expiredLanes); suspendedLanes = getNextLanes( root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0 @@ -6062,11 +6058,17 @@ function ensureRootIsScheduled(root, currentTime) { ) { null != existingCallbackNode && cancelCallback(existingCallbackNode); if (1 === currentTime) - (existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), - null === syncQueue - ? (syncQueue = [existingCallbackNode]) - : syncQueue.push(existingCallbackNode), - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue), + 0 === root.tag + ? ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), + (includesLegacySyncCallbacks = !0), + null === syncQueue + ? (syncQueue = [existingCallbackNode]) + : syncQueue.push(existingCallbackNode)) + : ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), + null === syncQueue + ? (syncQueue = [existingCallbackNode]) + : syncQueue.push(existingCallbackNode)), + scheduleCallback(ImmediatePriority, flushSyncCallbacks), (existingCallbackNode = null); else { switch (lanesToEventPriority(suspendedLanes)) { @@ -6107,44 +6109,43 @@ function performConcurrentWorkOnRoot(root, didTimeout) { root === workInProgressRoot ? workInProgressRootRenderLanes : 0 ); if (0 === lanes) return null; - if (didTimeout) - return ( - markRootExpired(root, lanes), ensureRootIsScheduled(root, now()), null - ); - didTimeout = lanes; - var prevExecutionContext = executionContext; - executionContext |= 8; - var prevDispatcher = pushDispatcher(); - if ( - workInProgressRoot !== root || - workInProgressRootRenderLanes !== didTimeout - ) - (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, didTimeout); - do - try { - workLoopConcurrent(); - break; - } catch (thrownValue) { - handleError(root, thrownValue); - } - while (1); - resetContextDependencies(); - ReactCurrentDispatcher$2.current = prevDispatcher; - executionContext = prevExecutionContext; - null !== workInProgress - ? (didTimeout = 0) - : ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - (didTimeout = workInProgressRootExitStatus)); + var JSCompiler_inline_result = 0 !== (lanes & root.expiredLanes) ? !1 : !0; + if (JSCompiler_inline_result && !didTimeout) { + didTimeout = lanes; + JSCompiler_inline_result = executionContext; + executionContext |= 8; + var prevDispatcher = pushDispatcher(); + if ( + workInProgressRoot !== root || + workInProgressRootRenderLanes !== didTimeout + ) + (workInProgressRootRenderTargetTime = now() + 500), + prepareFreshStack(root, didTimeout); + do + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + while (1); + resetContextDependencies(); + ReactCurrentDispatcher$2.current = prevDispatcher; + executionContext = JSCompiler_inline_result; + null !== workInProgress + ? (didTimeout = 0) + : ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + (didTimeout = workInProgressRootExitStatus)); + } else didTimeout = renderRootSync(root, lanes); if (0 !== didTimeout) { 2 === didTimeout && ((executionContext |= 32), root.hydrate && ((root.hydrate = !1), shim(root.containerInfo)), - (prevExecutionContext = getLanesToRetrySynchronouslyOnError(root)), - 0 !== prevExecutionContext && - ((lanes = prevExecutionContext), - (didTimeout = renderRootSync(root, prevExecutionContext)))); + (JSCompiler_inline_result = getLanesToRetrySynchronouslyOnError(root)), + 0 !== JSCompiler_inline_result && + ((lanes = JSCompiler_inline_result), + (didTimeout = renderRootSync(root, JSCompiler_inline_result)))); if (1 === didTimeout) throw ((originalCallbackNode = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -6168,10 +6169,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { 10 < didTimeout) ) { if (0 !== getNextLanes(root, 0)) break; - prevExecutionContext = root.suspendedLanes; - if ((prevExecutionContext & lanes) !== lanes) { + JSCompiler_inline_result = root.suspendedLanes; + if ((JSCompiler_inline_result & lanes) !== lanes) { requestEventTime(); - root.pingedLanes |= root.suspendedLanes & prevExecutionContext; + root.pingedLanes |= root.suspendedLanes & JSCompiler_inline_result; break; } root.timeoutHandle = scheduleTimeout( @@ -6186,14 +6187,15 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended$1(root, lanes); if ((lanes & 4194240) === lanes) break; didTimeout = root.eventTimes; - for (prevExecutionContext = -1; 0 < lanes; ) { + for (JSCompiler_inline_result = -1; 0 < lanes; ) { var index$4 = 31 - clz32(lanes); prevDispatcher = 1 << index$4; index$4 = didTimeout[index$4]; - index$4 > prevExecutionContext && (prevExecutionContext = index$4); + index$4 > JSCompiler_inline_result && + (JSCompiler_inline_result = index$4); lanes &= ~prevDispatcher; } - lanes = prevExecutionContext; + lanes = JSCompiler_inline_result; lanes = now() - lanes; lanes = (120 > lanes @@ -6247,11 +6249,7 @@ function performSyncWorkOnRoot(root) { throw Error("Should not already be working."); flushPassiveEffects(); var lanes = getNextLanes(root, 0); - if (0 !== (lanes & 1)) - root === workInProgressRoot && - 0 !== (lanes & workInProgressRootRenderLanes) && - (lanes = workInProgressRootRenderLanes); - else return ensureRootIsScheduled(root, now()), null; + if (0 === (lanes & 1)) return ensureRootIsScheduled(root, now()), null; var exitStatus = renderRootSync(root, lanes); if (0 !== root.tag && 2 === exitStatus) { executionContext |= 32; @@ -6690,7 +6688,7 @@ function commitRootImpl(root, renderPriorityLevel) { 0 !== (pendingPassiveEffectsLanes & 1) && 0 !== root.tag && flushPassiveEffects(); - flushSyncCallbackQueue(); + flushSyncCallbacks(); return null; } function flushPassiveEffects() { @@ -6820,7 +6818,7 @@ function flushPassiveEffects() { } } executionContext = prevExecutionContext; - flushSyncCallbackQueue(); + flushSyncCallbacks(); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -7630,7 +7628,7 @@ function FiberRootNode(containerInfo, tag, hydrate) { this.callbackPriority = 0; this.eventTimes = createLaneMap(0); this.expirationTimes = createLaneMap(-1); - this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; + this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; this.entanglements = createLaneMap(0); } function createPortal(children, containerInfo, implementation) { @@ -7742,11 +7740,11 @@ batchedUpdatesImpl = function(fn, a) { (executionContext = prevExecutionContext), 0 === executionContext && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncCallbackQueue()); + includesLegacySyncCallbacks && flushSyncCallbacks()); } }; var roots = new Map(), - devToolsConfig$jscomp$inline_934 = { + devToolsConfig$jscomp$inline_940 = { findFiberByHostInstance: getInstanceFromInstance, bundleType: 0, version: "17.0.3", @@ -7764,11 +7762,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1168 = { - bundleType: devToolsConfig$jscomp$inline_934.bundleType, - version: devToolsConfig$jscomp$inline_934.version, - rendererPackageName: devToolsConfig$jscomp$inline_934.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_934.rendererConfig, +var internals$jscomp$inline_1178 = { + bundleType: devToolsConfig$jscomp$inline_940.bundleType, + version: devToolsConfig$jscomp$inline_940.version, + rendererPackageName: devToolsConfig$jscomp$inline_940.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_940.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -7783,7 +7781,7 @@ var internals$jscomp$inline_1168 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_934.findFiberByHostInstance || + devToolsConfig$jscomp$inline_940.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, @@ -7793,16 +7791,16 @@ var internals$jscomp$inline_1168 = { reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1169 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1179 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1169.isDisabled && - hook$jscomp$inline_1169.supportsFiber + !hook$jscomp$inline_1179.isDisabled && + hook$jscomp$inline_1179.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1169.inject( - internals$jscomp$inline_1168 + (rendererID = hook$jscomp$inline_1179.inject( + internals$jscomp$inline_1178 )), - (injectedHook = hook$jscomp$inline_1169); + (injectedHook = hook$jscomp$inline_1179); } catch (err) {} } exports.createPortal = function(children, containerTag) { diff --git a/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index 3a76a5a766c0f3..e2265fe94736a8 100644 --- a/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,15 +7,14 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<7da8cf3208220ac6e1e05d089bd22e17>> + * @generated SignedSource<<50dd5aba6b78b155d6d752eecdf11d7a>> */ "use strict"; require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"), React = require("react"), - Scheduler = require("scheduler"), - tracing = require("scheduler/tracing"); + Scheduler = require("scheduler"); function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { var funcArgs = Array.prototype.slice.call(arguments, 3); try { @@ -931,7 +930,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_220 = { +var injectedNamesToPlugins$jscomp$inline_221 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -966,34 +965,34 @@ var injectedNamesToPlugins$jscomp$inline_220 = { } } }, - isOrderingDirty$jscomp$inline_221 = !1, - pluginName$jscomp$inline_222; -for (pluginName$jscomp$inline_222 in injectedNamesToPlugins$jscomp$inline_220) + isOrderingDirty$jscomp$inline_222 = !1, + pluginName$jscomp$inline_223; +for (pluginName$jscomp$inline_223 in injectedNamesToPlugins$jscomp$inline_221) if ( - injectedNamesToPlugins$jscomp$inline_220.hasOwnProperty( - pluginName$jscomp$inline_222 + injectedNamesToPlugins$jscomp$inline_221.hasOwnProperty( + pluginName$jscomp$inline_223 ) ) { - var pluginModule$jscomp$inline_223 = - injectedNamesToPlugins$jscomp$inline_220[pluginName$jscomp$inline_222]; + var pluginModule$jscomp$inline_224 = + injectedNamesToPlugins$jscomp$inline_221[pluginName$jscomp$inline_223]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_222) || - namesToPlugins[pluginName$jscomp$inline_222] !== - pluginModule$jscomp$inline_223 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_223) || + namesToPlugins[pluginName$jscomp$inline_223] !== + pluginModule$jscomp$inline_224 ) { - if (namesToPlugins[pluginName$jscomp$inline_222]) + if (namesToPlugins[pluginName$jscomp$inline_223]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_222 + + pluginName$jscomp$inline_223 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_222 - ] = pluginModule$jscomp$inline_223; - isOrderingDirty$jscomp$inline_221 = !0; + pluginName$jscomp$inline_223 + ] = pluginModule$jscomp$inline_224; + isOrderingDirty$jscomp$inline_222 = !0; } } -isOrderingDirty$jscomp$inline_221 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_222 && recomputePluginOrdering(); function getInstanceFromInstance(instanceHandle) { return instanceHandle; } @@ -1602,15 +1601,8 @@ var scheduleCallback = Scheduler.unstable_scheduleCallback, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority; -if ( - null == tracing.__interactionsRef || - null == tracing.__interactionsRef.current -) - throw Error( - "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" - ); -var rendererID = null, + IdlePriority = Scheduler.unstable_IdlePriority, + rendererID = null, injectedHook = null, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; function onCommitRoot(root, eventPriority) { @@ -1788,16 +1780,12 @@ function markRootUpdated(root, updateLane, eventTime) { updateLane = 31 - clz32(updateLane); root[updateLane] = eventTime; } -function markRootExpired(root, expiredLanes) { - root.entanglements[0] |= expiredLanes; - root.entangledLanes |= 1; - root.pendingLanes |= 1; -} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.expiredLanes &= remainingLanes; root.mutableReadLanes &= remainingLanes; root.entangledLanes &= remainingLanes; remainingLanes = root.entanglements; @@ -2054,8 +2042,9 @@ function invalidateContextProvider(workInProgress, type, didChange) { push(didPerformWorkStackCursor, didChange); } var syncQueue = null, + includesLegacySyncCallbacks = !1, isFlushingSyncQueue = !1; -function flushSyncCallbackQueue() { +function flushSyncCallbacks() { if (!isFlushingSyncQueue && null !== syncQueue) { isFlushingSyncQueue = !0; var i = 0, @@ -2068,9 +2057,10 @@ function flushSyncCallbackQueue() { while (null !== callback); } syncQueue = null; + includesLegacySyncCallbacks = !1; } catch (error) { throw (null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)), - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue), + scheduleCallback(ImmediatePriority, flushSyncCallbacks), error); } finally { (currentUpdatePriority = previousUpdatePriority), @@ -4186,7 +4176,6 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) { null !== prevState ? prevState.baseLanes | renderLanes : renderLanes), - markSpawnedWork(1073741824), (workInProgress.lanes = workInProgress.childLanes = 1073741824), (workInProgress.memoizedState = { baseLanes: current, @@ -4560,7 +4549,6 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - markSpawnedWork(4194304), current ); renderLanes = createFiberFromOffscreen( @@ -5394,8 +5382,7 @@ function completeWork(current, workInProgress, renderLanes) { ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(type, !1), - (workInProgress.lanes = 4194304), - markSpawnedWork(4194304)); + (workInProgress.lanes = 4194304)); } else { if (!newProps) @@ -5422,8 +5409,7 @@ function completeWork(current, workInProgress, renderLanes) { ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(type, !1), - (workInProgress.lanes = 4194304), - markSpawnedWork(4194304)); + (workInProgress.lanes = 4194304)); type.isBackwards ? ((updatePayload.sibling = workInProgress.child), (workInProgress.child = updatePayload)) @@ -5799,10 +5785,7 @@ function attachSuspenseRetryListeners(finishedWork) { wakeables.forEach(function(wakeable) { var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); retryCache.has(wakeable) || - (!0 !== wakeable.__reactDoNotTraceInteractions && - (retry = tracing.unstable_wrap(retry)), - retryCache.add(wakeable), - wakeable.then(retry, retry)); + (retryCache.add(wakeable), wakeable.then(retry, retry)); }); } } @@ -5945,36 +5928,35 @@ function commitMutationEffects(root, firstChild) { } } } -function commitLayoutEffects(finishedWork, root) { +function commitLayoutEffects(finishedWork) { for (nextEffect = finishedWork; null !== nextEffect; ) { var fiber = nextEffect, firstChild = fiber.child; if (0 !== (fiber.subtreeFlags & 324) && null !== firstChild) (firstChild.return = fiber), (nextEffect = firstChild); else - for (fiber = finishedWork, firstChild = root; null !== nextEffect; ) { - var fiber$jscomp$0 = nextEffect; - if (0 !== (fiber$jscomp$0.flags & 324)) { - var current = fiber$jscomp$0.alternate; + for (fiber = finishedWork; null !== nextEffect; ) { + firstChild = nextEffect; + if (0 !== (firstChild.flags & 324)) { + var current = firstChild.alternate; try { - var finishedRoot = firstChild; - if (0 !== (fiber$jscomp$0.flags & 68)) - switch (fiber$jscomp$0.tag) { + if (0 !== (firstChild.flags & 68)) + switch (firstChild.tag) { case 0: case 11: case 15: - commitHookEffectListMount(3, fiber$jscomp$0); + commitHookEffectListMount(3, firstChild); break; case 1: - var instance = fiber$jscomp$0.stateNode; - if (fiber$jscomp$0.flags & 4) + var instance = firstChild.stateNode; + if (firstChild.flags & 4) if (null === current) instance.componentDidMount(); else { var prevProps = - fiber$jscomp$0.elementType === fiber$jscomp$0.type + firstChild.elementType === firstChild.type ? current.memoizedProps : resolveDefaultProps( - fiber$jscomp$0.type, + firstChild.type, current.memoizedProps ); instance.componentDidUpdate( @@ -5983,50 +5965,44 @@ function commitLayoutEffects(finishedWork, root) { instance.__reactInternalSnapshotBeforeUpdate ); } - var updateQueue = fiber$jscomp$0.updateQueue; + var updateQueue = firstChild.updateQueue; null !== updateQueue && - commitUpdateQueue(fiber$jscomp$0, updateQueue, instance); + commitUpdateQueue(firstChild, updateQueue, instance); break; case 3: - var updateQueue$87 = fiber$jscomp$0.updateQueue; + var updateQueue$87 = firstChild.updateQueue; if (null !== updateQueue$87) { - finishedRoot = null; - if (null !== fiber$jscomp$0.child) - switch (fiber$jscomp$0.child.tag) { + var instance$88 = null; + if (null !== firstChild.child) + switch (firstChild.child.tag) { case 5: - finishedRoot = - fiber$jscomp$0.child.stateNode.canonical; + instance$88 = firstChild.child.stateNode.canonical; break; case 1: - finishedRoot = fiber$jscomp$0.child.stateNode; + instance$88 = firstChild.child.stateNode; } - commitUpdateQueue( - fiber$jscomp$0, - updateQueue$87, - finishedRoot - ); + commitUpdateQueue(firstChild, updateQueue$87, instance$88); } break; case 5: - null === current && fiber$jscomp$0.flags & 4 && shim(); + null === current && firstChild.flags & 4 && shim(); break; case 6: break; case 4: break; case 12: - var onRender = fiber$jscomp$0.memoizedProps.onRender, - commitTime$90 = commitTime; + var onRender = firstChild.memoizedProps.onRender; + instance$88 = commitTime; current = null === current ? "mount" : "update"; "function" === typeof onRender && onRender( - fiber$jscomp$0.memoizedProps.id, + firstChild.memoizedProps.id, current, - fiber$jscomp$0.actualDuration, - fiber$jscomp$0.treeBaseDuration, - fiber$jscomp$0.actualStartTime, - commitTime$90, - finishedRoot.memoizedInteractions + firstChild.actualDuration, + firstChild.treeBaseDuration, + firstChild.actualStartTime, + instance$88 ); break; case 13: @@ -6042,42 +6018,38 @@ function commitLayoutEffects(finishedWork, root) { "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." ); } - if (fiber$jscomp$0.flags & 256) { - finishedRoot = void 0; - var ref = fiber$jscomp$0.ref; + if (firstChild.flags & 256) { + instance$88 = void 0; + var ref = firstChild.ref; if (null !== ref) { - var instance$jscomp$0 = fiber$jscomp$0.stateNode; - switch (fiber$jscomp$0.tag) { + var instance$jscomp$0 = firstChild.stateNode; + switch (firstChild.tag) { case 5: - finishedRoot = instance$jscomp$0.canonical; + instance$88 = instance$jscomp$0.canonical; break; default: - finishedRoot = instance$jscomp$0; + instance$88 = instance$jscomp$0; } "function" === typeof ref - ? ref(finishedRoot) - : (ref.current = finishedRoot); + ? ref(instance$88) + : (ref.current = instance$88); } } } catch (error) { - captureCommitPhaseError( - fiber$jscomp$0, - fiber$jscomp$0.return, - error - ); + captureCommitPhaseError(firstChild, firstChild.return, error); } } - if (fiber$jscomp$0 === fiber) { + if (firstChild === fiber) { nextEffect = null; break; } - finishedRoot = fiber$jscomp$0.sibling; - if (null !== finishedRoot) { - finishedRoot.return = fiber$jscomp$0.return; - nextEffect = finishedRoot; + instance$88 = firstChild.sibling; + if (null !== instance$88) { + instance$88.return = firstChild.return; + nextEffect = instance$88; break; } - nextEffect = fiber$jscomp$0.return; + nextEffect = firstChild.return; } } } @@ -6106,7 +6078,6 @@ var ceil = Math.ceil, pendingPassiveEffectsLanes = 0, nestedUpdateCount = 0, rootWithNestedUpdates = null, - spawnedWorkDuringRender = null, currentEventTime = -1, currentEventTransitionLane = 0; function requestEventTime() { @@ -6146,15 +6117,13 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { markRootSuspended$1(root, workInProgressRootRenderLanes)); 1 === lane ? 0 !== (executionContext & 4) && 0 === (executionContext & 24) - ? (schedulePendingInteractions(root, lane), performSyncWorkOnRoot(root)) + ? performSyncWorkOnRoot(root) : (ensureRootIsScheduled(root, eventTime), - schedulePendingInteractions(root, lane), 0 === executionContext && 0 === (fiber.mode & 1) && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncCallbackQueue())) - : (ensureRootIsScheduled(root, eventTime), - schedulePendingInteractions(root, lane)); + includesLegacySyncCallbacks && flushSyncCallbacks())) + : ensureRootIsScheduled(root, eventTime); return root; } function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { @@ -6176,8 +6145,7 @@ function ensureRootIsScheduled(root, currentTime) { suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes, expirationTimes = root.expirationTimes, - lanes = root.pendingLanes, - expiredLanes = 0; + lanes = root.pendingLanes; 0 < lanes; ) { @@ -6187,10 +6155,9 @@ function ensureRootIsScheduled(root, currentTime) { if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) expirationTimes[index$5] = computeExpirationTime(lane, currentTime); - } else expirationTime <= currentTime && (expiredLanes |= lane); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } - 0 !== expiredLanes && markRootExpired(root, expiredLanes); suspendedLanes = getNextLanes( root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0 @@ -6205,11 +6172,17 @@ function ensureRootIsScheduled(root, currentTime) { ) { null != existingCallbackNode && cancelCallback(existingCallbackNode); if (1 === currentTime) - (existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), - null === syncQueue - ? (syncQueue = [existingCallbackNode]) - : syncQueue.push(existingCallbackNode), - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue), + 0 === root.tag + ? ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), + (includesLegacySyncCallbacks = !0), + null === syncQueue + ? (syncQueue = [existingCallbackNode]) + : syncQueue.push(existingCallbackNode)) + : ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), + null === syncQueue + ? (syncQueue = [existingCallbackNode]) + : syncQueue.push(existingCallbackNode)), + scheduleCallback(ImmediatePriority, flushSyncCallbacks), (existingCallbackNode = null); else { switch (lanesToEventPriority(suspendedLanes)) { @@ -6250,47 +6223,43 @@ function performConcurrentWorkOnRoot(root, didTimeout) { root === workInProgressRoot ? workInProgressRootRenderLanes : 0 ); if (0 === lanes) return null; - if (didTimeout) - return ( - markRootExpired(root, lanes), ensureRootIsScheduled(root, now()), null - ); - var lanes$jscomp$0 = lanes; - didTimeout = executionContext; - executionContext |= 8; - var prevDispatcher = pushDispatcher(); - if ( - workInProgressRoot !== root || - workInProgressRootRenderLanes !== lanes$jscomp$0 - ) - (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes$jscomp$0), - startWorkOnPendingInteractions(root, lanes$jscomp$0); - lanes$jscomp$0 = pushInteractions(root); - do - try { - workLoopConcurrent(); - break; - } catch (thrownValue) { - handleError(root, thrownValue); - } - while (1); - resetContextDependencies(); - tracing.__interactionsRef.current = lanes$jscomp$0; - ReactCurrentDispatcher$2.current = prevDispatcher; - executionContext = didTimeout; - null !== workInProgress - ? (didTimeout = 0) - : ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - (didTimeout = workInProgressRootExitStatus)); + var JSCompiler_inline_result = 0 !== (lanes & root.expiredLanes) ? !1 : !0; + if (JSCompiler_inline_result && !didTimeout) { + didTimeout = lanes; + JSCompiler_inline_result = executionContext; + executionContext |= 8; + var prevDispatcher = pushDispatcher(); + if ( + workInProgressRoot !== root || + workInProgressRootRenderLanes !== didTimeout + ) + (workInProgressRootRenderTargetTime = now() + 500), + prepareFreshStack(root, didTimeout); + do + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + while (1); + resetContextDependencies(); + ReactCurrentDispatcher$2.current = prevDispatcher; + executionContext = JSCompiler_inline_result; + null !== workInProgress + ? (didTimeout = 0) + : ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + (didTimeout = workInProgressRootExitStatus)); + } else didTimeout = renderRootSync(root, lanes); if (0 !== didTimeout) { 2 === didTimeout && ((executionContext |= 32), root.hydrate && ((root.hydrate = !1), shim(root.containerInfo)), - (prevDispatcher = getLanesToRetrySynchronouslyOnError(root)), - 0 !== prevDispatcher && - ((lanes = prevDispatcher), - (didTimeout = renderRootSync(root, prevDispatcher)))); + (JSCompiler_inline_result = getLanesToRetrySynchronouslyOnError(root)), + 0 !== JSCompiler_inline_result && + ((lanes = JSCompiler_inline_result), + (didTimeout = renderRootSync(root, JSCompiler_inline_result)))); if (1 === didTimeout) throw ((originalCallbackNode = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -6314,10 +6283,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { 10 < didTimeout) ) { if (0 !== getNextLanes(root, 0)) break; - prevDispatcher = root.suspendedLanes; - if ((prevDispatcher & lanes) !== lanes) { + JSCompiler_inline_result = root.suspendedLanes; + if ((JSCompiler_inline_result & lanes) !== lanes) { requestEventTime(); - root.pingedLanes |= root.suspendedLanes & prevDispatcher; + root.pingedLanes |= root.suspendedLanes & JSCompiler_inline_result; break; } root.timeoutHandle = scheduleTimeout( @@ -6332,14 +6301,15 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended$1(root, lanes); if ((lanes & 4194240) === lanes) break; didTimeout = root.eventTimes; - for (prevDispatcher = -1; 0 < lanes; ) { + for (JSCompiler_inline_result = -1; 0 < lanes; ) { var index$4 = 31 - clz32(lanes); - lanes$jscomp$0 = 1 << index$4; + prevDispatcher = 1 << index$4; index$4 = didTimeout[index$4]; - index$4 > prevDispatcher && (prevDispatcher = index$4); - lanes &= ~lanes$jscomp$0; + index$4 > JSCompiler_inline_result && + (JSCompiler_inline_result = index$4); + lanes &= ~prevDispatcher; } - lanes = prevDispatcher; + lanes = JSCompiler_inline_result; lanes = now() - lanes; lanes = (120 > lanes @@ -6393,11 +6363,7 @@ function performSyncWorkOnRoot(root) { throw Error("Should not already be working."); flushPassiveEffects(); var lanes = getNextLanes(root, 0); - if (0 !== (lanes & 1)) - root === workInProgressRoot && - 0 !== (lanes & workInProgressRootRenderLanes) && - (lanes = workInProgressRootRenderLanes); - else return ensureRootIsScheduled(root, now()), null; + if (0 === (lanes & 1)) return ensureRootIsScheduled(root, now()), null; var exitStatus = renderRootSync(root, lanes); if (0 !== root.tag && 2 === exitStatus) { executionContext |= 32; @@ -6490,7 +6456,6 @@ function prepareFreshStack(root, lanes) { } interleavedQueues = null; } - spawnedWorkDuringRender = null; } function handleError(root$jscomp$0, thrownValue) { do { @@ -6685,18 +6650,12 @@ function pushDispatcher() { ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; } -function pushInteractions(root) { - var prevInteractions = tracing.__interactionsRef.current; - tracing.__interactionsRef.current = root.memoizedInteractions; - return prevInteractions; -} function renderRootSync(root, lanes) { var prevExecutionContext = executionContext; executionContext |= 8; var prevDispatcher = pushDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - prepareFreshStack(root, lanes), startWorkOnPendingInteractions(root, lanes); - lanes = pushInteractions(root); + (workInProgressRoot === root && workInProgressRootRenderLanes === lanes) || + prepareFreshStack(root, lanes); do try { workLoopSync(); @@ -6706,7 +6665,6 @@ function renderRootSync(root, lanes) { } while (1); resetContextDependencies(); - tracing.__interactionsRef.current = lanes; executionContext = prevExecutionContext; ReactCurrentDispatcher$2.current = prevDispatcher; if (null !== workInProgress) @@ -6835,7 +6793,6 @@ function commitRootImpl(root, renderPriorityLevel) { currentUpdatePriority = 1; var prevExecutionContext = executionContext; executionContext |= 16; - var prevInteractions = pushInteractions(root); ReactCurrentOwner$2.current = null; commitBeforeMutationEffects(root, finishedWork); commitTime = now$1(); @@ -6843,33 +6800,16 @@ function commitRootImpl(root, renderPriorityLevel) { root.current = finishedWork; commitLayoutEffects(finishedWork, root, lanes); requestPaint(); - tracing.__interactionsRef.current = prevInteractions; executionContext = prevExecutionContext; currentUpdatePriority = previousPriority; ReactCurrentBatchConfig$2.transition = remainingLanes; } else (root.current = finishedWork), (commitTime = now$1()); - if ((previousPriority = rootDoesHavePassiveEffects)) - (rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes); + rootDoesHavePassiveEffects && + ((rootDoesHavePassiveEffects = !1), + (rootWithPendingPassiveEffects = root), + (pendingPassiveEffectsLanes = lanes)); remainingLanes = root.pendingLanes; - if (0 !== remainingLanes) { - if (null !== spawnedWorkDuringRender) - for ( - prevExecutionContext = spawnedWorkDuringRender, - spawnedWorkDuringRender = null, - prevInteractions = 0; - prevInteractions < prevExecutionContext.length; - prevInteractions++ - ) - scheduleInteractions( - root, - prevExecutionContext[prevInteractions], - root.memoizedInteractions - ); - schedulePendingInteractions(root, remainingLanes); - } else legacyErrorBoundariesThatAlreadyFailed = null; - previousPriority || finishPendingInteractions(root, lanes); + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); 0 !== (remainingLanes & 1) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -6886,7 +6826,7 @@ function commitRootImpl(root, renderPriorityLevel) { 0 !== (pendingPassiveEffectsLanes & 1) && 0 !== root.tag && flushPassiveEffects(); - flushSyncCallbackQueue(); + flushSyncCallbacks(); return null; } function flushPassiveEffects() { @@ -6901,14 +6841,12 @@ function flushPassiveEffects() { var JSCompiler_inline_result = !1; else { renderPriority = rootWithPendingPassiveEffects; - var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; if (0 !== (executionContext & 24)) throw Error("Cannot flush passive effects while already rendering."); var prevExecutionContext = executionContext; executionContext |= 16; - var prevInteractions = pushInteractions(renderPriority); for (nextEffect = renderPriority.current; null !== nextEffect; ) { var fiber = nextEffect, child = fiber.child; @@ -7017,10 +6955,8 @@ function flushPassiveEffects() { nextEffect = deletions.return; } } - tracing.__interactionsRef.current = prevInteractions; - finishPendingInteractions(renderPriority, lanes); executionContext = prevExecutionContext; - flushSyncCallbackQueue(); + flushSyncCallbacks(); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -7046,8 +6982,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { rootFiber = markUpdateLaneFromFiberToRoot(rootFiber, 1); null !== rootFiber && (markRootUpdated(rootFiber, 1, sourceFiber), - ensureRootIsScheduled(rootFiber, sourceFiber), - schedulePendingInteractions(rootFiber, 1)); + ensureRootIsScheduled(rootFiber, sourceFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -7088,8 +7023,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { ); null !== nearestMountedAncestor && (markRootUpdated(nearestMountedAncestor, 1, sourceFiber), - ensureRootIsScheduled(nearestMountedAncestor, sourceFiber), - schedulePendingInteractions(nearestMountedAncestor, 1)); + ensureRootIsScheduled(nearestMountedAncestor, sourceFiber)); break; } } @@ -7111,7 +7045,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { ? prepareFreshStack(root, 0) : (workInProgressRootPingedLanes |= pingedLanes)); ensureRootIsScheduled(root, wakeable); - schedulePendingInteractions(root, pingedLanes); } function resolveRetryWakeable(boundaryFiber, wakeable) { var retryCache = boundaryFiber.stateNode; @@ -7127,8 +7060,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, wakeable); null !== boundaryFiber && (markRootUpdated(boundaryFiber, wakeable, retryCache), - ensureRootIsScheduled(boundaryFiber, retryCache), - schedulePendingInteractions(boundaryFiber, wakeable)); + ensureRootIsScheduled(boundaryFiber, retryCache)); } var beginWork$1; beginWork$1 = function(current, workInProgress, renderLanes) { @@ -7641,93 +7573,6 @@ beginWork$1 = function(current, workInProgress, renderLanes) { "). This error is likely caused by a bug in React. Please file an issue." ); }; -function markSpawnedWork(lane) { - null === spawnedWorkDuringRender - ? (spawnedWorkDuringRender = [lane]) - : spawnedWorkDuringRender.push(lane); -} -function scheduleInteractions(root, lane, interactions) { - if (0 < interactions.size) { - var pendingInteractionMap = root.pendingInteractionMap, - pendingInteractions = pendingInteractionMap.get(lane); - null != pendingInteractions - ? interactions.forEach(function(interaction) { - pendingInteractions.has(interaction) || interaction.__count++; - pendingInteractions.add(interaction); - }) - : (pendingInteractionMap.set(lane, new Set(interactions)), - interactions.forEach(function(interaction) { - interaction.__count++; - })); - pendingInteractionMap = tracing.__subscriberRef.current; - if (null !== pendingInteractionMap) - pendingInteractionMap.onWorkScheduled( - interactions, - 1e3 * lane + root.interactionThreadID - ); - } -} -function schedulePendingInteractions(root, lane) { - scheduleInteractions(root, lane, tracing.__interactionsRef.current); -} -function startWorkOnPendingInteractions(root, lanes) { - var interactions = new Set(); - root.pendingInteractionMap.forEach(function( - scheduledInteractions, - scheduledLane - ) { - 0 !== (lanes & scheduledLane) && - scheduledInteractions.forEach(function(interaction) { - return interactions.add(interaction); - }); - }); - root.memoizedInteractions = interactions; - if (0 < interactions.size) { - var subscriber = tracing.__subscriberRef.current; - if (null !== subscriber) { - root = 1e3 * lanes + root.interactionThreadID; - try { - subscriber.onWorkStarted(interactions, root); - } catch (error) { - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } - } - } -} -function finishPendingInteractions(root, committedLanes) { - var remainingLanesAfterCommit = root.pendingLanes; - try { - var subscriber = tracing.__subscriberRef.current; - if (null !== subscriber && 0 < root.memoizedInteractions.size) - subscriber.onWorkStopped( - root.memoizedInteractions, - 1e3 * committedLanes + root.interactionThreadID - ); - } catch (error) { - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } finally { - var pendingInteractionMap = root.pendingInteractionMap; - pendingInteractionMap.forEach(function(scheduledInteractions, lane) { - 0 === (remainingLanesAfterCommit & lane) && - (pendingInteractionMap.delete(lane), - scheduledInteractions.forEach(function(interaction) { - interaction.__count--; - if (null !== subscriber && 0 === interaction.__count) - try { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } catch (error$97) { - scheduleCallback(ImmediatePriority, function() { - throw error$97; - }); - } - })); - }); - } -} function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -7934,11 +7779,8 @@ function FiberRootNode(containerInfo, tag, hydrate) { this.callbackPriority = 0; this.eventTimes = createLaneMap(0); this.expirationTimes = createLaneMap(-1); - this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; + this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; this.entanglements = createLaneMap(0); - this.interactionThreadID = tracing.unstable_getThreadID(); - this.memoizedInteractions = new Set(); - this.pendingInteractionMap = new Map(); } function createPortal(children, containerInfo, implementation) { var key = @@ -8049,11 +7891,11 @@ batchedUpdatesImpl = function(fn, a) { (executionContext = prevExecutionContext), 0 === executionContext && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncCallbackQueue()); + includesLegacySyncCallbacks && flushSyncCallbacks()); } }; var roots = new Map(), - devToolsConfig$jscomp$inline_962 = { + devToolsConfig$jscomp$inline_964 = { findFiberByHostInstance: getInstanceFromInstance, bundleType: 0, version: "17.0.3", @@ -8071,11 +7913,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1209 = { - bundleType: devToolsConfig$jscomp$inline_962.bundleType, - version: devToolsConfig$jscomp$inline_962.version, - rendererPackageName: devToolsConfig$jscomp$inline_962.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_962.rendererConfig, +var internals$jscomp$inline_1206 = { + bundleType: devToolsConfig$jscomp$inline_964.bundleType, + version: devToolsConfig$jscomp$inline_964.version, + rendererPackageName: devToolsConfig$jscomp$inline_964.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_964.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8090,7 +7932,7 @@ var internals$jscomp$inline_1209 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_962.findFiberByHostInstance || + devToolsConfig$jscomp$inline_964.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, @@ -8100,16 +7942,16 @@ var internals$jscomp$inline_1209 = { reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1210 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1207 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1210.isDisabled && - hook$jscomp$inline_1210.supportsFiber + !hook$jscomp$inline_1207.isDisabled && + hook$jscomp$inline_1207.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1210.inject( - internals$jscomp$inline_1209 + (rendererID = hook$jscomp$inline_1207.inject( + internals$jscomp$inline_1206 )), - (injectedHook = hook$jscomp$inline_1210); + (injectedHook = hook$jscomp$inline_1207); } catch (err) {} } exports.createPortal = function(children, containerTag) { diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 86d72b9245218c..d18718d436d03d 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<5646d53ee7f4f50af19833b5e7a7253c>> + * @generated SignedSource<> */ 'use strict'; @@ -20,7 +20,6 @@ var React = require("react"); require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"); var Scheduler = require("scheduler"); -var tracing = require("scheduler/tracing"); var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -3203,6 +3202,15 @@ var LayoutStatic = var PassiveStatic = /* */ 1048576; // These flags allow us to traverse to fibers that have effects on mount +// without traversing the entire tree after every commit for +// double invoking + +var MountLayoutDev = + /* */ + 2097152; +var MountPassiveDev = + /* */ + 4194304; // Groups of flags that are used in the commit phase to skip over trees that // don't contain effects, by checking subtreeFlags. var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visiblity @@ -4115,22 +4123,6 @@ var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; var NormalPriority = Scheduler.unstable_NormalPriority; var IdlePriority = Scheduler.unstable_IdlePriority; -{ - // Provide explicit error message when production+profiling bundle of e.g. - // react-dom is used with production (non-profiling) bundle of - // scheduler/tracing - if ( - !( - tracing.__interactionsRef != null && - tracing.__interactionsRef.current != null - ) - ) { - throw Error( - "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" - ); - } -} - var rendererID = null; var injectedHook = null; var hasLoggedError = false; @@ -4527,7 +4519,7 @@ function getNextLanes(root, wipLanes) { // Keep working on the existing in-progress tree. Do not interrupt. return wipLanes; } - } // Check for entangled lanes and add them to the batch. + } // // A lane is said to be entangled with another when it's not allowed to render // in a batch that does not also include the other lane. Typically we do this @@ -4662,7 +4654,6 @@ function markStarvedLanesAsExpired(root, currentTime) { // it as expired to force it to finish. var lanes = pendingLanes; - var expiredLanes = 0; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); @@ -4682,15 +4673,11 @@ function markStarvedLanesAsExpired(root, currentTime) { } } else if (expirationTime <= currentTime) { // This lane expired - expiredLanes |= lane; + root.expiredLanes |= lane; } lanes &= ~lane; } - - if (expiredLanes !== 0) { - markRootExpired(root, expiredLanes); - } } // This returns the highest priority pending lanes regardless of whether they function getLanesToRetrySynchronouslyOnError(root) { var everythingButOffscreen = root.pendingLanes & ~OffscreenLane; @@ -4714,6 +4701,17 @@ function includesOnlyRetries(lanes) { function includesOnlyTransitions(lanes) { return (lanes & TransitionLanes) === lanes; } +function shouldTimeSlice(root, lanes) { + if ((lanes & root.expiredLanes) !== NoLanes) { + // At least one of these lanes expired. To prevent additional starvation, + // finish rendering without yielding execution. + return false; + } + + { + return true; + } +} function isTransitionLane(lane) { return (lane & TransitionLanes) !== 0; } @@ -4832,13 +4830,6 @@ function markRootSuspended(root, suspendedLanes) { function markRootPinged(root, pingedLanes, eventTime) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } -function markRootExpired(root, expiredLanes) { - var entanglements = root.entanglements; - var SyncLaneIndex = 0; - entanglements[SyncLaneIndex] |= expiredLanes; - root.entangledLanes |= SyncLane; - root.pendingLanes |= SyncLane; -} function markRootMutableRead(root, updateLane) { root.mutableReadLanes |= updateLane & root.pendingLanes; } @@ -4848,6 +4839,7 @@ function markRootFinished(root, remainingLanes) { root.suspendedLanes = 0; root.pingedLanes = 0; + root.expiredLanes &= remainingLanes; root.mutableReadLanes &= remainingLanes; root.entangledLanes &= remainingLanes; @@ -5974,6 +5966,7 @@ var LegacyRoot = 0; var ConcurrentRoot = 1; var syncQueue = null; +var includesLegacySyncCallbacks = false; var isFlushingSyncQueue = false; function scheduleSyncCallback(callback) { // Push this callback into an internal queue. We'll flush these either in @@ -5986,7 +5979,21 @@ function scheduleSyncCallback(callback) { syncQueue.push(callback); } } -function flushSyncCallbackQueue() { +function scheduleLegacySyncCallback(callback) { + includesLegacySyncCallbacks = true; + scheduleSyncCallback(callback); +} +function flushSyncCallbacksOnlyInLegacyMode() { + // Only flushes the queue if there's a legacy sync callback scheduled. + // TODO: There's only a single type of callback: performSyncOnWorkOnRoot. So + // it might make more sense for the queue to be a list of roots instead of a + // list of generic callbacks. Then we can have two: one for legacy roots, one + // for concurrent roots. And this method would only flush the legacy ones. + if (includesLegacySyncCallbacks) { + flushSyncCallbacks(); + } +} +function flushSyncCallbacks() { if (!isFlushingSyncQueue && syncQueue !== null) { // Prevent re-entrancy. isFlushingSyncQueue = true; @@ -6009,13 +6016,14 @@ function flushSyncCallbackQueue() { } syncQueue = null; + includesLegacySyncCallbacks = false; } catch (error) { // If something throws, leave the remaining callbacks on the queue. if (syncQueue !== null) { syncQueue = syncQueue.slice(i + 1); } // Resume flushing in the next tick - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue); + scheduleCallback(ImmediatePriority, flushSyncCallbacks); throw error; } finally { setCurrentUpdatePriority(previousUpdatePriority); @@ -6064,6 +6072,9 @@ var DebugTracingMode = var StrictLegacyMode = /* */ 8; +var StrictEffectsMode = + /* */ + 16; var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; var NoTransition = 0; @@ -8238,6 +8249,11 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { if (typeof instance.componentDidMount === "function") { var fiberFlags = Update; + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + // Never double-invoke effects for legacy roots. + fiberFlags |= MountLayoutDev; + } + workInProgress.flags |= fiberFlags; } } @@ -8302,6 +8318,11 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { if (typeof instance.componentDidMount === "function") { var fiberFlags = Update; + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + // Never double-invoke effects for legacy roots. + fiberFlags |= MountLayoutDev; + } + workInProgress.flags |= fiberFlags; } @@ -8350,6 +8371,11 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { if (typeof instance.componentDidMount === "function") { var _fiberFlags = Update; + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + // Never double-invoke effects for legacy roots. + _fiberFlags |= MountLayoutDev; + } + workInProgress.flags |= _fiberFlags; } } else { @@ -8358,6 +8384,11 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { if (typeof instance.componentDidMount === "function") { var _fiberFlags2 = Update; + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + // Never double-invoke effects for legacy roots. + _fiberFlags2 |= MountLayoutDev; + } + workInProgress.flags |= _fiberFlags2; } // If shouldComponentUpdate returned false, we should still update the // memoized state to indicate that this work can be reused. @@ -10450,7 +10481,14 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the // complete phase (bubbleProperties). - { + if ((workInProgress.mode & StrictEffectsMode) !== NoMode) { + workInProgress.flags &= ~( + MountPassiveDev | + MountLayoutDev | + Passive | + Update + ); + } else { workInProgress.flags &= ~(Passive | Update); } @@ -11238,7 +11276,14 @@ function mountEffect(create, deps) { } } - { + if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { + return mountEffectImpl( + MountPassiveDev | Passive | PassiveStatic, + Passive$1, + create, + deps + ); + } else { return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps); } } @@ -11257,6 +11302,10 @@ function updateEffect(create, deps) { function mountLayoutEffect(create, deps) { var fiberFlags = Update; + if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { + fiberFlags |= MountLayoutDev; + } + return mountEffectImpl(fiberFlags, Layout, create, deps); } @@ -11311,6 +11360,10 @@ function mountImperativeHandle(ref, create, deps) { deps !== null && deps !== undefined ? deps.concat([ref]) : null; var fiberFlags = Update; + if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { + fiberFlags |= MountLayoutDev; + } + return mountEffectImpl( fiberFlags, Layout, @@ -12928,10 +12981,6 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) { nextBaseLanes = renderLanes; } // Schedule this fiber to re-render at offscreen priority. Then bailout. - { - markSpawnedWork(OffscreenLane); - } - workInProgress.lanes = workInProgress.childLanes = laneToLanes( OffscreenLane ); @@ -13967,11 +14016,6 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { // it behind on this node. workInProgress.lanes = SomeRetryLane; - - { - markSpawnedWork(SomeRetryLane); - } - return _fallbackFragment; } else { return mountSuspensePrimaryChildren( @@ -16008,10 +16052,6 @@ function completeWork(current, workInProgress, renderLanes) { // since we're leaving it behind on this node. workInProgress.lanes = SomeRetryLane; - - { - markSpawnedWork(SomeRetryLane); - } } } else { cutOffTailIfNeeded(renderState, false); @@ -16068,10 +16108,6 @@ function completeWork(current, workInProgress, renderLanes) { // since we're leaving it behind on this node. workInProgress.lanes = SomeRetryLane; - - { - markSpawnedWork(SomeRetryLane); - } } } @@ -17334,17 +17370,14 @@ function commitLayoutEffectOnFiber( var phase = current === null ? "mount" : "update"; if (typeof onRender === "function") { - { - onRender( - finishedWork.memoizedProps.id, - phase, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - commitTime, - finishedRoot.memoizedInteractions - ); - } + onRender( + finishedWork.memoizedProps.id, + phase, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); } } @@ -18110,12 +18143,6 @@ function attachSuspenseRetryListeners(finishedWork) { var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); if (!retryCache.has(wakeable)) { - { - if (wakeable.__reactDoNotTraceInteractions !== true) { - retry = tracing.unstable_wrap(retry); - } - } - retryCache.add(wakeable); wakeable.then(retry, retry); @@ -18621,6 +18648,152 @@ function ensureCorrectReturnPointer(fiber, expectedReturnFiber) { fiber.return = expectedReturnFiber; } +function invokeLayoutEffectMountInDEV(fiber) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: { + invokeGuardedCallback( + null, + commitHookEffectListMount, + null, + Layout | HasEffect, + fiber + ); + + if (hasCaughtError()) { + var mountError = clearCaughtError(); + captureCommitPhaseError(fiber, fiber.return, mountError); + } + + break; + } + + case ClassComponent: { + var instance = fiber.stateNode; + invokeGuardedCallback(null, instance.componentDidMount, instance); + + if (hasCaughtError()) { + var _mountError = clearCaughtError(); + + captureCommitPhaseError(fiber, fiber.return, _mountError); + } + + break; + } + } + } +} + +function invokePassiveEffectMountInDEV(fiber) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: { + invokeGuardedCallback( + null, + commitHookEffectListMount, + null, + Passive$1 | HasEffect, + fiber + ); + + if (hasCaughtError()) { + var mountError = clearCaughtError(); + captureCommitPhaseError(fiber, fiber.return, mountError); + } + + break; + } + } + } +} + +function invokeLayoutEffectUnmountInDEV(fiber) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: { + invokeGuardedCallback( + null, + commitHookEffectListUnmount, + null, + Layout | HasEffect, + fiber, + fiber.return + ); + + if (hasCaughtError()) { + var unmountError = clearCaughtError(); + captureCommitPhaseError(fiber, fiber.return, unmountError); + } + + break; + } + + case ClassComponent: { + var instance = fiber.stateNode; + + if (typeof instance.componentWillUnmount === "function") { + invokeGuardedCallback( + null, + safelyCallComponentWillUnmount, + null, + fiber, + fiber.return, + instance + ); + + if (hasCaughtError()) { + var _unmountError = clearCaughtError(); + + captureCommitPhaseError(fiber, fiber.return, _unmountError); + } + } + + break; + } + } + } +} + +function invokePassiveEffectUnmountInDEV(fiber) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: { + invokeGuardedCallback( + null, + commitHookEffectListUnmount, + null, + Passive$1 | HasEffect, + fiber, + fiber.return + ); + + if (hasCaughtError()) { + var unmountError = clearCaughtError(); + captureCommitPhaseError(fiber, fiber.return, unmountError); + } + + break; + } + } + } +} + var COMPONENT_TYPE = 0; var HAS_PSEUDO_CLASS_TYPE = 1; var ROLE_TYPE = 2; @@ -18728,13 +18901,7 @@ var NESTED_UPDATE_LIMIT = 50; var nestedUpdateCount = 0; var rootWithNestedUpdates = null; var NESTED_PASSIVE_UPDATE_LIMIT = 50; -var nestedPassiveUpdateCount = 0; // Marks the need to reschedule pending interactions at these lanes -// during the commit phase. This enables them to be traced across components -// that spawn new work during render. E.g. hidden boundaries, suspended SSR -// hydration or SuspenseList. -// TODO: Can use a bitmask instead of an array - -var spawnedWorkDuringRender = null; // If two updates are scheduled within the same event, we should treat their +var nestedPassiveUpdateCount = 0; // If two updates are scheduled within the same event, we should treat their // event times as simultaneous, even if the actual clock time has advanced // between the first and second call. @@ -18803,7 +18970,6 @@ function requestUpdateLane(fiber) { // TODO: Move this type conversion to the event priority module. var eventLane = getCurrentEventPriority(); - return eventLane; } @@ -18863,15 +19029,12 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering (executionContext & (RenderContext | CommitContext)) === NoContext ) { - // Register pending interactions on the root to avoid losing traced interaction data. - schedulePendingInteractions(root, lane); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed + // This is a legacy edge case. The initial mount of a ReactDOM.render-ed // root inside of batchedUpdates should be synchronous, but layout updates // should be deferred until the end of the batch. - performSyncWorkOnRoot(root); } else { ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, lane); if ( executionContext === NoContext && @@ -18883,13 +19046,12 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { // without immediately flushing it. We only do this for user-initiated // updates, to preserve historical behavior of legacy mode. resetRenderTimer(); - flushSyncCallbackQueue(); + flushSyncCallbacksOnlyInLegacyMode(); } } } else { // Schedule other updates after in case the callback is sync. ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, lane); } return root; @@ -19017,11 +19179,15 @@ function ensureRootIsScheduled(root, currentTime) { if (newCallbackPriority === SyncLane) { // Special case: Sync React callbacks are scheduled on a special // internal queue - scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); + if (root.tag === LegacyRoot) { + scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root)); + } else { + scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); + } { // Flush the queue in an Immediate task. - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue); + scheduleCallback(ImmediatePriority, flushSyncCallbacks); } newCallbackNode = null; @@ -19095,20 +19261,17 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (lanes === NoLanes) { // Defensive coding. This is never expected to happen. return null; - } // TODO: We only check `didTimeout` defensively, to account for a Scheduler + } // We disable time-slicing in some cases: if the work has been CPU-bound + // for too long ("expired" work, to prevent starvation), or we're in + // sync-updates-by-default mode. + // TODO: We only check `didTimeout` defensively, to account for a Scheduler // bug we're still investigating. Once the bug in Scheduler is fixed, // we can remove this, since we track expiration ourselves. - if (didTimeout) { - // Something expired. Flush synchronously until there's no expired - // work left. - markRootExpired(root, lanes); // This will schedule a synchronous callback. - - ensureRootIsScheduled(root, now()); - return null; - } - - var exitStatus = renderRootConcurrent(root, lanes); + var exitStatus = + shouldTimeSlice(root, lanes) && !didTimeout + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes); if (exitStatus !== RootIncomplete) { if (exitStatus === RootErrored) { @@ -19299,16 +19462,7 @@ function performSyncWorkOnRoot(root) { flushPassiveEffects(); var lanes = getNextLanes(root, NoLanes); - if (includesSomeLane(lanes, SyncLane)) { - if ( - root === workInProgressRoot && - includesSomeLane(lanes, workInProgressRootRenderLanes) - ) { - // There's a partial tree, and at least one of its lanes has expired. Finish - // rendering it before rendering the rest of the expired work. - lanes = workInProgressRootRenderLanes; - } - } else { + if (!includesSomeLane(lanes, SyncLane)) { // There's no remaining sync work left. ensureRootIsScheduled(root, now()); return null; @@ -19353,15 +19507,12 @@ function performSyncWorkOnRoot(root) { var finishedWork = root.current.alternate; root.finishedWork = finishedWork; root.finishedLanes = lanes; - - { - commitRoot(root); - } // Before exiting, make sure there's a callback scheduled for the next + commitRoot(root); // Before exiting, make sure there's a callback scheduled for the next // pending level. ensureRootIsScheduled(root, now()); return null; -} // TODO: Do we still need this API? I think we can delete it. Was only used +} function batchedUpdates$1(fn, a) { var prevExecutionContext = executionContext; executionContext |= BatchedContext; @@ -19369,12 +19520,12 @@ function batchedUpdates$1(fn, a) { try { return fn(a); } finally { - executionContext = prevExecutionContext; + executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer + // most batchedUpdates-like method. if (executionContext === NoContext) { - // Flush the immediate callbacks that were scheduled during this batch resetRenderTimer(); - flushSyncCallbackQueue(); + flushSyncCallbacksOnlyInLegacyMode(); } } } @@ -19401,7 +19552,7 @@ function flushSync(fn, a) { // the stack. if ((executionContext & (RenderContext | CommitContext)) === NoContext) { - flushSyncCallbackQueue(); + flushSyncCallbacks(); } else { { error( @@ -19458,10 +19609,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; enqueueInterleavedUpdates(); - { - spawnedWorkDuringRender = null; - } - { ReactStrictModeWarnings.discardPendingWarnings(); } @@ -19550,20 +19697,6 @@ function popDispatcher(prevDispatcher) { ReactCurrentDispatcher$2.current = prevDispatcher; } -function pushInteractions(root) { - { - var prevInteractions = tracing.__interactionsRef.current; - tracing.__interactionsRef.current = root.memoizedInteractions; - return prevInteractions; - } -} - -function popInteractions(prevInteractions) { - { - tracing.__interactionsRef.current = prevInteractions; - } -} - function markCommitTimeOfFallback() { globalMostRecentFallbackTime = now(); } @@ -19623,11 +19756,8 @@ function renderRootSync(root, lanes) { if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { prepareFreshStack(root, lanes); - startWorkOnPendingInteractions(root, lanes); } - var prevInteractions = pushInteractions(root); - do { try { workLoopSync(); @@ -19638,11 +19768,6 @@ function renderRootSync(root, lanes) { } while (true); resetContextDependencies(); - - { - popInteractions(prevInteractions); - } - executionContext = prevExecutionContext; popDispatcher(prevDispatcher); @@ -19678,11 +19803,8 @@ function renderRootConcurrent(root, lanes) { if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { resetRenderTimer(); prepareFreshStack(root, lanes); - startWorkOnPendingInteractions(root, lanes); } - var prevInteractions = pushInteractions(root); - do { try { workLoopConcurrent(); @@ -19693,11 +19815,6 @@ function renderRootConcurrent(root, lanes) { } while (true); resetContextDependencies(); - - { - popInteractions(prevInteractions); - } - popDispatcher(prevDispatcher); executionContext = prevExecutionContext; @@ -19948,8 +20065,7 @@ function commitRootImpl(root, renderPriorityLevel) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(DiscreteEventPriority); var prevExecutionContext = executionContext; - executionContext |= CommitContext; - var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles + executionContext |= CommitContext; // Reset this to null before calling lifecycles ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass // of the effect list for each phase: all mutation effects come before all @@ -19982,11 +20098,6 @@ function commitRootImpl(root, renderPriorityLevel) { // opportunity to paint. requestPaint(); - - { - popInteractions(prevInteractions); - } - executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value. setCurrentUpdatePriority(previousPriority); @@ -20014,24 +20125,7 @@ function commitRootImpl(root, renderPriorityLevel) { remainingLanes = root.pendingLanes; // Check if there's remaining work on this root - if (remainingLanes !== NoLanes) { - { - if (spawnedWorkDuringRender !== null) { - var expirationTimes = spawnedWorkDuringRender; - spawnedWorkDuringRender = null; - - for (var i = 0; i < expirationTimes.length; i++) { - scheduleInteractions( - root, - expirationTimes[i], - root.memoizedInteractions - ); - } - } - - schedulePendingInteractions(root, remainingLanes); - } - } else { + if (remainingLanes === NoLanes) { // If there's no remaining work, we can clear the set of already failed // error boundaries. legacyErrorBoundariesThatAlreadyFailed = null; @@ -20039,11 +20133,7 @@ function commitRootImpl(root, renderPriorityLevel) { { if (!rootDidHavePassiveEffects) { - // If there are no passive effects, then we can complete the pending interactions. - // Otherwise, we'll wait until after the passive effects are flushed. - // Wait to do this until after remaining work has been scheduled, - // so that we don't prematurely signal complete for interactions when there's e.g. hidden work. - finishPendingInteractions(root, lanes); + commitDoubleInvokeEffectsInDEV(root.current, false); } } @@ -20094,7 +20184,7 @@ function commitRootImpl(root, renderPriorityLevel) { flushPassiveEffects(); } // If layout work was scheduled, flush it now. - flushSyncCallbackQueue(); + flushSyncCallbacks(); return null; } @@ -20131,7 +20221,6 @@ function flushPassiveEffectsImpl() { } var root = rootWithPendingPassiveEffects; - var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects. // Figure out why and fix it. It's not causing any known issues (probably // because it's only used for profiling), but it's a refactor hazard. @@ -20148,21 +20237,19 @@ function flushPassiveEffectsImpl() { var prevExecutionContext = executionContext; executionContext |= CommitContext; - var prevInteractions = pushInteractions(root); commitPassiveUnmountEffects(root.current); commitPassiveMountEffects(root, root.current); // TODO: Move to commitPassiveMountEffects { - popInteractions(prevInteractions); - finishPendingInteractions(root, lanes); + isFlushingPassiveEffects = false; } { - isFlushingPassiveEffects = false; + commitDoubleInvokeEffectsInDEV(root.current, true); } executionContext = prevExecutionContext; - flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this + flushSyncCallbacks(); // If additional passive effects were scheduled, increment a counter. If this // exceeds the limit, we'll fire a warning. nestedPassiveUpdateCount = @@ -20206,7 +20293,6 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { if (root !== null) { markRootUpdated(root, SyncLane, eventTime); ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, SyncLane); } } @@ -20246,7 +20332,6 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { if (root !== null) { markRootUpdated(root, SyncLane, eventTime); ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, SyncLane); } return; @@ -20314,7 +20399,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { } ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, pingedLanes); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -20334,7 +20418,6 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { if (root !== null) { markRootUpdated(root, retryLane, eventTime); ensureRootIsScheduled(root, eventTime); - schedulePendingInteractions(root, retryLane); } } function resolveRetryWakeable(boundaryFiber, wakeable) { @@ -20415,6 +20498,63 @@ function flushRenderPhaseStrictModeWarningsInDEV() { } } +function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { + { + // TODO (StrictEffects) Should we set a marker on the root if it contains strict effects + // so we don't traverse unnecessarily? similar to subtreeFlags but just at the root level. + // Maybe not a big deal since this is DEV only behavior. + setCurrentFiber(fiber); + invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV); + + if (hasPassiveEffects) { + invokeEffectsInDev( + fiber, + MountPassiveDev, + invokePassiveEffectUnmountInDEV + ); + } + + invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV); + + if (hasPassiveEffects) { + invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV); + } + + resetCurrentFiber(); + } +} + +function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) { + { + // We don't need to re-check StrictEffectsMode here. + // This function is only called if that check has already passed. + var current = firstChild; + var subtreeRoot = null; + + while (current !== null) { + var primarySubtreeFlag = current.subtreeFlags & fiberFlags; + + if ( + current !== subtreeRoot && + current.child !== null && + primarySubtreeFlag !== NoFlags + ) { + current = current.child; + } else { + if ((current.flags & fiberFlags) !== NoFlags) { + invokeEffectFn(current); + } + + if (current.sibling !== null) { + current = current.sibling; + } else { + current = subtreeRoot = current.return; + } + } + } + } +} + var didWarnStateUpdateForNotYetMountedComponent = null; function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { @@ -20821,144 +20961,6 @@ function warnIfUnmockedScheduler(fiber) { } } } -} - -function computeThreadID(root, lane) { - // Interaction threads are unique per root and expiration time. - // NOTE: Intentionally unsound cast. All that matters is that it's a number - // and it represents a batch of work. Could make a helper function instead, - // but meh this is fine for now. - return lane * 1000 + root.interactionThreadID; -} - -function markSpawnedWork(lane) { - if (spawnedWorkDuringRender === null) { - spawnedWorkDuringRender = [lane]; - } else { - spawnedWorkDuringRender.push(lane); - } -} - -function scheduleInteractions(root, lane, interactions) { - if (interactions.size > 0) { - var pendingInteractionMap = root.pendingInteractionMap; - var pendingInteractions = pendingInteractionMap.get(lane); - - if (pendingInteractions != null) { - interactions.forEach(function(interaction) { - if (!pendingInteractions.has(interaction)) { - // Update the pending async work count for previously unscheduled interaction. - interaction.__count++; - } - - pendingInteractions.add(interaction); - }); - } else { - pendingInteractionMap.set(lane, new Set(interactions)); // Update the pending async work count for the current interactions. - - interactions.forEach(function(interaction) { - interaction.__count++; - }); - } - - var subscriber = tracing.__subscriberRef.current; - - if (subscriber !== null) { - var threadID = computeThreadID(root, lane); - subscriber.onWorkScheduled(interactions, threadID); - } - } -} - -function schedulePendingInteractions(root, lane) { - scheduleInteractions(root, lane, tracing.__interactionsRef.current); -} - -function startWorkOnPendingInteractions(root, lanes) { - // we can accurately attribute time spent working on it, And so that cascading - // work triggered during the render phase will be associated with it. - - var interactions = new Set(); - root.pendingInteractionMap.forEach(function( - scheduledInteractions, - scheduledLane - ) { - if (includesSomeLane(lanes, scheduledLane)) { - scheduledInteractions.forEach(function(interaction) { - return interactions.add(interaction); - }); - } - }); // Store the current set of interactions on the FiberRoot for a few reasons: - // We can re-use it in hot functions like performConcurrentWorkOnRoot() - // without having to recalculate it. We will also use it in commitWork() to - // pass to any Profiler onRender() hooks. This also provides DevTools with a - // way to access it when the onCommitRoot() hook is called. - - root.memoizedInteractions = interactions; - - if (interactions.size > 0) { - var subscriber = tracing.__subscriberRef.current; - - if (subscriber !== null) { - var threadID = computeThreadID(root, lanes); - - try { - subscriber.onWorkStarted(interactions, threadID); - } catch (error) { - // If the subscriber throws, rethrow it in a separate task - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } - } - } -} - -function finishPendingInteractions(root, committedLanes) { - var remainingLanesAfterCommit = root.pendingLanes; - var subscriber; - - try { - subscriber = tracing.__subscriberRef.current; - - if (subscriber !== null && root.memoizedInteractions.size > 0) { - // FIXME: More than one lane can finish in a single commit. - var threadID = computeThreadID(root, committedLanes); - subscriber.onWorkStopped(root.memoizedInteractions, threadID); - } - } catch (error) { - // If the subscriber throws, rethrow it in a separate task - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } finally { - // Clear completed interactions from the pending Map. - // Unless the render was suspended or cascading work was scheduled, - // In which case– leave pending interactions until the subsequent render. - var pendingInteractionMap = root.pendingInteractionMap; - pendingInteractionMap.forEach(function(scheduledInteractions, lane) { - // Only decrement the pending interaction count if we're done. - // If there's still work at the current priority, - // That indicates that we are waiting for suspense data. - if (!includesSomeLane(remainingLanesAfterCommit, lane)) { - pendingInteractionMap.delete(lane); - scheduledInteractions.forEach(function(interaction) { - interaction.__count--; - - if (subscriber !== null && interaction.__count === 0) { - try { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } catch (error) { - // If the subscriber throws, rethrow it in a separate task - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } - } - }); - } - }); - } } // `act` testing API function shouldForceFlushFallbacksInDEV() { @@ -21713,6 +21715,12 @@ function createHostRootFiber(tag, strictModeLevelOverride) { if (strictModeLevelOverride >= 1) { mode |= StrictLegacyMode; } + + { + if (strictModeLevelOverride >= 2) { + mode |= StrictEffectsMode; + } + } } else { { mode |= StrictLegacyMode; @@ -21778,6 +21786,12 @@ function createFiberFromTypeAndProps( mode |= StrictLegacyMode; } + { + if (level >= 2) { + mode |= StrictEffectsMode; + } + } + break; case REACT_PROFILER_TYPE: @@ -22045,17 +22059,12 @@ function FiberRootNode(containerInfo, tag, hydrate) { this.pendingLanes = NoLanes; this.suspendedLanes = NoLanes; this.pingedLanes = NoLanes; + this.expiredLanes = NoLanes; this.mutableReadLanes = NoLanes; this.finishedLanes = NoLanes; this.entangledLanes = NoLanes; this.entanglements = createLaneMap(NoLanes); - { - this.interactionThreadID = tracing.unstable_getThreadID(); - this.memoizedInteractions = new Set(); - this.pendingInteractionMap = new Map(); - } - { switch (tag) { case ConcurrentRoot: diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index 26d1392f71d582..bb4c3367d797c1 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<7fe4adbce18b530534dc96bc573966a5>> + * @generated SignedSource<> */ "use strict"; @@ -930,7 +930,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_217 = { +var injectedNamesToPlugins$jscomp$inline_219 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -965,34 +965,34 @@ var injectedNamesToPlugins$jscomp$inline_217 = { } } }, - isOrderingDirty$jscomp$inline_218 = !1, - pluginName$jscomp$inline_219; -for (pluginName$jscomp$inline_219 in injectedNamesToPlugins$jscomp$inline_217) + isOrderingDirty$jscomp$inline_220 = !1, + pluginName$jscomp$inline_221; +for (pluginName$jscomp$inline_221 in injectedNamesToPlugins$jscomp$inline_219) if ( - injectedNamesToPlugins$jscomp$inline_217.hasOwnProperty( - pluginName$jscomp$inline_219 + injectedNamesToPlugins$jscomp$inline_219.hasOwnProperty( + pluginName$jscomp$inline_221 ) ) { - var pluginModule$jscomp$inline_220 = - injectedNamesToPlugins$jscomp$inline_217[pluginName$jscomp$inline_219]; + var pluginModule$jscomp$inline_222 = + injectedNamesToPlugins$jscomp$inline_219[pluginName$jscomp$inline_221]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_219) || - namesToPlugins[pluginName$jscomp$inline_219] !== - pluginModule$jscomp$inline_220 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_221) || + namesToPlugins[pluginName$jscomp$inline_221] !== + pluginModule$jscomp$inline_222 ) { - if (namesToPlugins[pluginName$jscomp$inline_219]) + if (namesToPlugins[pluginName$jscomp$inline_221]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_219 + + pluginName$jscomp$inline_221 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_219 - ] = pluginModule$jscomp$inline_220; - isOrderingDirty$jscomp$inline_218 = !0; + pluginName$jscomp$inline_221 + ] = pluginModule$jscomp$inline_222; + isOrderingDirty$jscomp$inline_220 = !0; } } -isOrderingDirty$jscomp$inline_218 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_220 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -1856,16 +1856,12 @@ function markRootUpdated(root, updateLane, eventTime) { updateLane = 31 - clz32(updateLane); root[updateLane] = eventTime; } -function markRootExpired(root, expiredLanes) { - root.entanglements[0] |= expiredLanes; - root.entangledLanes |= 1; - root.pendingLanes |= 1; -} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.expiredLanes &= remainingLanes; root.mutableReadLanes &= remainingLanes; root.entangledLanes &= remainingLanes; remainingLanes = root.entanglements; @@ -2052,8 +2048,9 @@ function invalidateContextProvider(workInProgress, type, didChange) { push(didPerformWorkStackCursor, didChange); } var syncQueue = null, + includesLegacySyncCallbacks = !1, isFlushingSyncQueue = !1; -function flushSyncCallbackQueue() { +function flushSyncCallbacks() { if (!isFlushingSyncQueue && null !== syncQueue) { isFlushingSyncQueue = !0; var i = 0, @@ -2066,9 +2063,10 @@ function flushSyncCallbackQueue() { while (null !== callback); } syncQueue = null; + includesLegacySyncCallbacks = !1; } catch (error) { throw (null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)), - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue), + scheduleCallback(ImmediatePriority, flushSyncCallbacks), error); } finally { (currentUpdatePriority = previousUpdatePriority), @@ -6234,7 +6232,7 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { 0 === executionContext && 0 === (fiber.mode & 1) && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncCallbackQueue())) + includesLegacySyncCallbacks && flushSyncCallbacks())) : ensureRootIsScheduled(root, eventTime); return root; } @@ -6257,8 +6255,7 @@ function ensureRootIsScheduled(root, currentTime) { suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes, expirationTimes = root.expirationTimes, - lanes = root.pendingLanes, - expiredLanes = 0; + lanes = root.pendingLanes; 0 < lanes; ) { @@ -6268,10 +6265,9 @@ function ensureRootIsScheduled(root, currentTime) { if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) expirationTimes[index$6] = computeExpirationTime(lane, currentTime); - } else expirationTime <= currentTime && (expiredLanes |= lane); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } - 0 !== expiredLanes && markRootExpired(root, expiredLanes); suspendedLanes = getNextLanes( root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0 @@ -6286,11 +6282,17 @@ function ensureRootIsScheduled(root, currentTime) { ) { null != existingCallbackNode && cancelCallback(existingCallbackNode); if (1 === currentTime) - (existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), - null === syncQueue - ? (syncQueue = [existingCallbackNode]) - : syncQueue.push(existingCallbackNode), - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue), + 0 === root.tag + ? ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), + (includesLegacySyncCallbacks = !0), + null === syncQueue + ? (syncQueue = [existingCallbackNode]) + : syncQueue.push(existingCallbackNode)) + : ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), + null === syncQueue + ? (syncQueue = [existingCallbackNode]) + : syncQueue.push(existingCallbackNode)), + scheduleCallback(ImmediatePriority, flushSyncCallbacks), (existingCallbackNode = null); else { switch (lanesToEventPriority(suspendedLanes)) { @@ -6331,44 +6333,43 @@ function performConcurrentWorkOnRoot(root, didTimeout) { root === workInProgressRoot ? workInProgressRootRenderLanes : 0 ); if (0 === lanes) return null; - if (didTimeout) - return ( - markRootExpired(root, lanes), ensureRootIsScheduled(root, now()), null - ); - didTimeout = lanes; - var prevExecutionContext = executionContext; - executionContext |= 8; - var prevDispatcher = pushDispatcher(); - if ( - workInProgressRoot !== root || - workInProgressRootRenderLanes !== didTimeout - ) - (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, didTimeout); - do - try { - workLoopConcurrent(); - break; - } catch (thrownValue) { - handleError(root, thrownValue); - } - while (1); - resetContextDependencies(); - ReactCurrentDispatcher$2.current = prevDispatcher; - executionContext = prevExecutionContext; - null !== workInProgress - ? (didTimeout = 0) - : ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - (didTimeout = workInProgressRootExitStatus)); + var JSCompiler_inline_result = 0 !== (lanes & root.expiredLanes) ? !1 : !0; + if (JSCompiler_inline_result && !didTimeout) { + didTimeout = lanes; + JSCompiler_inline_result = executionContext; + executionContext |= 8; + var prevDispatcher = pushDispatcher(); + if ( + workInProgressRoot !== root || + workInProgressRootRenderLanes !== didTimeout + ) + (workInProgressRootRenderTargetTime = now() + 500), + prepareFreshStack(root, didTimeout); + do + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + while (1); + resetContextDependencies(); + ReactCurrentDispatcher$2.current = prevDispatcher; + executionContext = JSCompiler_inline_result; + null !== workInProgress + ? (didTimeout = 0) + : ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + (didTimeout = workInProgressRootExitStatus)); + } else didTimeout = renderRootSync(root, lanes); if (0 !== didTimeout) { 2 === didTimeout && ((executionContext |= 32), root.hydrate && (root.hydrate = !1), - (prevExecutionContext = getLanesToRetrySynchronouslyOnError(root)), - 0 !== prevExecutionContext && - ((lanes = prevExecutionContext), - (didTimeout = renderRootSync(root, prevExecutionContext)))); + (JSCompiler_inline_result = getLanesToRetrySynchronouslyOnError(root)), + 0 !== JSCompiler_inline_result && + ((lanes = JSCompiler_inline_result), + (didTimeout = renderRootSync(root, JSCompiler_inline_result)))); if (1 === didTimeout) throw ((originalCallbackNode = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -6392,10 +6393,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { 10 < didTimeout) ) { if (0 !== getNextLanes(root, 0)) break; - prevExecutionContext = root.suspendedLanes; - if ((prevExecutionContext & lanes) !== lanes) { + JSCompiler_inline_result = root.suspendedLanes; + if ((JSCompiler_inline_result & lanes) !== lanes) { requestEventTime(); - root.pingedLanes |= root.suspendedLanes & prevExecutionContext; + root.pingedLanes |= root.suspendedLanes & JSCompiler_inline_result; break; } root.timeoutHandle = scheduleTimeout( @@ -6410,14 +6411,15 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended$1(root, lanes); if ((lanes & 4194240) === lanes) break; didTimeout = root.eventTimes; - for (prevExecutionContext = -1; 0 < lanes; ) { + for (JSCompiler_inline_result = -1; 0 < lanes; ) { var index$5 = 31 - clz32(lanes); prevDispatcher = 1 << index$5; index$5 = didTimeout[index$5]; - index$5 > prevExecutionContext && (prevExecutionContext = index$5); + index$5 > JSCompiler_inline_result && + (JSCompiler_inline_result = index$5); lanes &= ~prevDispatcher; } - lanes = prevExecutionContext; + lanes = JSCompiler_inline_result; lanes = now() - lanes; lanes = (120 > lanes @@ -6471,11 +6473,7 @@ function performSyncWorkOnRoot(root) { throw Error("Should not already be working."); flushPassiveEffects(); var lanes = getNextLanes(root, 0); - if (0 !== (lanes & 1)) - root === workInProgressRoot && - 0 !== (lanes & workInProgressRootRenderLanes) && - (lanes = workInProgressRootRenderLanes); - else return ensureRootIsScheduled(root, now()), null; + if (0 === (lanes & 1)) return ensureRootIsScheduled(root, now()), null; var exitStatus = renderRootSync(root, lanes); if (0 !== root.tag && 2 === exitStatus) { executionContext |= 32; @@ -6914,7 +6912,7 @@ function commitRootImpl(root, renderPriorityLevel) { 0 !== (pendingPassiveEffectsLanes & 1) && 0 !== root.tag && flushPassiveEffects(); - flushSyncCallbackQueue(); + flushSyncCallbacks(); return null; } function flushPassiveEffects() { @@ -7044,7 +7042,7 @@ function flushPassiveEffects() { } } executionContext = prevExecutionContext; - flushSyncCallbackQueue(); + flushSyncCallbacks(); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -7854,7 +7852,7 @@ function FiberRootNode(containerInfo, tag, hydrate) { this.callbackPriority = 0; this.eventTimes = createLaneMap(0); this.expirationTimes = createLaneMap(-1); - this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; + this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; this.entanglements = createLaneMap(0); } function createPortal(children, containerInfo, implementation) { @@ -7973,11 +7971,11 @@ batchedUpdatesImpl = function(fn, a) { (executionContext = prevExecutionContext), 0 === executionContext && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncCallbackQueue()); + includesLegacySyncCallbacks && flushSyncCallbacks()); } }; var roots = new Map(), - devToolsConfig$jscomp$inline_978 = { + devToolsConfig$jscomp$inline_984 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, version: "17.0.3", @@ -7995,11 +7993,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1231 = { - bundleType: devToolsConfig$jscomp$inline_978.bundleType, - version: devToolsConfig$jscomp$inline_978.version, - rendererPackageName: devToolsConfig$jscomp$inline_978.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_978.rendererConfig, +var internals$jscomp$inline_1241 = { + bundleType: devToolsConfig$jscomp$inline_984.bundleType, + version: devToolsConfig$jscomp$inline_984.version, + rendererPackageName: devToolsConfig$jscomp$inline_984.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_984.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8014,7 +8012,7 @@ var internals$jscomp$inline_1231 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_978.findFiberByHostInstance || + devToolsConfig$jscomp$inline_984.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, @@ -8024,16 +8022,16 @@ var internals$jscomp$inline_1231 = { reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1232 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1242 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1232.isDisabled && - hook$jscomp$inline_1232.supportsFiber + !hook$jscomp$inline_1242.isDisabled && + hook$jscomp$inline_1242.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1232.inject( - internals$jscomp$inline_1231 + (rendererID = hook$jscomp$inline_1242.inject( + internals$jscomp$inline_1241 )), - (injectedHook = hook$jscomp$inline_1232); + (injectedHook = hook$jscomp$inline_1242); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index 6ad8d9e989be09..93ff57c2c07db7 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,15 +7,14 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<1d8982979f73acf759da57f16d5bd81b>> */ "use strict"; require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"), React = require("react"), - Scheduler = require("scheduler"), - tracing = require("scheduler/tracing"); + Scheduler = require("scheduler"); function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { var funcArgs = Array.prototype.slice.call(arguments, 3); try { @@ -931,7 +930,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_223 = { +var injectedNamesToPlugins$jscomp$inline_224 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -966,34 +965,34 @@ var injectedNamesToPlugins$jscomp$inline_223 = { } } }, - isOrderingDirty$jscomp$inline_224 = !1, - pluginName$jscomp$inline_225; -for (pluginName$jscomp$inline_225 in injectedNamesToPlugins$jscomp$inline_223) + isOrderingDirty$jscomp$inline_225 = !1, + pluginName$jscomp$inline_226; +for (pluginName$jscomp$inline_226 in injectedNamesToPlugins$jscomp$inline_224) if ( - injectedNamesToPlugins$jscomp$inline_223.hasOwnProperty( - pluginName$jscomp$inline_225 + injectedNamesToPlugins$jscomp$inline_224.hasOwnProperty( + pluginName$jscomp$inline_226 ) ) { - var pluginModule$jscomp$inline_226 = - injectedNamesToPlugins$jscomp$inline_223[pluginName$jscomp$inline_225]; + var pluginModule$jscomp$inline_227 = + injectedNamesToPlugins$jscomp$inline_224[pluginName$jscomp$inline_226]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_225) || - namesToPlugins[pluginName$jscomp$inline_225] !== - pluginModule$jscomp$inline_226 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_226) || + namesToPlugins[pluginName$jscomp$inline_226] !== + pluginModule$jscomp$inline_227 ) { - if (namesToPlugins[pluginName$jscomp$inline_225]) + if (namesToPlugins[pluginName$jscomp$inline_226]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_225 + + pluginName$jscomp$inline_226 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_225 - ] = pluginModule$jscomp$inline_226; - isOrderingDirty$jscomp$inline_224 = !0; + pluginName$jscomp$inline_226 + ] = pluginModule$jscomp$inline_227; + isOrderingDirty$jscomp$inline_225 = !0; } } -isOrderingDirty$jscomp$inline_224 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_225 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -1696,15 +1695,8 @@ var ReactNativeFiberHostComponent = (function() { ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority; -if ( - null == tracing.__interactionsRef || - null == tracing.__interactionsRef.current -) - throw Error( - "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" - ); -var rendererID = null, + IdlePriority = Scheduler.unstable_IdlePriority, + rendererID = null, injectedHook = null, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; function onCommitRoot(root, eventPriority) { @@ -1882,16 +1874,12 @@ function markRootUpdated(root, updateLane, eventTime) { updateLane = 31 - clz32(updateLane); root[updateLane] = eventTime; } -function markRootExpired(root, expiredLanes) { - root.entanglements[0] |= expiredLanes; - root.entangledLanes |= 1; - root.pendingLanes |= 1; -} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.expiredLanes &= remainingLanes; root.mutableReadLanes &= remainingLanes; root.entangledLanes &= remainingLanes; remainingLanes = root.entanglements; @@ -2078,8 +2066,9 @@ function invalidateContextProvider(workInProgress, type, didChange) { push(didPerformWorkStackCursor, didChange); } var syncQueue = null, + includesLegacySyncCallbacks = !1, isFlushingSyncQueue = !1; -function flushSyncCallbackQueue() { +function flushSyncCallbacks() { if (!isFlushingSyncQueue && null !== syncQueue) { isFlushingSyncQueue = !0; var i = 0, @@ -2092,9 +2081,10 @@ function flushSyncCallbackQueue() { while (null !== callback); } syncQueue = null; + includesLegacySyncCallbacks = !1; } catch (error) { throw (null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)), - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue), + scheduleCallback(ImmediatePriority, flushSyncCallbacks), error); } finally { (currentUpdatePriority = previousUpdatePriority), @@ -4222,7 +4212,6 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) { null !== prevState ? prevState.baseLanes | renderLanes : renderLanes), - markSpawnedWork(1073741824), (workInProgress.lanes = workInProgress.childLanes = 1073741824), (workInProgress.memoizedState = { baseLanes: current, @@ -4596,7 +4585,6 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - markSpawnedWork(4194304), current ); renderLanes = createFiberFromOffscreen( @@ -5276,8 +5264,7 @@ function completeWork(current, workInProgress, renderLanes) { ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(type, !1), - (workInProgress.lanes = 4194304), - markSpawnedWork(4194304)); + (workInProgress.lanes = 4194304)); } else { if (!newProps) @@ -5304,8 +5291,7 @@ function completeWork(current, workInProgress, renderLanes) { ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(type, !1), - (workInProgress.lanes = 4194304), - markSpawnedWork(4194304)); + (workInProgress.lanes = 4194304)); type.isBackwards ? ((updatePayload.sibling = workInProgress.child), (workInProgress.child = updatePayload)) @@ -6096,10 +6082,7 @@ function attachSuspenseRetryListeners(finishedWork) { wakeables.forEach(function(wakeable) { var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); retryCache.has(wakeable) || - (!0 !== wakeable.__reactDoNotTraceInteractions && - (retry = tracing.unstable_wrap(retry)), - retryCache.add(wakeable), - wakeable.then(retry, retry)); + (retryCache.add(wakeable), wakeable.then(retry, retry)); }); } } @@ -6170,36 +6153,35 @@ function commitMutationEffects(root, firstChild) { } } } -function commitLayoutEffects(finishedWork, root) { +function commitLayoutEffects(finishedWork) { for (nextEffect = finishedWork; null !== nextEffect; ) { var fiber = nextEffect, firstChild = fiber.child; if (0 !== (fiber.subtreeFlags & 324) && null !== firstChild) (firstChild.return = fiber), (nextEffect = firstChild); else - for (fiber = finishedWork, firstChild = root; null !== nextEffect; ) { - var fiber$jscomp$0 = nextEffect; - if (0 !== (fiber$jscomp$0.flags & 324)) { - var current = fiber$jscomp$0.alternate; + for (fiber = finishedWork; null !== nextEffect; ) { + firstChild = nextEffect; + if (0 !== (firstChild.flags & 324)) { + var current = firstChild.alternate; try { - var finishedRoot = firstChild; - if (0 !== (fiber$jscomp$0.flags & 68)) - switch (fiber$jscomp$0.tag) { + if (0 !== (firstChild.flags & 68)) + switch (firstChild.tag) { case 0: case 11: case 15: - commitHookEffectListMount(3, fiber$jscomp$0); + commitHookEffectListMount(3, firstChild); break; case 1: - var instance = fiber$jscomp$0.stateNode; - if (fiber$jscomp$0.flags & 4) + var instance = firstChild.stateNode; + if (firstChild.flags & 4) if (null === current) instance.componentDidMount(); else { var prevProps = - fiber$jscomp$0.elementType === fiber$jscomp$0.type + firstChild.elementType === firstChild.type ? current.memoizedProps : resolveDefaultProps( - fiber$jscomp$0.type, + firstChild.type, current.memoizedProps ); instance.componentDidUpdate( @@ -6208,27 +6190,23 @@ function commitLayoutEffects(finishedWork, root) { instance.__reactInternalSnapshotBeforeUpdate ); } - var updateQueue = fiber$jscomp$0.updateQueue; + var updateQueue = firstChild.updateQueue; null !== updateQueue && - commitUpdateQueue(fiber$jscomp$0, updateQueue, instance); + commitUpdateQueue(firstChild, updateQueue, instance); break; case 3: - var updateQueue$87 = fiber$jscomp$0.updateQueue; + var updateQueue$87 = firstChild.updateQueue; if (null !== updateQueue$87) { - finishedRoot = null; - if (null !== fiber$jscomp$0.child) - switch (fiber$jscomp$0.child.tag) { + var instance$88 = null; + if (null !== firstChild.child) + switch (firstChild.child.tag) { case 5: - finishedRoot = fiber$jscomp$0.child.stateNode; + instance$88 = firstChild.child.stateNode; break; case 1: - finishedRoot = fiber$jscomp$0.child.stateNode; + instance$88 = firstChild.child.stateNode; } - commitUpdateQueue( - fiber$jscomp$0, - updateQueue$87, - finishedRoot - ); + commitUpdateQueue(firstChild, updateQueue$87, instance$88); } break; case 5: @@ -6238,18 +6216,17 @@ function commitLayoutEffects(finishedWork, root) { case 4: break; case 12: - var onRender = fiber$jscomp$0.memoizedProps.onRender, - commitTime$90 = commitTime; + var onRender = firstChild.memoizedProps.onRender; + instance$88 = commitTime; current = null === current ? "mount" : "update"; "function" === typeof onRender && onRender( - fiber$jscomp$0.memoizedProps.id, + firstChild.memoizedProps.id, current, - fiber$jscomp$0.actualDuration, - fiber$jscomp$0.treeBaseDuration, - fiber$jscomp$0.actualStartTime, - commitTime$90, - finishedRoot.memoizedInteractions + firstChild.actualDuration, + firstChild.treeBaseDuration, + firstChild.actualStartTime, + instance$88 ); break; case 13: @@ -6265,42 +6242,38 @@ function commitLayoutEffects(finishedWork, root) { "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." ); } - if (fiber$jscomp$0.flags & 256) { - finishedRoot = void 0; - var ref = fiber$jscomp$0.ref; + if (firstChild.flags & 256) { + instance$88 = void 0; + var ref = firstChild.ref; if (null !== ref) { - var instance$jscomp$0 = fiber$jscomp$0.stateNode; - switch (fiber$jscomp$0.tag) { + var instance$jscomp$0 = firstChild.stateNode; + switch (firstChild.tag) { case 5: - finishedRoot = instance$jscomp$0; + instance$88 = instance$jscomp$0; break; default: - finishedRoot = instance$jscomp$0; + instance$88 = instance$jscomp$0; } "function" === typeof ref - ? ref(finishedRoot) - : (ref.current = finishedRoot); + ? ref(instance$88) + : (ref.current = instance$88); } } } catch (error) { - captureCommitPhaseError( - fiber$jscomp$0, - fiber$jscomp$0.return, - error - ); + captureCommitPhaseError(firstChild, firstChild.return, error); } } - if (fiber$jscomp$0 === fiber) { + if (firstChild === fiber) { nextEffect = null; break; } - finishedRoot = fiber$jscomp$0.sibling; - if (null !== finishedRoot) { - finishedRoot.return = fiber$jscomp$0.return; - nextEffect = finishedRoot; + instance$88 = firstChild.sibling; + if (null !== instance$88) { + instance$88.return = firstChild.return; + nextEffect = instance$88; break; } - nextEffect = fiber$jscomp$0.return; + nextEffect = firstChild.return; } } } @@ -6329,7 +6302,6 @@ var ceil = Math.ceil, pendingPassiveEffectsLanes = 0, nestedUpdateCount = 0, rootWithNestedUpdates = null, - spawnedWorkDuringRender = null, currentEventTime = -1, currentEventTransitionLane = 0; function requestEventTime() { @@ -6369,15 +6341,13 @@ function scheduleUpdateOnFiber(fiber, lane, eventTime) { markRootSuspended$1(root, workInProgressRootRenderLanes)); 1 === lane ? 0 !== (executionContext & 4) && 0 === (executionContext & 24) - ? (schedulePendingInteractions(root, lane), performSyncWorkOnRoot(root)) + ? performSyncWorkOnRoot(root) : (ensureRootIsScheduled(root, eventTime), - schedulePendingInteractions(root, lane), 0 === executionContext && 0 === (fiber.mode & 1) && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncCallbackQueue())) - : (ensureRootIsScheduled(root, eventTime), - schedulePendingInteractions(root, lane)); + includesLegacySyncCallbacks && flushSyncCallbacks())) + : ensureRootIsScheduled(root, eventTime); return root; } function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { @@ -6399,8 +6369,7 @@ function ensureRootIsScheduled(root, currentTime) { suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes, expirationTimes = root.expirationTimes, - lanes = root.pendingLanes, - expiredLanes = 0; + lanes = root.pendingLanes; 0 < lanes; ) { @@ -6410,10 +6379,9 @@ function ensureRootIsScheduled(root, currentTime) { if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) expirationTimes[index$6] = computeExpirationTime(lane, currentTime); - } else expirationTime <= currentTime && (expiredLanes |= lane); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } - 0 !== expiredLanes && markRootExpired(root, expiredLanes); suspendedLanes = getNextLanes( root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0 @@ -6428,11 +6396,17 @@ function ensureRootIsScheduled(root, currentTime) { ) { null != existingCallbackNode && cancelCallback(existingCallbackNode); if (1 === currentTime) - (existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), - null === syncQueue - ? (syncQueue = [existingCallbackNode]) - : syncQueue.push(existingCallbackNode), - scheduleCallback(ImmediatePriority, flushSyncCallbackQueue), + 0 === root.tag + ? ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), + (includesLegacySyncCallbacks = !0), + null === syncQueue + ? (syncQueue = [existingCallbackNode]) + : syncQueue.push(existingCallbackNode)) + : ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)), + null === syncQueue + ? (syncQueue = [existingCallbackNode]) + : syncQueue.push(existingCallbackNode)), + scheduleCallback(ImmediatePriority, flushSyncCallbacks), (existingCallbackNode = null); else { switch (lanesToEventPriority(suspendedLanes)) { @@ -6473,47 +6447,43 @@ function performConcurrentWorkOnRoot(root, didTimeout) { root === workInProgressRoot ? workInProgressRootRenderLanes : 0 ); if (0 === lanes) return null; - if (didTimeout) - return ( - markRootExpired(root, lanes), ensureRootIsScheduled(root, now()), null - ); - var lanes$jscomp$0 = lanes; - didTimeout = executionContext; - executionContext |= 8; - var prevDispatcher = pushDispatcher(); - if ( - workInProgressRoot !== root || - workInProgressRootRenderLanes !== lanes$jscomp$0 - ) - (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes$jscomp$0), - startWorkOnPendingInteractions(root, lanes$jscomp$0); - lanes$jscomp$0 = pushInteractions(root); - do - try { - workLoopConcurrent(); - break; - } catch (thrownValue) { - handleError(root, thrownValue); - } - while (1); - resetContextDependencies(); - tracing.__interactionsRef.current = lanes$jscomp$0; - ReactCurrentDispatcher$2.current = prevDispatcher; - executionContext = didTimeout; - null !== workInProgress - ? (didTimeout = 0) - : ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - (didTimeout = workInProgressRootExitStatus)); + var JSCompiler_inline_result = 0 !== (lanes & root.expiredLanes) ? !1 : !0; + if (JSCompiler_inline_result && !didTimeout) { + didTimeout = lanes; + JSCompiler_inline_result = executionContext; + executionContext |= 8; + var prevDispatcher = pushDispatcher(); + if ( + workInProgressRoot !== root || + workInProgressRootRenderLanes !== didTimeout + ) + (workInProgressRootRenderTargetTime = now() + 500), + prepareFreshStack(root, didTimeout); + do + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + while (1); + resetContextDependencies(); + ReactCurrentDispatcher$2.current = prevDispatcher; + executionContext = JSCompiler_inline_result; + null !== workInProgress + ? (didTimeout = 0) + : ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + (didTimeout = workInProgressRootExitStatus)); + } else didTimeout = renderRootSync(root, lanes); if (0 !== didTimeout) { 2 === didTimeout && ((executionContext |= 32), root.hydrate && (root.hydrate = !1), - (prevDispatcher = getLanesToRetrySynchronouslyOnError(root)), - 0 !== prevDispatcher && - ((lanes = prevDispatcher), - (didTimeout = renderRootSync(root, prevDispatcher)))); + (JSCompiler_inline_result = getLanesToRetrySynchronouslyOnError(root)), + 0 !== JSCompiler_inline_result && + ((lanes = JSCompiler_inline_result), + (didTimeout = renderRootSync(root, JSCompiler_inline_result)))); if (1 === didTimeout) throw ((originalCallbackNode = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -6537,10 +6507,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { 10 < didTimeout) ) { if (0 !== getNextLanes(root, 0)) break; - prevDispatcher = root.suspendedLanes; - if ((prevDispatcher & lanes) !== lanes) { + JSCompiler_inline_result = root.suspendedLanes; + if ((JSCompiler_inline_result & lanes) !== lanes) { requestEventTime(); - root.pingedLanes |= root.suspendedLanes & prevDispatcher; + root.pingedLanes |= root.suspendedLanes & JSCompiler_inline_result; break; } root.timeoutHandle = scheduleTimeout( @@ -6555,14 +6525,15 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended$1(root, lanes); if ((lanes & 4194240) === lanes) break; didTimeout = root.eventTimes; - for (prevDispatcher = -1; 0 < lanes; ) { + for (JSCompiler_inline_result = -1; 0 < lanes; ) { var index$5 = 31 - clz32(lanes); - lanes$jscomp$0 = 1 << index$5; + prevDispatcher = 1 << index$5; index$5 = didTimeout[index$5]; - index$5 > prevDispatcher && (prevDispatcher = index$5); - lanes &= ~lanes$jscomp$0; + index$5 > JSCompiler_inline_result && + (JSCompiler_inline_result = index$5); + lanes &= ~prevDispatcher; } - lanes = prevDispatcher; + lanes = JSCompiler_inline_result; lanes = now() - lanes; lanes = (120 > lanes @@ -6616,11 +6587,7 @@ function performSyncWorkOnRoot(root) { throw Error("Should not already be working."); flushPassiveEffects(); var lanes = getNextLanes(root, 0); - if (0 !== (lanes & 1)) - root === workInProgressRoot && - 0 !== (lanes & workInProgressRootRenderLanes) && - (lanes = workInProgressRootRenderLanes); - else return ensureRootIsScheduled(root, now()), null; + if (0 === (lanes & 1)) return ensureRootIsScheduled(root, now()), null; var exitStatus = renderRootSync(root, lanes); if (0 !== root.tag && 2 === exitStatus) { executionContext |= 32; @@ -6713,7 +6680,6 @@ function prepareFreshStack(root, lanes) { } interleavedQueues = null; } - spawnedWorkDuringRender = null; } function handleError(root$jscomp$0, thrownValue) { do { @@ -6908,18 +6874,12 @@ function pushDispatcher() { ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; } -function pushInteractions(root) { - var prevInteractions = tracing.__interactionsRef.current; - tracing.__interactionsRef.current = root.memoizedInteractions; - return prevInteractions; -} function renderRootSync(root, lanes) { var prevExecutionContext = executionContext; executionContext |= 8; var prevDispatcher = pushDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - prepareFreshStack(root, lanes), startWorkOnPendingInteractions(root, lanes); - lanes = pushInteractions(root); + (workInProgressRoot === root && workInProgressRootRenderLanes === lanes) || + prepareFreshStack(root, lanes); do try { workLoopSync(); @@ -6929,7 +6889,6 @@ function renderRootSync(root, lanes) { } while (1); resetContextDependencies(); - tracing.__interactionsRef.current = lanes; executionContext = prevExecutionContext; ReactCurrentDispatcher$2.current = prevDispatcher; if (null !== workInProgress) @@ -7058,7 +7017,6 @@ function commitRootImpl(root, renderPriorityLevel) { currentUpdatePriority = 1; var prevExecutionContext = executionContext; executionContext |= 16; - var prevInteractions = pushInteractions(root); ReactCurrentOwner$2.current = null; commitBeforeMutationEffects(root, finishedWork); commitTime = now$1(); @@ -7066,33 +7024,16 @@ function commitRootImpl(root, renderPriorityLevel) { root.current = finishedWork; commitLayoutEffects(finishedWork, root, lanes); requestPaint(); - tracing.__interactionsRef.current = prevInteractions; executionContext = prevExecutionContext; currentUpdatePriority = previousPriority; ReactCurrentBatchConfig$2.transition = remainingLanes; } else (root.current = finishedWork), (commitTime = now$1()); - if ((previousPriority = rootDoesHavePassiveEffects)) - (rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes); + rootDoesHavePassiveEffects && + ((rootDoesHavePassiveEffects = !1), + (rootWithPendingPassiveEffects = root), + (pendingPassiveEffectsLanes = lanes)); remainingLanes = root.pendingLanes; - if (0 !== remainingLanes) { - if (null !== spawnedWorkDuringRender) - for ( - prevExecutionContext = spawnedWorkDuringRender, - spawnedWorkDuringRender = null, - prevInteractions = 0; - prevInteractions < prevExecutionContext.length; - prevInteractions++ - ) - scheduleInteractions( - root, - prevExecutionContext[prevInteractions], - root.memoizedInteractions - ); - schedulePendingInteractions(root, remainingLanes); - } else legacyErrorBoundariesThatAlreadyFailed = null; - previousPriority || finishPendingInteractions(root, lanes); + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); 0 !== (remainingLanes & 1) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -7109,7 +7050,7 @@ function commitRootImpl(root, renderPriorityLevel) { 0 !== (pendingPassiveEffectsLanes & 1) && 0 !== root.tag && flushPassiveEffects(); - flushSyncCallbackQueue(); + flushSyncCallbacks(); return null; } function flushPassiveEffects() { @@ -7124,14 +7065,12 @@ function flushPassiveEffects() { var JSCompiler_inline_result = !1; else { renderPriority = rootWithPendingPassiveEffects; - var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; if (0 !== (executionContext & 24)) throw Error("Cannot flush passive effects while already rendering."); var prevExecutionContext = executionContext; executionContext |= 16; - var prevInteractions = pushInteractions(renderPriority); for (nextEffect = renderPriority.current; null !== nextEffect; ) { var fiber = nextEffect, child = fiber.child; @@ -7240,10 +7179,8 @@ function flushPassiveEffects() { nextEffect = deletions.return; } } - tracing.__interactionsRef.current = prevInteractions; - finishPendingInteractions(renderPriority, lanes); executionContext = prevExecutionContext; - flushSyncCallbackQueue(); + flushSyncCallbacks(); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -7269,8 +7206,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { rootFiber = markUpdateLaneFromFiberToRoot(rootFiber, 1); null !== rootFiber && (markRootUpdated(rootFiber, 1, sourceFiber), - ensureRootIsScheduled(rootFiber, sourceFiber), - schedulePendingInteractions(rootFiber, 1)); + ensureRootIsScheduled(rootFiber, sourceFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -7311,8 +7247,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { ); null !== nearestMountedAncestor && (markRootUpdated(nearestMountedAncestor, 1, sourceFiber), - ensureRootIsScheduled(nearestMountedAncestor, sourceFiber), - schedulePendingInteractions(nearestMountedAncestor, 1)); + ensureRootIsScheduled(nearestMountedAncestor, sourceFiber)); break; } } @@ -7334,7 +7269,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { ? prepareFreshStack(root, 0) : (workInProgressRootPingedLanes |= pingedLanes)); ensureRootIsScheduled(root, wakeable); - schedulePendingInteractions(root, pingedLanes); } function resolveRetryWakeable(boundaryFiber, wakeable) { var retryCache = boundaryFiber.stateNode; @@ -7350,8 +7284,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, wakeable); null !== boundaryFiber && (markRootUpdated(boundaryFiber, wakeable, retryCache), - ensureRootIsScheduled(boundaryFiber, retryCache), - schedulePendingInteractions(boundaryFiber, wakeable)); + ensureRootIsScheduled(boundaryFiber, retryCache)); } var beginWork$1; beginWork$1 = function(current, workInProgress, renderLanes) { @@ -7864,93 +7797,6 @@ beginWork$1 = function(current, workInProgress, renderLanes) { "). This error is likely caused by a bug in React. Please file an issue." ); }; -function markSpawnedWork(lane) { - null === spawnedWorkDuringRender - ? (spawnedWorkDuringRender = [lane]) - : spawnedWorkDuringRender.push(lane); -} -function scheduleInteractions(root, lane, interactions) { - if (0 < interactions.size) { - var pendingInteractionMap = root.pendingInteractionMap, - pendingInteractions = pendingInteractionMap.get(lane); - null != pendingInteractions - ? interactions.forEach(function(interaction) { - pendingInteractions.has(interaction) || interaction.__count++; - pendingInteractions.add(interaction); - }) - : (pendingInteractionMap.set(lane, new Set(interactions)), - interactions.forEach(function(interaction) { - interaction.__count++; - })); - pendingInteractionMap = tracing.__subscriberRef.current; - if (null !== pendingInteractionMap) - pendingInteractionMap.onWorkScheduled( - interactions, - 1e3 * lane + root.interactionThreadID - ); - } -} -function schedulePendingInteractions(root, lane) { - scheduleInteractions(root, lane, tracing.__interactionsRef.current); -} -function startWorkOnPendingInteractions(root, lanes) { - var interactions = new Set(); - root.pendingInteractionMap.forEach(function( - scheduledInteractions, - scheduledLane - ) { - 0 !== (lanes & scheduledLane) && - scheduledInteractions.forEach(function(interaction) { - return interactions.add(interaction); - }); - }); - root.memoizedInteractions = interactions; - if (0 < interactions.size) { - var subscriber = tracing.__subscriberRef.current; - if (null !== subscriber) { - root = 1e3 * lanes + root.interactionThreadID; - try { - subscriber.onWorkStarted(interactions, root); - } catch (error) { - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } - } - } -} -function finishPendingInteractions(root, committedLanes) { - var remainingLanesAfterCommit = root.pendingLanes; - try { - var subscriber = tracing.__subscriberRef.current; - if (null !== subscriber && 0 < root.memoizedInteractions.size) - subscriber.onWorkStopped( - root.memoizedInteractions, - 1e3 * committedLanes + root.interactionThreadID - ); - } catch (error) { - scheduleCallback(ImmediatePriority, function() { - throw error; - }); - } finally { - var pendingInteractionMap = root.pendingInteractionMap; - pendingInteractionMap.forEach(function(scheduledInteractions, lane) { - 0 === (remainingLanesAfterCommit & lane) && - (pendingInteractionMap.delete(lane), - scheduledInteractions.forEach(function(interaction) { - interaction.__count--; - if (null !== subscriber && 0 === interaction.__count) - try { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } catch (error$98) { - scheduleCallback(ImmediatePriority, function() { - throw error$98; - }); - } - })); - }); - } -} function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -8157,11 +8003,8 @@ function FiberRootNode(containerInfo, tag, hydrate) { this.callbackPriority = 0; this.eventTimes = createLaneMap(0); this.expirationTimes = createLaneMap(-1); - this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; + this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; this.entanglements = createLaneMap(0); - this.interactionThreadID = tracing.unstable_getThreadID(); - this.memoizedInteractions = new Set(); - this.pendingInteractionMap = new Map(); } function createPortal(children, containerInfo, implementation) { var key = @@ -8279,11 +8122,11 @@ batchedUpdatesImpl = function(fn, a) { (executionContext = prevExecutionContext), 0 === executionContext && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncCallbackQueue()); + includesLegacySyncCallbacks && flushSyncCallbacks()); } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1006 = { + devToolsConfig$jscomp$inline_1008 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, version: "17.0.3", @@ -8301,11 +8144,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1272 = { - bundleType: devToolsConfig$jscomp$inline_1006.bundleType, - version: devToolsConfig$jscomp$inline_1006.version, - rendererPackageName: devToolsConfig$jscomp$inline_1006.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1006.rendererConfig, +var internals$jscomp$inline_1269 = { + bundleType: devToolsConfig$jscomp$inline_1008.bundleType, + version: devToolsConfig$jscomp$inline_1008.version, + rendererPackageName: devToolsConfig$jscomp$inline_1008.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1008.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8320,7 +8163,7 @@ var internals$jscomp$inline_1272 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1006.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1008.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, @@ -8330,16 +8173,16 @@ var internals$jscomp$inline_1272 = { reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1273 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1270 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1273.isDisabled && - hook$jscomp$inline_1273.supportsFiber + !hook$jscomp$inline_1270.isDisabled && + hook$jscomp$inline_1270.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1273.inject( - internals$jscomp$inline_1272 + (rendererID = hook$jscomp$inline_1270.inject( + internals$jscomp$inline_1269 )), - (injectedHook = hook$jscomp$inline_1273); + (injectedHook = hook$jscomp$inline_1270); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { From c3d765883a3c55dafb22759211d9b0fa4ea1c535 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Wed, 28 Apr 2021 14:48:36 -0700 Subject: [PATCH 093/259] Fix frames for in text links Summary: Changelog: [internal] `accessibilityFrame` needs to take scrolling position into account. To fix that, we calculate the position dynamically. Reviewed By: mdvacca Differential Revision: D28056789 fbshipit-source-id: 3247b3e6fd64934e99563de83d163f657828e933 --- .../ComponentViews/Text/RCTAccessibilityElement.h | 7 +++++++ .../ComponentViews/Text/RCTAccessibilityElement.mm | 6 +++++- .../Text/RCTParagraphComponentAccessibilityProvider.mm | 9 ++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h b/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h index 905844d9f5bcdd..9a814731a9c2e5 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h @@ -11,6 +11,13 @@ NS_ASSUME_NONNULL_BEGIN @interface RCTAccessibilityElement : UIAccessibilityElement +/* + * Frame of the accessibility element in parent coordinate system. + * Set to `CGRectZero` to use size of the container. + * + * Default value: `CGRectZero`. + */ +@property (nonatomic, assign) CGRect frame; @end NS_ASSUME_NONNULL_END diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm b/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm index 751c1817bad495..d9dcfd73c918a5 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm @@ -12,7 +12,11 @@ @implementation RCTAccessibilityElement - (CGRect)accessibilityFrame { UIView *container = (UIView *)self.accessibilityContainer; - return UIAccessibilityConvertFrameToScreenCoordinates(container.bounds, container); + if (CGRectEqualToRect(_frame, CGRectZero)) { + return UIAccessibilityConvertFrameToScreenCoordinates(container.bounds, container); + } else { + return UIAccessibilityConvertFrameToScreenCoordinates(_frame, container); + } } @end diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm index 08ae2cafa1761d..6d456280cbabe9 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm @@ -62,7 +62,7 @@ - (instancetype)initWithString:(facebook::react::AttributedString)attributedStri accessibilityLabel = RCTNSStringFromString(_attributedString.getString()); } // add first element has the text for the whole textview in order to read out the whole text - UIAccessibilityElement *firstElement = + RCTAccessibilityElement *firstElement = [[RCTAccessibilityElement alloc] initWithAccessibilityContainer:_view.superview]; firstElement.isAccessibilityElement = YES; firstElement.accessibilityTraits = UIAccessibilityTraitStaticText; @@ -89,8 +89,8 @@ - (instancetype)initWithString:(facebook::react::AttributedString)attributedStri truncatedText = fragmentText; return; } - UIAccessibilityElement *element = - [[UIAccessibilityElement alloc] initWithAccessibilityContainer:self->_view]; + RCTAccessibilityElement *element = + [[RCTAccessibilityElement alloc] initWithAccessibilityContainer:self->_view]; element.isAccessibilityElement = YES; if ([value isEqualToString:@"link"]) { element.accessibilityTraits = UIAccessibilityTraitLink; @@ -100,8 +100,7 @@ - (instancetype)initWithString:(facebook::react::AttributedString)attributedStri numberOfButtons++; } element.accessibilityLabel = fragmentText; - element.accessibilityFrame = - UIAccessibilityConvertFrameToScreenCoordinates(fragmentRect, self->_view); + element.frame = fragmentRect; [elements addObject:element]; }]; From 2b49664cb8667a7381936746c8006c56968143c3 Mon Sep 17 00:00:00 2001 From: ananta Date: Wed, 28 Apr 2021 15:28:35 -0700 Subject: [PATCH 094/259] Add flow types to AccessibilityExample.js (#31384) Summary: [AccessibilityExample.js](https://github.com/facebook/react-native/blob/master/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js) does not have proper Flow types. Without Flow typing enforced, it is easy for bugs to be introduced when making changes to this file. This pull request enforces Flow typing in this file. ## Changelog [General] [Fixed] - Fixed return type of `AccessibilityRoleAndStateExample` [General] [Added] - Added Flow Types to AccessibilityExample.js Pull Request resolved: https://github.com/facebook/react-native/pull/31384 Test Plan: Before: ![Screen Shot 2021-04-19 at 7 39 58 PM](https://user-images.githubusercontent.com/12180395/115248265-42c6b200-a147-11eb-8dad-058f646a1550.png) After: ![Screen Shot 2021-04-19 at 7 40 10 PM](https://user-images.githubusercontent.com/12180395/115248284-465a3900-a147-11eb-8bff-4050ce6bd806.png) Reviewed By: yungsters, nadiia Differential Revision: D28004170 Pulled By: kacieb fbshipit-source-id: 77bc44bbaf7a19c034a92a2daef302d5dc6078fa --- .../Accessibility/AccessibilityExample.js | 108 +++++++++++++----- 1 file changed, 80 insertions(+), 28 deletions(-) diff --git a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js index 3f6611d05fc75d..5a40e051725831 100644 --- a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js +++ b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. * * @format + * @flow */ 'use strict'; @@ -23,6 +24,7 @@ const { StyleSheet, Platform, } = require('react-native'); +import type {EventSubscription} from 'react-native/Libraries/vendor/emitter/EventEmitter'; const RNTesterBlock = require('../../components/RNTesterBlock'); @@ -60,8 +62,8 @@ const styles = StyleSheet.create({ }, }); -class AccessibilityExample extends React.Component { - render() { +class AccessibilityExample extends React.Component<{}> { + render(): React.Node { return ( @@ -101,7 +103,7 @@ class AccessibilityExample extends React.Component { {/* Android screen readers will say the accessibility hint instead of the text - since the view doesn't have a label. */} + since the view doesn't have a label. */} This is text one. @@ -178,7 +180,12 @@ class AccessibilityExample extends React.Component { } } -class CheckboxExample extends React.Component { +class CheckboxExample extends React.Component< + {}, + { + checkboxState: boolean | 'mixed', + }, +> { state = { checkboxState: true, }; @@ -212,7 +219,12 @@ class CheckboxExample extends React.Component { } } -class SwitchExample extends React.Component { +class SwitchExample extends React.Component< + {}, + { + switchState: boolean, + }, +> { state = { switchState: true, }; @@ -239,18 +251,27 @@ class SwitchExample extends React.Component { } } -class SelectionExample extends React.Component { - constructor(props) { +class SelectionExample extends React.Component< + {}, + { + isSelected: boolean, + isEnabled: boolean, + }, +> { + constructor(props: {}) { super(props); - this.selectableElement = React.createRef(); + this.selectableElement = createRef(); } + selectableElement: { + current: React.ElementRef | null, + }; state = { isSelected: true, isEnabled: false, }; - render() { + render(): React.Node { const {isSelected, isEnabled} = this.state; let accessibilityHint = 'click me to select'; if (isSelected) { @@ -311,7 +332,12 @@ class SelectionExample extends React.Component { } } -class ExpandableElementExample extends React.Component { +class ExpandableElementExample extends React.Component< + {}, + { + expandState: boolean, + }, +> { state = { expandState: false, }; @@ -337,7 +363,14 @@ class ExpandableElementExample extends React.Component { } } -class NestedCheckBox extends React.Component { +class NestedCheckBox extends React.Component< + {}, + { + checkbox1: boolean | 'mixed', + checkbox2: boolean | 'mixed', + checkbox3: boolean | 'mixed', + }, +> { state = { checkbox1: false, checkbox2: false, @@ -446,7 +479,7 @@ class NestedCheckBox extends React.Component { } class AccessibilityRoleAndStateExample extends React.Component<{}> { - render() { + render(): React.Node { return ( { } } -class AccessibilityActionsExample extends React.Component { - render() { +class AccessibilityActionsExample extends React.Component<{}> { + render(): React.Node { return ( @@ -647,13 +680,17 @@ class AccessibilityActionsExample extends React.Component { } } -class FakeSliderExample extends React.Component { - state = { +type FakeSliderExampleState = { + current: number, + textualValue: 'center' | 'left' | 'right', +}; +class FakeSliderExample extends React.Component<{}, FakeSliderExampleState> { + state: FakeSliderExampleState = { current: 50, textualValue: 'center', }; - increment = () => { + increment: () => void = () => { let newValue = this.state.current + 2; if (newValue > 100) { newValue = 100; @@ -663,7 +700,7 @@ class FakeSliderExample extends React.Component { }); }; - decrement = () => { + decrement: () => void = () => { let newValue = this.state.current - 2; if (newValue < 0) { newValue = 0; @@ -673,7 +710,7 @@ class FakeSliderExample extends React.Component { }); }; - render() { + render(): React.Node { return ( { _handleOnPress = () => AccessibilityInfo.announceForAccessibility('Announcement Test'); - render() { + render(): React.Node { return (