-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expose Onyx.get to window for easier debugging #37138
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
Onyx
object on any non-production environment, not just development. This is meant to make it easier to triage / debug issues on staging.Onyx.get
utility solely for the sake of debugging, not for use in production code. We intentionally don't exposeOnyx.get
because 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop