Repository navigation
Expose Onyx.get to window for easier debugging - #37138
Conversation
rlinoz
left a comment
There was a problem hiding this comment.
This is gonna be super useful, thanks!
It would be nice to not have to write the console.log part, since it's probably what we will use the most?
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Hey @roryabraham, WDYT about adding smth like this as well? window.Onyx.log = function (key) { window.Onyx.get(key).then(value => console.log(value)) }This way, we'll be able to simply call
|
|
Good suggestion, created #37172 |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 1.4.44-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀
|

Details
This PR does two things:
Onyxobject on any non-production environment, not just development. This is meant to make it easier to triage / debug issues on staging.Onyx.getutility solely for the sake of debugging, not for use in production code. We intentionally don't exposeOnyx.getbecause we are worried that its usage will lead to patterns we don't want to see in this codebase. Trying to use this anywhere else in the codebase will lead to a TS errorFixed Issues
$ n/a - slack discussion: https://expensify.slack.com/archives/C01GTK53T8Q/p1708639651946339
Tests / QA Steps
Onyx.get('account').then(account => console.log(account))Offline tests
n/a
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop