From 6936e4eeca8c293f36648b0f841031c0f3f0a842 Mon Sep 17 00:00:00 2001 From: tboba Date: Wed, 27 Mar 2024 10:22:16 +0100 Subject: [PATCH 01/28] Add better algorithm for resolving paths in resolveRequest --- FabricTestExample/ios/Podfile.lock | 2 +- FabricTestExample/metro.config.js | 51 ++-- FabricTestExample/yarn.lock | 430 +++++++++++++++++++++++++++-- react-navigation | 2 +- 4 files changed, 433 insertions(+), 52 deletions(-) diff --git a/FabricTestExample/ios/Podfile.lock b/FabricTestExample/ios/Podfile.lock index f74a41209f..4088d99296 100644 --- a/FabricTestExample/ios/Podfile.lock +++ b/FabricTestExample/ios/Podfile.lock @@ -1504,7 +1504,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 - DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 + DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 FBLazyVector: fa59cfcc9893760f58a0af6f5c25d5736c6d0b14 fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 diff --git a/FabricTestExample/metro.config.js b/FabricTestExample/metro.config.js index c3dd54df33..52d508ff53 100644 --- a/FabricTestExample/metro.config.js +++ b/FabricTestExample/metro.config.js @@ -1,9 +1,12 @@ const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); +const fs = require('fs'); const path = require('path'); const exclusionList = require('metro-config/src/defaults/exclusionList'); const escape = require('escape-string-regexp'); + const pack = require('../package.json'); +const projectPack = require('./package.json'); // react-native-screens root directory const rnsRoot = path.resolve(__dirname, '..'); @@ -17,6 +20,8 @@ const modules = [ ...Object.keys(pack.peerDependencies), ]; +const resolvedExts = ['.ts', '.tsx', '.js', '.jsx']; + const config = { projectRoot: __dirname, watchFolders: [rnsRoot], @@ -44,36 +49,42 @@ const config = { // to various errors. To mitigate this we define below custom request resolver, hijacking requests to conflicting modules and manually // resolving appropriate files. **Most likely** this can be achieved by proper usage of blockList but I found this method working ¯\_(ツ)_/¯ resolveRequest: (context, moduleName, platform) => { - if (moduleName === 'react' || moduleName === 'react-native') { + if (moduleName === 'react-native-screens') { return { - filePath: path.join( - __dirname, - 'node_modules', - moduleName, - 'index.js', - ), + filePath: path.join(rnsRoot, 'src', 'index.tsx'), type: 'sourceFile', }; } - if (moduleName === 'react-native-safe-area-context') { - return { - filePath: path.join( + if (moduleName in projectPack.dependencies) { + for (const ext of resolvedExts) { + const possiblePath = path.join( + __dirname, + 'node_modules', + moduleName, + `index${ext}`, + ); + + const possibleSrcPath = path.join( __dirname, 'node_modules', moduleName, 'src', - 'index.tsx', - ), - type: 'sourceFile', - }; - } + `index${ext}`, + ); - if (moduleName === 'react-native-screens') { - return { - filePath: path.join(rnsRoot, 'src', 'index.tsx'), - type: 'sourceFile', - }; + if (fs.existsSync(possiblePath)) { + return { + filePath: possiblePath, + type: 'sourceFile', + }; + } else if (fs.existsSync(possibleSrcPath)) { + return { + filePath: possibleSrcPath, + type: 'sourceFile', + }; + } + } } // Optionally, chain to the standard Metro resolver. diff --git a/FabricTestExample/yarn.lock b/FabricTestExample/yarn.lock index 8e47124dd1..7899cce4f5 100644 --- a/FabricTestExample/yarn.lock +++ b/FabricTestExample/yarn.lock @@ -23,6 +23,11 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" +"@babel/compat-data@^7.20.5": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.1.tgz#31c1f66435f2a9c329bb5716a6d6186c516c3742" + integrity sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA== + "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.23.3", "@babel/compat-data@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" @@ -82,7 +87,7 @@ dependencies: "@babel/types" "^7.22.15" -"@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6": +"@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== @@ -108,6 +113,21 @@ "@babel/helper-split-export-declaration" "^7.22.6" semver "^6.3.1" +"@babel/helper-create-class-features-plugin@^7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.1.tgz#db58bf57137b623b916e24874ab7188d93d7f68f" + integrity sha512-1yJa9dX9g//V6fDebXoEfEsxkZHk3Hcbm+zLhyu6qVgYFLvmTALTeV+jNU9e5RnYtioBrGEOdoI2joMSNQ/+aA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-member-expression-to-functions" "^7.23.0" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.24.1" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" + "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1" @@ -139,7 +159,7 @@ lodash.debounce "^4.0.8" resolve "^1.14.2" -"@babel/helper-environment-visitor@^7.22.20": +"@babel/helper-environment-visitor@^7.18.9", "@babel/helper-environment-visitor@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== @@ -173,6 +193,13 @@ dependencies: "@babel/types" "^7.22.15" +"@babel/helper-module-imports@^7.24.1", "@babel/helper-module-imports@^7.24.3": + version "7.24.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz#6ac476e6d168c7c23ff3ba3cf4f7841d46ac8128" + integrity sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg== + dependencies: + "@babel/types" "^7.24.0" + "@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" @@ -196,7 +223,12 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== -"@babel/helper-remap-async-to-generator@^7.22.20": +"@babel/helper-plugin-utils@^7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz#945681931a52f15ce879fd5b86ce2dae6d3d7f2a" + integrity sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w== + +"@babel/helper-remap-async-to-generator@^7.18.9", "@babel/helper-remap-async-to-generator@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz#7b68e1cb4fa964d2996fd063723fb48eca8498e0" integrity sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw== @@ -214,6 +246,15 @@ "@babel/helper-member-expression-to-functions" "^7.22.15" "@babel/helper-optimise-call-expression" "^7.22.5" +"@babel/helper-replace-supers@^7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz#7085bd19d4a0b7ed8f405c1ed73ccb70f323abc1" + integrity sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-member-expression-to-functions" "^7.23.0" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-simple-access@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" @@ -282,6 +323,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.9.tgz#7b903b6149b0f8fa7ad564af646c4c38a77fc44b" integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== +"@babel/parser@^7.24.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.1.tgz#1e416d3627393fab1cb5b0f2f1796a100ae9133a" + integrity sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" @@ -306,7 +352,17 @@ "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-proposal-class-properties@^7.13.0": +"@babel/plugin-proposal-async-generator-functions@^7.0.0": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" + integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-remap-async-to-generator" "^7.18.9" + "@babel/plugin-syntax-async-generators" "^7.8.4" + +"@babel/plugin-proposal-class-properties@^7.13.0", "@babel/plugin-proposal-class-properties@^7.18.0": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== @@ -314,7 +370,23 @@ "@babel/helper-create-class-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8": +"@babel/plugin-proposal-export-default-from@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.24.1.tgz#d242019488277c9a5a8035e5b70de54402644b89" + integrity sha512-+0hrgGGV3xyYIjOrD/bUZk/iUwOIGuoANfRfVg1cPhYBxF+TIXSEcc42DqzBICmWsnAQ+SfKedY0bj8QD+LuMg== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-syntax-export-default-from" "^7.24.1" + +"@babel/plugin-proposal-logical-assignment-operators@^7.18.0": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" + integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + +"@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8", "@babel/plugin-proposal-nullish-coalescing-operator@^7.18.0": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== @@ -322,7 +394,34 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.13.12": +"@babel/plugin-proposal-numeric-separator@^7.0.0": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" + integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + +"@babel/plugin-proposal-object-rest-spread@^7.20.0": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" + integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== + dependencies: + "@babel/compat-data" "^7.20.5" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.20.7" + +"@babel/plugin-proposal-optional-catch-binding@^7.0.0": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" + integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + +"@babel/plugin-proposal-optional-chaining@^7.13.12", "@babel/plugin-proposal-optional-chaining@^7.20.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz#886f5c8978deb7d30f678b2e24346b287234d3ea" integrity sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA== @@ -364,13 +463,20 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-dynamic-import@^7.8.3": +"@babel/plugin-syntax-dynamic-import@^7.8.0", "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-export-default-from@^7.0.0", "@babel/plugin-syntax-export-default-from@^7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.24.1.tgz#a92852e694910ae4295e6e51e87b83507ed5e6e8" + integrity sha512-cNXSxv9eTkGUtd0PsNMK8Yx5xeScxfpWOUAxE+ZPAXXEcAMOC3fk7LRdXq5fvpra2pLx2p1YtkAhpUbB2SwaRA== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-syntax-export-namespace-from@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" @@ -378,6 +484,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" +"@babel/plugin-syntax-flow@^7.12.1", "@babel/plugin-syntax-flow@^7.18.0", "@babel/plugin-syntax-flow@^7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.24.1.tgz#875c25e3428d7896c87589765fc8b9d32f24bd8d" + integrity sha512-sxi2kLTI5DeW5vDtMUsk4mTPwvlUDbjOnoWayhynCwrw4QXRld4QEYwqzY8JmQXaJUtgUuCIurtSRH5sn4c7mA== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-syntax-flow@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.23.3.tgz#084564e0f3cc21ea6c70c44cff984a1c0509729a" @@ -427,7 +540,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": +"@babel/plugin-syntax-nullish-coalescing-operator@^7.0.0", "@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== @@ -455,7 +568,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-optional-chaining@^7.8.3": +"@babel/plugin-syntax-optional-chaining@^7.0.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== @@ -483,6 +596,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-syntax-typescript@^7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz#b3bcc51f396d15f3591683f90239de143c076844" + integrity sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" @@ -491,6 +611,13 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" +"@babel/plugin-transform-arrow-functions@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.1.tgz#2bf263617060c9cc45bcdbf492b8cc805082bf27" + integrity sha512-ngT/3NkRhsaep9ck9uj2Xhv9+xB1zShY3tM3g6om4xxCELwCDN4g4Aq5dRn48+0hasAql7s2hdBOysCfNpr4fw== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-arrow-functions@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz#94c6dcfd731af90f27a79509f9ab7fb2120fc38b" @@ -508,6 +635,15 @@ "@babel/helper-remap-async-to-generator" "^7.22.20" "@babel/plugin-syntax-async-generators" "^7.8.4" +"@babel/plugin-transform-async-to-generator@^7.20.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.1.tgz#0e220703b89f2216800ce7b1c53cb0cf521c37f4" + integrity sha512-AawPptitRXp1y0n4ilKcGbRYWfbbzFWz2NqNu7dacYDtFtz0CMjG64b3LQsb3KIgnf4/obcUL78hfaOS7iCUfw== + dependencies: + "@babel/helper-module-imports" "^7.24.1" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-remap-async-to-generator" "^7.22.20" + "@babel/plugin-transform-async-to-generator@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz#d1f513c7a8a506d43f47df2bf25f9254b0b051fa" @@ -524,6 +660,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-block-scoping@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.1.tgz#27af183d7f6dad890531256c7a45019df768ac1f" + integrity sha512-h71T2QQvDgM2SmT29UYU6ozjMlAt7s7CSs5Hvy8f8cf/GM/Z4a2zMfN+fjVGaieeCrXR3EdQl6C4gQG+OgmbKw== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-block-scoping@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz#b2d38589531c6c80fbe25e6b58e763622d2d3cf5" @@ -548,6 +691,20 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-class-static-block" "^7.14.5" +"@babel/plugin-transform-classes@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.1.tgz#5bc8fc160ed96378184bc10042af47f50884dcb1" + integrity sha512-ZTIe3W7UejJd3/3R4p7ScyyOoafetUShSf4kCqV0O7F/RiHxVj/wRaRnQlrGwflvcehNA8M42HkAiEDYZu2F1Q== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-compilation-targets" "^7.23.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-replace-supers" "^7.24.1" + "@babel/helper-split-export-declaration" "^7.22.6" + globals "^11.1.0" + "@babel/plugin-transform-classes@^7.23.8": version "7.23.8" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.8.tgz#d08ae096c240347badd68cdf1b6d1624a6435d92" @@ -562,6 +719,14 @@ "@babel/helper-split-export-declaration" "^7.22.6" globals "^11.1.0" +"@babel/plugin-transform-computed-properties@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.1.tgz#bc7e787f8e021eccfb677af5f13c29a9934ed8a7" + integrity sha512-5pJGVIUfJpOS+pAqBQd+QMaTD2vCL/HcePooON6pDpHgRp4gNRmzyHTPIkXntwKsq3ayUFVfJaIKPw2pOkOcTw== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/template" "^7.24.0" + "@babel/plugin-transform-computed-properties@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz#652e69561fcc9d2b50ba4f7ac7f60dcf65e86474" @@ -570,6 +735,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/template" "^7.22.15" +"@babel/plugin-transform-destructuring@^7.20.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.1.tgz#b1e8243af4a0206841973786292b8c8dd8447345" + integrity sha512-ow8jciWqNxR3RYbSNVuF4U2Jx130nwnBnhRw6N6h1bOejNkABmcI5X5oz29K4alWX7vf1C+o6gtKXikzRKkVdw== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-destructuring@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz#8c9ee68228b12ae3dff986e56ed1ba4f3c446311" @@ -616,6 +788,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" +"@babel/plugin-transform-flow-strip-types@^7.20.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.24.1.tgz#fa8d0a146506ea195da1671d38eed459242b2dcc" + integrity sha512-iIYPIWt3dUmUKKE10s3W+jsQ3icFkw0JyRVyY1B7G4yK/nngAOHLVx8xlhA6b/Jzl/Y0nis8gjqhqKtRDQqHWQ== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-syntax-flow" "^7.24.1" + "@babel/plugin-transform-flow-strip-types@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.23.3.tgz#cfa7ca159cc3306fab526fc67091556b51af26ff" @@ -632,6 +812,15 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" +"@babel/plugin-transform-function-name@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.1.tgz#8cba6f7730626cc4dfe4ca2fa516215a0592b361" + integrity sha512-BXmDZpPlh7jwicKArQASrj8n22/w6iymRnvHYYd2zO30DbE277JO20/7yXJT3QxDPtiQiOxQBbZH4TpivNXIxA== + dependencies: + "@babel/helper-compilation-targets" "^7.23.6" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-function-name@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz#8f424fcd862bf84cb9a1a6b42bc2f47ed630f8dc" @@ -649,6 +838,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-json-strings" "^7.8.3" +"@babel/plugin-transform-literals@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.1.tgz#0a1982297af83e6b3c94972686067df588c5c096" + integrity sha512-zn9pwz8U7nCqOYIiBaOxoQOtYmMODXTJnkxG4AtX8fPmnCRYWBOHD0qcpwS9e2VDSp1zNJYpdnFMIKb8jmwu6g== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-literals@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz#8214665f00506ead73de157eba233e7381f3beb4" @@ -679,6 +875,15 @@ "@babel/helper-module-transforms" "^7.23.3" "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-modules-commonjs@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.1.tgz#e71ba1d0d69e049a22bf90b3867e263823d3f1b9" + integrity sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw== + dependencies: + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-simple-access" "^7.22.5" + "@babel/plugin-transform-modules-commonjs@^7.13.8", "@babel/plugin-transform-modules-commonjs@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz#661ae831b9577e52be57dd8356b734f9700b53b4" @@ -706,7 +911,7 @@ "@babel/helper-module-transforms" "^7.23.3" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": +"@babel/plugin-transform-named-capturing-groups-regex@^7.0.0", "@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== @@ -780,6 +985,13 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-syntax-optional-chaining" "^7.8.3" +"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.20.7": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.1.tgz#983c15d114da190506c75b616ceb0f817afcc510" + integrity sha512-8Jl6V24g+Uw5OGPeWNKrKqXPDw2YDjLc53ojwfMcKwlEoETKU9rU0mHUtcg9JntWI/QYzGAXNWEcVHZ+fR+XXg== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-parameters@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz#83ef5d1baf4b1072fa6e54b2b0999a7b2527e2af" @@ -787,6 +999,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-private-methods@^7.22.5": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.1.tgz#a0faa1ae87eff077e1e47a5ec81c3aef383dc15a" + integrity sha512-tGvisebwBO5em4PaYNqt4fkw56K2VALsAbAakY0FjTYqJp7gfdrgr7YX76Or8/cpik0W6+tj3rZ0uHU9Oil4tw== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.24.1" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-private-methods@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz#b2d7a3c97e278bfe59137a978d53b2c2e038c0e4" @@ -795,6 +1015,16 @@ "@babel/helper-create-class-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-private-property-in-object@^7.22.11": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.1.tgz#756443d400274f8fb7896742962cc1b9f25c1f6a" + integrity sha512-pTHxDVa0BpUbvAgX3Gat+7cSciXqUcY9j2VZKTbSB6+VQGpNgNO9ailxTGHSXlqOnX1Hcx1Enme2+yv7VqP9bg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.24.1" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-transform-private-property-in-object@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.4.tgz#3ec711d05d6608fd173d9b8de39872d8dbf68bf5" @@ -812,6 +1042,38 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-react-display-name@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.24.1.tgz#554e3e1a25d181f040cf698b93fd289a03bfdcdb" + integrity sha512-mvoQg2f9p2qlpDQRBC7M3c3XTr0k7cp/0+kFKKO/7Gtu0LSw16eKB+Fabe2bDT/UpsyasTBBkAnbdsLrkD5XMw== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + +"@babel/plugin-transform-react-jsx-self@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.24.1.tgz#a21d866d8167e752c6a7c4555dba8afcdfce6268" + integrity sha512-kDJgnPujTmAZ/9q2CN4m2/lRsUUPDvsG3+tSHWUJIzMGTt5U/b/fwWd3RO3n+5mjLrsBrVa5eKFRVSQbi3dF1w== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + +"@babel/plugin-transform-react-jsx-source@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.24.1.tgz#a2dedb12b09532846721b5df99e52ef8dc3351d0" + integrity sha512-1v202n7aUq4uXAieRTKcwPzNyphlCuqHHDcdSNc+vdhoTEZcFMh+L5yZuCmGaIO7bs1nJUNfHB89TZyoL48xNA== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + +"@babel/plugin-transform-react-jsx@^7.0.0": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz#393f99185110cea87184ea47bcb4a7b0c2e39312" + integrity sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-jsx" "^7.23.3" + "@babel/types" "^7.23.4" + "@babel/plugin-transform-regenerator@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz#141afd4a2057298602069fce7f2dc5173e6c561c" @@ -827,6 +1089,25 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-runtime@^7.0.0": + version "7.24.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.24.3.tgz#dc58ad4a31810a890550365cc922e1ff5acb5d7f" + integrity sha512-J0BuRPNlNqlMTRJ72eVptpt9VcInbxO6iP3jaxr+1NPhC0UkKL+6oeX6VXMEYdADnuqmMmsBspt4d5w8Y/TCbQ== + dependencies: + "@babel/helper-module-imports" "^7.24.3" + "@babel/helper-plugin-utils" "^7.24.0" + babel-plugin-polyfill-corejs2 "^0.4.10" + babel-plugin-polyfill-corejs3 "^0.10.1" + babel-plugin-polyfill-regenerator "^0.6.1" + semver "^6.3.1" + +"@babel/plugin-transform-shorthand-properties@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.1.tgz#ba9a09144cf55d35ec6b93a32253becad8ee5b55" + integrity sha512-LyjVB1nsJ6gTTUKRjRWx9C1s9hE7dLfP/knKdrfeH9UPtAGjYGgxIbFfx7xyLIEWs7Xe1Gnf8EWiUqfjLhInZA== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-shorthand-properties@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz#97d82a39b0e0c24f8a981568a8ed851745f59210" @@ -834,6 +1115,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-spread@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.1.tgz#a1acf9152cbf690e4da0ba10790b3ac7d2b2b391" + integrity sha512-KjmcIM+fxgY+KxPVbjelJC6hrH1CgtPmTvdXAfn3/a9CnWGSTY7nH4zm5+cjmWJybdcPSsD0++QssDsjcpe47g== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-spread@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz#41d17aacb12bde55168403c6f2d6bdca563d362c" @@ -842,6 +1131,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" +"@babel/plugin-transform-sticky-regex@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.1.tgz#f03e672912c6e203ed8d6e0271d9c2113dc031b9" + integrity sha512-9v0f1bRXgPVcPrngOQvLXeGNNVLc8UjMVfebo9ka0WF3/7+aVUHmaJVT3sa0XCzEFioPfPHZiOcYG9qOsH63cw== + dependencies: + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-sticky-regex@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.23.3.tgz#dec45588ab4a723cb579c609b294a3d1bd22ff04" @@ -873,6 +1169,16 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-typescript" "^7.23.3" +"@babel/plugin-transform-typescript@^7.5.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.24.1.tgz#5c05e28bb76c7dfe7d6c5bed9951324fd2d3ab07" + integrity sha512-liYSESjX2fZ7JyBFkYG78nfvHlMKE6IpNdTVnxmlYUR+j5ZLsitFbaAE+eJSK2zPPkNWNw4mXL51rQ8WrvdK0w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.24.1" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-syntax-typescript" "^7.24.1" + "@babel/plugin-transform-unicode-escapes@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz#1f66d16cab01fab98d784867d24f70c1ca65b925" @@ -888,6 +1194,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-unicode-regex@^7.0.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.1.tgz#57c3c191d68f998ac46b708380c1ce4d13536385" + integrity sha512-2A/94wgZgxfTsiLaQ2E36XAOdcZmGAaEEgVmxQWwZXWkGhvoHbaqXcKnU8zny4ycpu3vNqg0L/PcCiYtHtA13g== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/plugin-transform-unicode-regex@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.23.3.tgz#26897708d8f42654ca4ce1b73e96140fbad879dc" @@ -1051,6 +1365,15 @@ "@babel/parser" "^7.23.9" "@babel/types" "^7.23.9" +"@babel/template@^7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50" + integrity sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/parser" "^7.24.0" + "@babel/types" "^7.24.0" + "@babel/traverse@^7.20.0", "@babel/traverse@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.9.tgz#2f9d6aead6b564669394c5ce0f9302bb65b9d950" @@ -1076,6 +1399,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.23.4", "@babel/types@^7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.0.tgz#3b951f435a92e7333eba05b7566fd297960ea1bf" + integrity sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + 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" @@ -1610,6 +1942,13 @@ resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.74.0.tgz#560bec29b2699c4d4cbfecfb4c2c5025397aac23" integrity sha512-I8Yy6bCKU5R4qZX4jfXsAPsHyuGHlulbnbG3NqO9JgZ3T2DJxJiZE39rHORP0trLnRh0rIeRcs4Mc14fAE6hrw== +"@react-native/babel-plugin-codegen@0.74.2": + version "0.74.2" + resolved "https://registry.yarnpkg.com/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.74.2.tgz#ed00979923c14bba847271a690641cce67588caf" + integrity sha512-hIdPub4hOFvIRORRlKtt5FCzdl7Avl4KJ4M5sr2Iq8oOJhMl+4Gh4Kjr7t6DO5ctvFXI4IzB0Wz7FcgDOTFIbA== + dependencies: + "@react-native/codegen" "0.74.2" + "@react-native/babel-preset@0.74.2": version "0.74.2" resolved "https://registry.yarnpkg.com/@react-native/babel-preset/-/babel-preset-0.74.2.tgz#25c377ed4f747baea5adeaeba3be3110c6a43093" @@ -1791,14 +2130,14 @@ uid "" "@react-navigation/core@link:../react-navigation/packages/core": - version "6.4.13" + version "7.0.0-alpha.17" dependencies: - "@react-navigation/routers" "^6.1.9" + "@react-navigation/routers" "^7.0.0-alpha.6" escape-string-regexp "^4.0.0" - nanoid "^3.1.23" + nanoid "3.3.7" query-string "^7.1.3" - react-is "^16.13.0" - use-latest-callback "^0.1.7" + react-is "^18.2.0" + use-latest-callback "^0.1.9" "@react-navigation/core@link:../react-navigation/packages/core/": version "0.0.0" @@ -1808,10 +2147,12 @@ version "0.0.0" uid "" -"@react-navigation/elements@^1.3.26": - version "1.3.29" - resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.29.tgz#1dcbd95c319a8990d66e2aef8e108198d7a93cb2" - integrity sha512-sMkqqQHlxdBxrBVw6E2a3LJjb9Hrb1ola8+zRgJn4Ox8iKtjqtWEdg349DPWU77VpIekcMLsqQvEtZox3XkXgA== +"@react-navigation/elements@^2.0.0-alpha.17": + version "2.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-2.0.0-alpha.17.tgz#433ca7ff49097c46e7db40a08b8dc37f344d688c" + integrity sha512-DvKPYhqDMjS7/61MM+xlAq22078M/WKqzwwjmXR5/fd+rDtOq3ysMzyCBSRKSjy5Dh+UUcQP3GobIWZhzVBPsA== + dependencies: + color "^4.2.3" "@react-navigation/elements@link:../react-navigation/packages/elements": version "0.0.0" @@ -1825,12 +2166,12 @@ version "0.0.0" uid "" -"@react-navigation/routers@^6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-6.1.9.tgz#73f5481a15a38e36592a0afa13c3c064b9f90bed" - integrity sha512-lTM8gSFHSfkJvQkxacGM6VJtBt61ip2XO54aNfswD+KMw6eeZ4oehl7m0me3CR9hnDE4+60iAZR8sAhvCiI3NA== +"@react-navigation/routers@^7.0.0-alpha.6": + version "7.0.0-alpha.6" + resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-7.0.0-alpha.6.tgz#d10fcbc408d94b9b6904b1e97de88422f69954fb" + integrity sha512-0V+/WRbgVmrPXW5TjMLxf8NJAHsUoG9G8X4WWmVIf1ASMF3POZM4CCbhEeudhgUxN4QEvkoSIrzvUpoUplQOMw== dependencies: - nanoid "^3.1.23" + nanoid "3.3.7" "@react-navigation/routers@link:../react-navigation/packages/routers": version "0.0.0" @@ -2440,7 +2781,7 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" -babel-plugin-polyfill-corejs2@^0.4.8: +babel-plugin-polyfill-corejs2@^0.4.10, babel-plugin-polyfill-corejs2@^0.4.8: version "0.4.10" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.10.tgz#276f41710b03a64f6467433cab72cbc2653c38b1" integrity sha512-rpIuu//y5OX6jVU+a5BCn1R5RSZYWAl2Nar76iwaOdycqb6JPxediskWFMMl7stfwNJR4b7eiQvh5fB5TEQJTQ== @@ -2449,6 +2790,14 @@ babel-plugin-polyfill-corejs2@^0.4.8: "@babel/helper-define-polyfill-provider" "^0.6.1" semver "^6.3.1" +babel-plugin-polyfill-corejs3@^0.10.1: + version "0.10.4" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz#789ac82405ad664c20476d0233b485281deb9c77" + integrity sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.6.1" + core-js-compat "^3.36.1" + babel-plugin-polyfill-corejs3@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.9.0.tgz#9eea32349d94556c2ad3ab9b82ebb27d4bf04a81" @@ -2464,6 +2813,20 @@ babel-plugin-polyfill-regenerator@^0.5.5: dependencies: "@babel/helper-define-polyfill-provider" "^0.5.0" +babel-plugin-polyfill-regenerator@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.1.tgz#4f08ef4c62c7a7f66a35ed4c0d75e30506acc6be" + integrity sha512-JfTApdE++cgcTWjsiCQlLyFBMbTUft9ja17saCc93lgV33h4tuCVj7tlvu//qpLwaG+3yEz7/KhahGrUMkVq9g== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.6.1" + +babel-plugin-transform-flow-enums@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-enums/-/babel-plugin-transform-flow-enums-0.0.2.tgz#d1d0cc9bdc799c850ca110d0ddc9f21b9ec3ef25" + integrity sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ== + dependencies: + "@babel/plugin-syntax-flow" "^7.12.1" + 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" @@ -2531,7 +2894,7 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.22.2, browserslist@^4.22.3: +browserslist@^4.22.2, browserslist@^4.22.3, browserslist@^4.23.0: version "4.23.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== @@ -2829,6 +3192,13 @@ core-js-compat@^3.31.0, core-js-compat@^3.34.0: dependencies: browserslist "^4.22.3" +core-js-compat@^3.36.1: + version "3.36.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.36.1.tgz#1818695d72c99c25d621dca94e6883e190cea3c8" + integrity sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA== + dependencies: + browserslist "^4.23.0" + core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -5190,7 +5560,7 @@ ms@2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@^3.1.23: +nanoid@3.3.7: version "3.3.7" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== @@ -5675,7 +6045,7 @@ react-freeze@^1.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0: +react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -6638,7 +7008,7 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -use-latest-callback@^0.1.7: +use-latest-callback@^0.1.9: version "0.1.9" resolved "https://registry.yarnpkg.com/use-latest-callback/-/use-latest-callback-0.1.9.tgz#10191dc54257e65a8e52322127643a8940271e2a" integrity sha512-CL/29uS74AwreI/f2oz2hLTW7ZqVeV5+gxFeGudzQrgkCytrHw33G4KbnQOrRlAEzzAFXi7dDLMC9zhWcVpzmw== @@ -6679,7 +7049,7 @@ walker@^1.0.7, walker@^1.0.8: dependencies: makeerror "1.0.12" -warn-once@^0.1.0: +warn-once@^0.1.0, warn-once@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/warn-once/-/warn-once-0.1.1.tgz#952088f4fb56896e73fd4e6a3767272a3fccce43" integrity sha512-VkQZJbO8zVImzYFteBXvBOZEl1qL175WH8VmZcxF2fZAoudNhNDvHi+doCaAEdU2l2vtcIwa2zn0QK5+I1HQ3Q== diff --git a/react-navigation b/react-navigation index 523fa4f3af..a41d932198 160000 --- a/react-navigation +++ b/react-navigation @@ -1 +1 @@ -Subproject commit 523fa4f3afb7c428a8370bfd83933c0163224e66 +Subproject commit a41d932198d1b48d84f410be1633fc5ddcb2df3f From 3df2015435a3f6507053ae9a9d5ba8007721c828 Mon Sep 17 00:00:00 2001 From: tboba Date: Wed, 27 Mar 2024 17:16:45 +0100 Subject: [PATCH 02/28] Apply better metro algorithm for example, update typescript --- Example/App.tsx | 2 +- Example/metro.config.js | 63 ++++++++++------ Example/package.json | 16 ++-- Example/yarn.lock | 159 +++++++++++++++++++++------------------- package.json | 4 +- react-navigation | 2 +- yarn.lock | 16 +++- 7 files changed, 153 insertions(+), 109 deletions(-) diff --git a/Example/App.tsx b/Example/App.tsx index f53e19b350..6fefdc56b6 100644 --- a/Example/App.tsx +++ b/Example/App.tsx @@ -9,7 +9,7 @@ import { } from 'react-native'; import { NavigationContainer } from '@react-navigation/native'; import { StackNavigationProp } from '@react-navigation/stack'; -import { createNativeStackNavigator } from 'react-native-screens/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import RNRestart from 'react-native-restart'; import { ListItem, SettingsSwitch } from './src/shared'; diff --git a/Example/metro.config.js b/Example/metro.config.js index 97baff2a42..b7f38f8e56 100644 --- a/Example/metro.config.js +++ b/Example/metro.config.js @@ -1,21 +1,27 @@ -/* eslint-disable import/no-commonjs */ const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); + +const fs = require('fs'); const path = require('path'); const exclusionList = require('metro-config/src/defaults/exclusionList'); const escape = require('escape-string-regexp'); + const pack = require('../package.json'); +const projectPack = require('./package.json'); // react-native-screens root directory const rnsRoot = path.resolve(__dirname, '..'); const modules = [ '@react-navigation/native', + 'react-native-reanimated', 'react-native-safe-area-context', 'react-native-gesture-handler', 'react-native-reanimated', ...Object.keys(pack.peerDependencies), ]; +const resolvedExts = ['.ts', '.tsx', '.js', '.jsx']; + const config = { projectRoot: __dirname, watchFolders: [rnsRoot], @@ -23,6 +29,7 @@ const config = { // We need to make sure that only one version is loaded for peerDependencies // So we exclude them at the root, and alias them to the versions in example's node_modules resolver: { + sourceExts: ['ts', 'tsx', 'js', 'jsx', 'json'], blockList: exclusionList( modules.map( m => @@ -35,42 +42,56 @@ const config = { return acc; }, {}), + nodeModulesPaths: [path.join(__dirname, '../../')], + // Since we use react-naviation as submodule it comes with it's own node_modules. While loading // react-navigation code, due to how module resolution algorithms works it seems that its node_modules // are consulted first, resulting in double-loaded packages (so doubled react, react-native and other package instances) leading // to various errors. To mitigate this we define below custom request resolver, hijacking requests to conflicting modules and manually // resolving appropriate files. **Most likely** this can be achieved by proper usage of blockList but I found this method working ¯\_(ツ)_/¯ resolveRequest: (context, moduleName, platform) => { - if (moduleName === 'react' || moduleName === 'react-native') { + if (moduleName.startsWith('@react-navigation')) { + // For some reason, react-navigation packages don't want to resolve from + // the project's node_modules, so we need to use standard Metro resolver. + return context.resolveRequest(context, moduleName, platform); + } + + if (moduleName === 'react-native-screens') { return { - filePath: path.join( - __dirname, - 'node_modules', - moduleName, - 'index.js' - ), + filePath: path.join(rnsRoot, 'src', 'index.tsx'), type: 'sourceFile', }; } - if (moduleName === 'react-native-safe-area-context') { - return { - filePath: path.join( + if (moduleName in projectPack.dependencies) { + for (const ext of resolvedExts) { + const possiblePath = path.join( + __dirname, + 'node_modules', + moduleName, + `index${ext}` + ); + + const possibleSrcPath = path.join( __dirname, 'node_modules', moduleName, 'src', - 'index.tsx' - ), - type: 'sourceFile', - }; - } + `index${ext}` + ); - if (moduleName === 'react-native-screens') { - return { - filePath: path.join(rnsRoot, 'src', 'index.tsx'), - type: 'sourceFile', - }; + if (fs.existsSync(possiblePath)) { + return { + filePath: possiblePath, + type: 'sourceFile', + }; + } else if (fs.existsSync(possibleSrcPath)) { + return { + filePath: possibleSrcPath, + type: 'sourceFile', + }; + } + } } // Optionally, chain to the standard Metro resolver. diff --git a/Example/package.json b/Example/package.json index 574b9cfb7f..27a14aab97 100644 --- a/Example/package.json +++ b/Example/package.json @@ -15,11 +15,14 @@ "test-e2e-android": "detox test --configuration android.release --take-screenshots failing" }, "dependencies": { - "@react-navigation/bottom-tabs": "^5.11.7", - "@react-navigation/compat": "^5.3.14", - "@react-navigation/drawer": "^5.12.3", - "@react-navigation/native": "^5.9.2", - "@react-navigation/stack": "^5.14.2", + "@react-navigation/bottom-tabs": "link:../react-navigation/packages/bottom-tabs/", + "@react-navigation/drawer": "link:../react-navigation/packages/drawer/", + "@react-navigation/native": "link:../react-navigation/packages/native/", + "@react-navigation/stack": "link:../react-navigation/packages/stack/", + "@react-navigation/native-stack": "link:../react-navigation/packages/native-stack/", + "@react-navigation/core": "link:../react-navigation/packages/core/", + "@react-navigation/elements": "link:../react-navigation/packages/elements/", + "@react-navigation/routers": "link:../react-navigation/packages/routers/", "nanoid": "^4.0.2", "react": "18.2.0", "react-native": "0.72.4", @@ -30,6 +33,9 @@ "react-native-screens": "link:../", "react-native-vector-icons": "^8.0.0" }, + "resolutions": { + "@react-navigation/core": "link:../react-navigation/packages/core/" + }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", diff --git a/Example/yarn.lock b/Example/yarn.lock index f1d42dc033..374c55ce94 100644 --- a/Example/yarn.lock +++ b/Example/yarn.lock @@ -1905,61 +1905,65 @@ invariant "^2.2.4" nullthrows "^1.1.1" -"@react-navigation/bottom-tabs@^5.11.7": - version "5.11.15" - resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-5.11.15.tgz#f973625cc32d9c5a4067851f084cb11ccd68fe79" - integrity sha512-TBY419W6aN/HZg98xbVp5Bx1HEF5sXuHR5f55W6KMI4k2AvxlwelKD1wbfvEcX2iuQT0YUiiXsACRFUSECYhkw== - dependencies: - color "^3.1.3" - react-native-iphone-x-helper "^1.3.0" - -"@react-navigation/compat@^5.3.14": - version "5.3.20" - resolved "https://registry.yarnpkg.com/@react-navigation/compat/-/compat-5.3.20.tgz#96cc6995f4bd40f70958b420735a189a87b22a0e" - integrity sha512-4CDw3QRN2zKj2L1Fxjq6ZOK95EW8UOnW3Par1o+P07qc+dZTAL1poKeRx74yqGLQyGVawozTHOgyE8/XWjdDvg== +"@react-navigation/bottom-tabs@link:../react-navigation/packages/bottom-tabs": + version "0.0.0" + uid "" -"@react-navigation/core@^5.16.1": - version "5.16.1" - resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.16.1.tgz#e0d308bd9bbd930114ce55c4151806b6d7907f69" - integrity sha512-3AToC7vPNeSNcHFLd1h71L6u34hfXoRAS1CxF9Fc4uC8uOrVqcNvphpeFbE0O9Bw6Zpl0BnMFl7E5gaL3KGzNA== +"@react-navigation/core@link:../react-navigation/packages/core": + version "7.0.0-alpha.17" dependencies: - "@react-navigation/routers" "^5.7.4" + "@react-navigation/routers" "^7.0.0-alpha.6" escape-string-regexp "^4.0.0" - nanoid "^3.1.15" - query-string "^6.13.6" - react-is "^16.13.0" + nanoid "3.3.7" + query-string "^7.1.3" + react-is "^18.2.0" + use-latest-callback "^0.1.9" -"@react-navigation/drawer@^5.12.3": - version "5.12.9" - resolved "https://registry.yarnpkg.com/@react-navigation/drawer/-/drawer-5.12.9.tgz#b07d7391a6fea4ce07cd7a7421fdbaea37cdbb46" - integrity sha512-SYb2BCEAn+BiEwC6WBfCzs1VlWD+ZdQbxmsim6vo1o+ndPW2e+kiq7FXKRs0vUXhQRZVl2oOB3vBn0c3YCllQg== - dependencies: - color "^3.1.3" - react-native-iphone-x-helper "^1.3.0" +"@react-navigation/core@link:../react-navigation/packages/core/": + version "0.0.0" + uid "" -"@react-navigation/native@^5.9.2": - version "5.9.8" - resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-5.9.8.tgz#ac76ee6390ea7ce807486ca5c38d903e23433a97" - integrity sha512-DNbcDHXQPSFDLn51kkVVJjT3V7jJy2GztNYZe/2bEg29mi5QEcHHcpifjMCtyFKntAOWzKlG88UicIQ17UEghg== - dependencies: - "@react-navigation/core" "^5.16.1" - escape-string-regexp "^4.0.0" - nanoid "^3.1.15" +"@react-navigation/core@workspace:^": + version "0.0.0" + uid "" -"@react-navigation/routers@^5.7.4": - version "5.7.4" - resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.7.4.tgz#8b5460e841a0c64f6c9a5fbc2a1eb832432d4fb0" - integrity sha512-0N202XAqsU/FlE53Nmh6GHyMtGm7g6TeC93mrFAFJOqGRKznT0/ail+cYlU6tNcPA9AHzZu1Modw1eoDINSliQ== +"@react-navigation/drawer@link:../react-navigation/packages/drawer": + version "0.0.0" + uid "" + +"@react-navigation/elements@^2.0.0-alpha.17": + version "2.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-2.0.0-alpha.17.tgz#433ca7ff49097c46e7db40a08b8dc37f344d688c" + integrity sha512-DvKPYhqDMjS7/61MM+xlAq22078M/WKqzwwjmXR5/fd+rDtOq3ysMzyCBSRKSjy5Dh+UUcQP3GobIWZhzVBPsA== dependencies: - nanoid "^3.1.15" + color "^4.2.3" + +"@react-navigation/elements@link:../react-navigation/packages/elements": + version "0.0.0" + uid "" + +"@react-navigation/native-stack@link:../react-navigation/packages/native-stack": + version "0.0.0" + uid "" + +"@react-navigation/native@link:../react-navigation/packages/native": + version "0.0.0" + uid "" -"@react-navigation/stack@^5.14.2": - version "5.14.9" - resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.14.9.tgz#49c7b9316e6fb456e9766c901e0d607862f0ea7d" - integrity sha512-DuvrT9P+Tz8ezZLQYxORZqOGqO+vEufaxlW1hSLw1knLD4jNxkz8TJDXtfKwaz//9gb43UhTNccNM02vm7iPqQ== +"@react-navigation/routers@^7.0.0-alpha.6": + version "7.0.0-alpha.6" + resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-7.0.0-alpha.6.tgz#d10fcbc408d94b9b6904b1e97de88422f69954fb" + integrity sha512-0V+/WRbgVmrPXW5TjMLxf8NJAHsUoG9G8X4WWmVIf1ASMF3POZM4CCbhEeudhgUxN4QEvkoSIrzvUpoUplQOMw== dependencies: - color "^3.1.3" - react-native-iphone-x-helper "^1.3.0" + nanoid "3.3.7" + +"@react-navigation/routers@link:../react-navigation/packages/routers": + version "0.0.0" + uid "" + +"@react-navigation/stack@link:../react-navigation/packages/stack": + version "0.0.0" + uid "" "@sideway/address@^4.1.3": version "4.1.4" @@ -2995,7 +2999,7 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0, color-convert@^1.9.3: +color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -3019,7 +3023,7 @@ color-name@^1.0.0, color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@^1.6.0: +color-string@^1.9.0: version "1.9.1" resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== @@ -3027,13 +3031,13 @@ color-string@^1.6.0: color-name "^1.0.0" simple-swizzle "^0.2.2" -color@^3.1.3: - version "3.2.1" - resolved "https://registry.yarnpkg.com/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" - integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== +color@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/color/-/color-4.2.3.tgz#d781ecb5e57224ee43ea9627560107c0e0c6463a" + integrity sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A== dependencies: - color-convert "^1.9.3" - color-string "^1.6.0" + color-convert "^2.0.1" + color-string "^1.9.0" colorette@^1.0.7: version "1.4.0" @@ -3193,7 +3197,7 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -decode-uri-component@^0.2.0: +decode-uri-component@^0.2.0, decode-uri-component@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== @@ -6289,10 +6293,10 @@ nan@^2.14.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== -nanoid@^3.1.15: - version "3.3.6" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" - integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== +nanoid@3.3.7: + version "3.3.7" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== nanoid@^4.0.2: version "4.0.2" @@ -6804,12 +6808,12 @@ pure-rand@^6.0.0: resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.2.tgz#a9c2ddcae9b68d736a8163036f088a2781c8b306" integrity sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ== -query-string@^6.13.6: - version "6.14.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" - integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== +query-string@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328" + integrity sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg== dependencies: - decode-uri-component "^0.2.0" + decode-uri-component "^0.2.2" filter-obj "^1.1.0" split-on-first "^1.0.0" strict-uri-encode "^2.0.0" @@ -6849,7 +6853,7 @@ react-freeze@^1.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0: +react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -6869,6 +6873,13 @@ react-native-codegen@^0.71.3: jscodeshift "^0.13.1" nullthrows "^1.1.1" +"react-native-drawer-layout@workspace:^": + version "3.3.0" + resolved "https://registry.yarnpkg.com/react-native-drawer-layout/-/react-native-drawer-layout-3.3.0.tgz#9e56ca33f9c5f01f30c82c451a2bdc605ff74d9b" + integrity sha512-Wz+UVUEQyXy32gpQ4WrDMvTqfNBGYvGXnf79Xi5w3r58G9X+WSQL6Rr96AQz8O3xE9mPF0oWx1oSqCriosaS6Q== + dependencies: + use-latest-callback "^0.1.9" + react-native-gesture-handler@^2.13.1: version "2.13.1" resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.13.1.tgz#bad89caacd62c4560b9953b02f85f37ee42d5d4c" @@ -6880,11 +6891,6 @@ react-native-gesture-handler@^2.13.1: lodash "^4.17.21" prop-types "^15.7.2" -react-native-iphone-x-helper@^1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz#20c603e9a0e765fd6f97396638bdeb0e5a60b010" - integrity sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg== - react-native-reanimated@3.7.0-nightly-20240109-9e2c33716: version "3.7.0-nightly-20240109-9e2c33716" resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.7.0-nightly-20240109-9e2c33716.tgz#ec647feabf1a0ba6673830f6ee2f3d57e0aa63b7" @@ -6906,10 +6912,8 @@ react-native-safe-area-context@^4.8.1: integrity sha512-gYoZyxKuWHfxXHTFGpkFKgfRHDAqTs+I/NZsiXdllMmIfOme25MGPHVmuHrA0Jq4rg189x/JiscFCv2IvDCC6A== "react-native-screens@link:..": - version "3.29.0" - dependencies: - react-freeze "^1.0.0" - warn-once "^0.1.0" + version "0.0.0" + uid "" react-native-vector-icons@^8.0.0: version "8.1.0" @@ -8066,6 +8070,11 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== +use-latest-callback@^0.1.9: + version "0.1.9" + resolved "https://registry.yarnpkg.com/use-latest-callback/-/use-latest-callback-0.1.9.tgz#10191dc54257e65a8e52322127643a8940271e2a" + integrity sha512-CL/29uS74AwreI/f2oz2hLTW7ZqVeV5+gxFeGudzQrgkCytrHw33G4KbnQOrRlAEzzAFXi7dDLMC9zhWcVpzmw== + use-sync-external-store@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" @@ -8122,7 +8131,7 @@ walker@^1.0.7, walker@^1.0.8: dependencies: makeerror "1.0.12" -warn-once@^0.1.0: +warn-once@^0.1.0, warn-once@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/warn-once/-/warn-once-0.1.1.tgz#952088f4fb56896e73fd4e6a3767272a3fccce43" integrity sha512-VkQZJbO8zVImzYFteBXvBOZEl1qL175WH8VmZcxF2fZAoudNhNDvHi+doCaAEdU2l2vtcIwa2zn0QK5+I1HQ3Q== diff --git a/package.json b/package.json index 1f75e49e3a..198a1d50bb 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "@react-navigation/native": "^5.8.0", "@react-navigation/stack": "^5.10.0", "@types/jest": "^29.3.1", - "@types/react": "^18.2.21", + "@types/react": "^18.2.72", "@types/react-test-renderer": "^18.0.0", "@typescript-eslint/eslint-plugin": "^6.5.0", "@typescript-eslint/parser": "^6.5.0", @@ -108,7 +108,7 @@ "react-native-windows": "^0.64.8", "react-test-renderer": "^18.2.0", "release-it": "^15.6.0", - "typescript": "4.8.4" + "typescript": "5.4.3" }, "resolutions": { "@react-native-community/cli-platform-android": "^11.3.6", diff --git a/react-navigation b/react-navigation index a41d932198..afcfd3587f 160000 --- a/react-navigation +++ b/react-navigation @@ -1 +1 @@ -Subproject commit a41d932198d1b48d84f410be1633fc5ddcb2df3f +Subproject commit afcfd3587fe77e7eca05ffaf27600b9837d8da99 diff --git a/yarn.lock b/yarn.lock index 7ad6ca9727..5514394221 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2609,6 +2609,14 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^18.2.72": + version "18.2.72" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.72.tgz#3341a6d0746d1c7d8510810319323850c04bd6ed" + integrity sha512-/e7GWxGzXQF7OJAua7UAYqYi/4VpXEfbGtmYQcAQwP3SjjjAXfybTf/JK5S+SaetB/ChXl8Y2g1hCsj7jDXxcg== + dependencies: + "@types/prop-types" "*" + csstype "^3.0.2" + "@types/scheduler@*": version "0.16.3" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5" @@ -9948,10 +9956,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@4.8.4: - version "4.8.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" - integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== +typescript@5.4.3: + version "5.4.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.3.tgz#5c6fedd4c87bee01cd7a528a30145521f8e0feff" + integrity sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg== uglify-es@^3.1.9: version "3.3.9" From 6d34fdfd875bc163e0bbdc564d4e5f3f9cf0f053 Mon Sep 17 00:00:00 2001 From: tboba Date: Wed, 27 Mar 2024 17:42:55 +0100 Subject: [PATCH 03/28] Update @types/react to newer version, migrate App.tsx from Example --- Example/App.tsx | 5 +- Example/package.json | 2 +- Example/yarn.lock | 10 +- FabricExample/package.json | 2 +- FabricExample/yarn.lock | 1982 +++++++++++++++++--------------- FabricTestExample/package.json | 2 +- FabricTestExample/yarn.lock | 10 +- TestsExample/package.json | 2 +- TestsExample/yarn.lock | 48 +- package.json | 2 +- yarn.lock | 16 +- 11 files changed, 1080 insertions(+), 1001 deletions(-) diff --git a/Example/App.tsx b/Example/App.tsx index 6fefdc56b6..ff2e0cfac2 100644 --- a/Example/App.tsx +++ b/Example/App.tsx @@ -161,10 +161,7 @@ const ExampleApp = (): JSX.Element => ( - + Date: Thu, 28 Mar 2024 17:47:23 +0100 Subject: [PATCH 04/28] Move example to use @react-navigation/native-stack --- Example/src/screens/Animations.tsx | 21 +++--- Example/src/screens/BottomTabsAndStack.tsx | 15 ++-- Example/src/screens/Events.tsx | 67 +++++++++++++---- Example/src/screens/Gestures.tsx | 20 ++--- Example/src/screens/HeaderOptions.tsx | 85 ++++++++++++---------- Example/src/screens/Modals.tsx | 17 ++--- Example/src/screens/Orientation.tsx | 9 +-- Example/src/screens/SearchBar.tsx | 12 +-- Example/src/screens/SimpleNativeStack.tsx | 7 +- Example/src/screens/StackPresentation.tsx | 31 +++----- Example/src/screens/StatusBar.tsx | 20 ++--- Example/src/screens/SwipeBackAnimation.tsx | 9 ++- Example/src/shared/Snack.tsx | 2 +- 13 files changed, 176 insertions(+), 139 deletions(-) diff --git a/Example/src/screens/Animations.tsx b/Example/src/screens/Animations.tsx index 14fb71a00a..e32185d18a 100644 --- a/Example/src/screens/Animations.tsx +++ b/Example/src/screens/Animations.tsx @@ -1,10 +1,10 @@ import React, { useState, useLayoutEffect } from 'react'; -import { View, StyleSheet, I18nManager } from 'react-native'; +import { View, StyleSheet } from 'react-native'; import { createNativeStackNavigator, NativeStackNavigationProp, NativeStackNavigationOptions, -} from 'react-native-screens/native-stack'; +} from '@react-navigation/native-stack'; import { SettingsPicker, Button } from '../shared'; type StackParamList = { @@ -16,7 +16,7 @@ type StackParamList = { }; type StackAnimation = Exclude< - NativeStackNavigationOptions['stackAnimation'], + NativeStackNavigationOptions['animation'], undefined >; @@ -33,7 +33,7 @@ const MainScreen = ({ }: MainScreenProps): JSX.Element => { useLayoutEffect(() => { navigation.setOptions({ - stackAnimation, + animation: stackAnimation, }); }, [navigation, stackAnimation]); @@ -85,7 +85,7 @@ const ReplaceScreen = ({ }: ReplaceScreenProps): JSX.Element => { useLayoutEffect(() => { navigation.setOptions({ - stackAnimation, + animation: stackAnimation, }); }, [navigation, stackAnimation]); @@ -107,7 +107,7 @@ const NavigateScreen = ({ }: NavigateScreenProps): JSX.Element => { useLayoutEffect(() => { navigation.setOptions({ - stackAnimation, + animation: stackAnimation, }); }, [navigation, stackAnimation]); @@ -126,8 +126,7 @@ const App = (): JSX.Element => { return ( {({ navigation }) => ( @@ -141,7 +140,7 @@ const App = (): JSX.Element => { {({ navigation }) => ( { {({ navigation }) => ( { {({ navigation }) => ( { const Stack = createNativeStackNavigator(); - const makeStack = () => ( + const StackWithDetails = () => ( ( {letter} ), }}> - + ); - return makeStack; + return StackWithDetails; }; const AStack = createStack('A'); @@ -93,12 +92,12 @@ const NavigationTabsAndStack = (): JSX.Element => ( diff --git a/Example/src/screens/Events.tsx b/Example/src/screens/Events.tsx index 5623c88da8..8835a36e01 100644 --- a/Example/src/screens/Events.tsx +++ b/Example/src/screens/Events.tsx @@ -1,10 +1,10 @@ import React, { useEffect, useLayoutEffect, useState } from 'react'; -import { View, StyleSheet, I18nManager } from 'react-native'; +import { View, StyleSheet } from 'react-native'; import { createNativeStackNavigator, NativeStackNavigationOptions, NativeStackNavigationProp, -} from 'react-native-screens/native-stack'; +} from '@react-navigation/native-stack'; import { Button, SettingsPicker, ToastProvider, useToast } from '../shared'; type StackParamList = { @@ -15,7 +15,7 @@ type StackParamList = { }; type StackAnimation = Exclude< - NativeStackNavigationOptions['stackAnimation'], + NativeStackNavigationOptions['animation'], undefined >; @@ -32,6 +32,17 @@ const MainScreen = ({ }: MainScreenProps): JSX.Element => { const toast = useToast(); + useEffect(() => { + const unsubscribe = navigation.addListener('beforeRemove', () => { + toast.push({ + message: `Main | beforeRemove`, + backgroundColor: 'red', + }); + }); + + return unsubscribe; + }); + useEffect(() => { const unsubscribe = navigation.addListener( 'transitionStart', @@ -63,7 +74,7 @@ const MainScreen = ({ useLayoutEffect(() => { navigation.setOptions({ - stackAnimation, + animation: stackAnimation, }); }, [navigation, stackAnimation]); @@ -108,6 +119,17 @@ const ChatsScreen = ({ }: ChatsScreenProps): JSX.Element => { const toast = useToast(); + useEffect(() => { + const unsubscribe = navigation.addListener('beforeRemove', () => { + toast.push({ + message: `Chats | beforeRemove`, + backgroundColor: 'red', + }); + }); + + return unsubscribe; + }); + useEffect(() => { const unsubscribe = navigation.addListener( 'transitionStart', @@ -139,7 +161,7 @@ const ChatsScreen = ({ useLayoutEffect(() => { navigation.setOptions({ - stackAnimation, + animation: stackAnimation, }); }, [navigation, stackAnimation]); @@ -147,9 +169,8 @@ const ChatsScreen = ({ @@ -164,6 +185,17 @@ interface PrivacyScreenProps { const PrivacyScreen = ({ navigation }: PrivacyScreenProps): JSX.Element => { const toast = useToast(); + useEffect(() => { + const unsubscribe = navigation.addListener('beforeRemove', () => { + toast.push({ + message: `Privacy | beforeRemove`, + backgroundColor: 'red', + }); + }); + + return unsubscribe; + }); + useEffect(() => { const unsubscribe = navigation.addListener( 'transitionStart', @@ -211,6 +243,17 @@ interface OptionsScreenProps { const OptionsScreen = ({ navigation }: OptionsScreenProps): JSX.Element => { const toast = useToast(); + useEffect(() => { + const unsubscribe = navigation.addListener('beforeRemove', () => { + toast.push({ + message: `Options | beforeRemove`, + backgroundColor: 'red', + }); + }); + + return unsubscribe; + }); + useEffect(() => { const unsubscribe = navigation.addListener( 'transitionStart', @@ -256,14 +299,10 @@ const App = (): JSX.Element => { return ( - + + options={{ title: 'Events', headerBackVisible: true }}> {({ navigation }) => ( { const headerHeight = useHeaderHeight(); const [gestureEnabled, setGestureEnabled] = useState(true); - const [fullScreenSwipeEnabled, setFullScreenSwipeEnabled] = useState(true); + const [fullScreenGestureEnabled, setFullScreenGestureEnabled] = + useState(true); const { height, width } = Dimensions.get('window'); @@ -67,7 +68,7 @@ const DetailsScreen = ({ navigation }: DetailsScreenProps): JSX.Element => { useLayoutEffect(() => { navigation.setOptions({ gestureEnabled, - fullScreenSwipeEnabled, + fullScreenGestureEnabled, gestureResponseDistance: { start: startValue, end: endValue, @@ -78,7 +79,7 @@ const DetailsScreen = ({ navigation }: DetailsScreenProps): JSX.Element => { }, [ navigation, gestureEnabled, - fullScreenSwipeEnabled, + fullScreenGestureEnabled, startValue, endValue, topValue, @@ -115,8 +116,8 @@ const DetailsScreen = ({ navigation }: DetailsScreenProps): JSX.Element => { { }, ]} /> - {fullScreenSwipeEnabled && ( + {fullScreenGestureEnabled && ( (); const App = (): JSX.Element => ( { const [headerLargeTitle, setHeaderLargeTitle] = useState(true); const [headerItem, setHeaderItem] = useState('right'); const [headerBackTitle, setHeaderBackTitle] = useState('Back'); - const [headerHideShadow, setHeaderHideShadow] = useState(true); - const [headerTranslucent, setHeaderTranslucent] = useState(true); + const [headerShadowVisible, setHeaderShadowVisible] = useState(false); + const [headerTransparent, setHeaderTransparent] = useState(false); const square = (props: { tintColor?: string }) => ( @@ -60,17 +62,16 @@ const SettingsScreen = ({ navigation }: SettingsScreenProps): JSX.Element => { useLayoutEffect(() => { navigation.setOptions({ - headerTitle, - headerHideBackButton: !backButtonVisible, + headerBackVisible: backButtonVisible, headerBackTitleVisible: backButtonVisible, // iOS headerLargeTitle, // iOS headerBackTitle, // iOS headerShown, headerRight: headerItem === 'right' ? square : undefined, - headerCenter: headerItem === 'center' ? square : undefined, + headerTitle: headerItem === 'center' ? square : headerTitle, headerLeft: headerItem === 'left' ? square : undefined, - headerHideShadow, - headerTranslucent, + headerShadowVisible, + headerTransparent, }); }, [ navigation, @@ -80,8 +81,8 @@ const SettingsScreen = ({ navigation }: SettingsScreenProps): JSX.Element => { headerBackTitle, headerItem, headerShown, - headerHideShadow, - headerTranslucent, + headerShadowVisible, + headerTransparent, ]); return ( @@ -104,19 +105,26 @@ const SettingsScreen = ({ navigation }: SettingsScreenProps): JSX.Element => { onValueChange={setHeaderShown} /> label="Header item" value={headerItem} - onValueChange={setHeaderItem} + onValueChange={item => { + if (item === 'left' && backButtonVisible) { + // to make header's item ideally on the left side, + // we need to hide the back button. + setBackButtonVisible(false); + } + setHeaderItem(item); + }} items={['left', 'center', 'right']} /> iOS only @@ -138,26 +146,27 @@ const SettingsScreen = ({ navigation }: SettingsScreenProps): JSX.Element => { const Stack = createNativeStackNavigator(); const App = (): JSX.Element => ( - - - - + + + + + + ); const styles = StyleSheet.create({ diff --git a/Example/src/screens/Modals.tsx b/Example/src/screens/Modals.tsx index a98f7c3bae..f2f48dc984 100644 --- a/Example/src/screens/Modals.tsx +++ b/Example/src/screens/Modals.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { View, StyleSheet, I18nManager } from 'react-native'; +import { View, StyleSheet } from 'react-native'; import { createNativeStackNavigator, NativeStackNavigationProp, -} from 'react-native-screens/native-stack'; +} from '@react-navigation/native-stack'; import { Button, Alert } from '../shared'; type StackParamList = { @@ -59,8 +59,7 @@ const Stack = createNativeStackNavigator(); const App = (): JSX.Element => ( ( diff --git a/Example/src/screens/Orientation.tsx b/Example/src/screens/Orientation.tsx index 8cbb86acb9..20bb3bd420 100644 --- a/Example/src/screens/Orientation.tsx +++ b/Example/src/screens/Orientation.tsx @@ -5,7 +5,7 @@ import { createNativeStackNavigator, NativeStackNavigationOptions, NativeStackNavigationProp, -} from 'react-native-screens/native-stack'; +} from '@react-navigation/native-stack'; import { Button, SettingsPicker } from '../shared'; type StackParamList = { @@ -14,7 +14,7 @@ type StackParamList = { }; type ScreenOrientation = Exclude< - NativeStackNavigationOptions['screenOrientation'], + NativeStackNavigationOptions['orientation'], undefined >; @@ -28,7 +28,7 @@ const FirstScreen = ({ navigation }: FirstScreenProps): JSX.Element => { useLayoutEffect(() => { navigation.setOptions({ - screenOrientation, + orientation: screenOrientation, }); }, [navigation, screenOrientation]); @@ -76,8 +76,7 @@ const Stack = createNativeStackNavigator(); const App = (): JSX.Element => ( { useLayoutEffect(() => { navigation.setOptions({ - searchBar: { + headerSearchBarOptions: { ref: searchBarRef, barTintColor, hintTextColor, @@ -188,6 +188,7 @@ const MainScreen = ({ navigation }: MainScreenProps): JSX.Element => { title="Hide cancel" />