From 57ca443cf6e9d6c118c99fd11aeb85c749df181c Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 4 Oct 2022 14:30:01 -1000 Subject: [PATCH 1/4] Add DEBUG_SET_STATE mode --- .env.example | 1 + README.md | 2 +- src/CONFIG.js | 1 + src/setup/index.js | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index cf13ef583016..ecdfc70044e9 100644 --- a/.env.example +++ b/.env.example @@ -11,3 +11,4 @@ USE_WEB_PROXY=false USE_WDYR=false CAPTURE_METRICS=false ONYX_METRICS=false +ONYX_DEBUG_SET_STATE=false diff --git a/README.md b/README.md index 20d4921fc261..c0032837e9a7 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ variables referenced here get updated since your local `.env` file is ignored. see [PERFORMANCE.md](contributingGuides/PERFORMANCE.md#performance-metrics-opt-in-on-local-release-builds) for more information - `ONYX_METRICS` (optional) - Set this to `true` to capture even more performance metrics and see them in Flipper see [React-Native-Onyx#benchmarks](https://github.com/Expensify/react-native-onyx#benchmarks) for more information - +- `ONYX_DEBUG_SET_STATE` (options) - Set this to `true` to generate additional logs about which Onyx-connected components are re-rendering and how the data changed ---- # Running the tests diff --git a/src/CONFIG.js b/src/CONFIG.js index 4c03fa63c48e..83177a34b48e 100644 --- a/src/CONFIG.js +++ b/src/CONFIG.js @@ -70,5 +70,6 @@ export default { }, CAPTURE_METRICS: lodashGet(Config, 'CAPTURE_METRICS', 'false') === 'true', ONYX_METRICS: lodashGet(Config, 'ONYX_METRICS', 'false') === 'true', + ONYX_DEBUG_SET_STATE: lodashGet(Config, 'ONYX_DEBUG_SET_STATE', 'false') === 'true', DEV_PORT: process.env.PORT || 8080, }; diff --git a/src/setup/index.js b/src/setup/index.js index 61d55dba207d..52e868ee2a2f 100644 --- a/src/setup/index.js +++ b/src/setup/index.js @@ -4,6 +4,7 @@ import ONYXKEYS from '../ONYXKEYS'; import CONST from '../CONST'; import platformSetup from './platformSetup'; import * as Metrics from '../libs/Metrics'; +import CONFIG from '../CONFIG'; export default function () { /* @@ -24,6 +25,7 @@ export default function () { safeEvictionKeys: [ONYXKEYS.COLLECTION.REPORT_ACTIONS], keysToDisableSyncEvents: [ONYXKEYS.CURRENTLY_VIEWED_REPORTID], captureMetrics: Metrics.canCaptureOnyxMetrics(), + debugSetState: CONFIG.ONYX_DEBUG_SET_STATE, initialKeyStates: { // Clear any loading and error messages so they do not appear on app startup From 32f8047782b5673b6847e2871994f241322614e7 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Thu, 6 Oct 2022 07:39:21 -1000 Subject: [PATCH 2/4] Update Onyx version --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index be10d925d4ea..8376d9b2cf81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ "react-native-image-picker": "^4.8.5", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.17", + "react-native-onyx": "1.0.20", "react-native-pdf": "^6.6.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", @@ -35515,9 +35515,9 @@ } }, "node_modules/react-native-onyx": { - "version": "1.0.17", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.17.tgz", - "integrity": "sha512-ls2GjURfpBcGnIkwVrg2uuLnTBwd0vrEiUvbMo+GF3k81GAp2flCkVTM7ciAbo155Izk50dm0uXHYq1PIjwTxw==", + "version": "1.0.20", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.20.tgz", + "integrity": "sha512-Vn5NGeanRyUucEx45xpTwgnF8AxoV3u8CPuFrLD7+9/MwxNZbsdwNaQi5vc4VK91xtLe1Q8fjtwjci0BJQdgzw==", "dependencies": { "ascii-table": "0.0.9", "lodash": "^4.17.21", @@ -70130,9 +70130,9 @@ } }, "react-native-onyx": { - "version": "1.0.17", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.17.tgz", - "integrity": "sha512-ls2GjURfpBcGnIkwVrg2uuLnTBwd0vrEiUvbMo+GF3k81GAp2flCkVTM7ciAbo155Izk50dm0uXHYq1PIjwTxw==", + "version": "1.0.20", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.20.tgz", + "integrity": "sha512-Vn5NGeanRyUucEx45xpTwgnF8AxoV3u8CPuFrLD7+9/MwxNZbsdwNaQi5vc4VK91xtLe1Q8fjtwjci0BJQdgzw==", "requires": { "ascii-table": "0.0.9", "lodash": "^4.17.21", diff --git a/package.json b/package.json index 8238f27f47f5..f39b6d2d9f6a 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "react-native-image-picker": "^4.8.5", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.17", + "react-native-onyx": "1.0.20", "react-native-pdf": "^6.6.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 27b0643a7b57a2dfdd59e3685b2e94828410b613 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Thu, 6 Oct 2022 19:55:40 -1000 Subject: [PATCH 3/4] Bump onyx version again --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8376d9b2cf81..bc9b7e84d9e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ "react-native-image-picker": "^4.8.5", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.20", + "react-native-onyx": "1.0.21", "react-native-pdf": "^6.6.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", @@ -35515,9 +35515,9 @@ } }, "node_modules/react-native-onyx": { - "version": "1.0.20", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.20.tgz", - "integrity": "sha512-Vn5NGeanRyUucEx45xpTwgnF8AxoV3u8CPuFrLD7+9/MwxNZbsdwNaQi5vc4VK91xtLe1Q8fjtwjci0BJQdgzw==", + "version": "1.0.21", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.21.tgz", + "integrity": "sha512-jd1jpZ+H8ou7YsdmRx7gUbMsym2/6xCIZixu1hI7TeB2jemHrurChULmL4x4r6TyqmlAGCZpmqeiD3aX2+UBLQ==", "dependencies": { "ascii-table": "0.0.9", "lodash": "^4.17.21", @@ -70130,9 +70130,9 @@ } }, "react-native-onyx": { - "version": "1.0.20", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.20.tgz", - "integrity": "sha512-Vn5NGeanRyUucEx45xpTwgnF8AxoV3u8CPuFrLD7+9/MwxNZbsdwNaQi5vc4VK91xtLe1Q8fjtwjci0BJQdgzw==", + "version": "1.0.21", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.21.tgz", + "integrity": "sha512-jd1jpZ+H8ou7YsdmRx7gUbMsym2/6xCIZixu1hI7TeB2jemHrurChULmL4x4r6TyqmlAGCZpmqeiD3aX2+UBLQ==", "requires": { "ascii-table": "0.0.9", "lodash": "^4.17.21", diff --git a/package.json b/package.json index f39b6d2d9f6a..5732b6c61e19 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "react-native-image-picker": "^4.8.5", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.20", + "react-native-onyx": "1.0.21", "react-native-pdf": "^6.6.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From aa5597dac9f1618d1a2d3407799f8d49bf648c4a Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 11 Oct 2022 08:35:32 -1000 Subject: [PATCH 4/4] bump onyx version one more time --- package-lock.json | 26 +++++++++++++++++++------- package.json | 2 +- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc9b7e84d9e4..2bf290a7f306 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ "react-native-image-picker": "^4.8.5", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.21", + "react-native-onyx": "1.0.22", "react-native-pdf": "^6.6.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", @@ -24200,6 +24200,11 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "node_modules/fast-equals": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", + "integrity": "sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==" + }, "node_modules/fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -35515,11 +35520,12 @@ } }, "node_modules/react-native-onyx": { - "version": "1.0.21", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.21.tgz", - "integrity": "sha512-jd1jpZ+H8ou7YsdmRx7gUbMsym2/6xCIZixu1hI7TeB2jemHrurChULmL4x4r6TyqmlAGCZpmqeiD3aX2+UBLQ==", + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.22.tgz", + "integrity": "sha512-jg6Y+kc/p9W7NnRXcARrhhDyKemA2gDSYZCsmx5+P7S1nO0fNmGjhBSZULY9r4heEB7xFwQnT+IGgpfwAsUU9A==", "dependencies": { "ascii-table": "0.0.9", + "fast-equals": "^4.0.3", "lodash": "^4.17.21", "underscore": "^1.13.1" }, @@ -61370,6 +61376,11 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "fast-equals": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", + "integrity": "sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==" + }, "fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -70130,11 +70141,12 @@ } }, "react-native-onyx": { - "version": "1.0.21", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.21.tgz", - "integrity": "sha512-jd1jpZ+H8ou7YsdmRx7gUbMsym2/6xCIZixu1hI7TeB2jemHrurChULmL4x4r6TyqmlAGCZpmqeiD3aX2+UBLQ==", + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.22.tgz", + "integrity": "sha512-jg6Y+kc/p9W7NnRXcARrhhDyKemA2gDSYZCsmx5+P7S1nO0fNmGjhBSZULY9r4heEB7xFwQnT+IGgpfwAsUU9A==", "requires": { "ascii-table": "0.0.9", + "fast-equals": "^4.0.3", "lodash": "^4.17.21", "underscore": "^1.13.1" } diff --git a/package.json b/package.json index 5732b6c61e19..4d41e1b2887e 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "react-native-image-picker": "^4.8.5", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.21", + "react-native-onyx": "1.0.22", "react-native-pdf": "^6.6.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1",