Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD Web-Expensify/pull/35134] Add DEBUG_ONYX_SET_STATE mode + bump Onyx version to 1.0.22 to help prevent re-renders #11598

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ USE_WEB_PROXY=false
USE_WDYR=false
CAPTURE_METRICS=false
ONYX_METRICS=false
ONYX_DEBUG_SET_STATE=false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/CONFIG.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
2 changes: 2 additions & 0 deletions src/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
/*
Expand All @@ -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
Expand Down