-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement Shared StatusBarManagerModule and Do Module Cleanup #4609
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
| // Licensed under the MIT License. | ||
|
|
||
| #include "StatusBarManagerModule.h" | ||
| #include <VersionHelpers.h> |
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.
Nit: I can remove this header.
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.
| modules.push_back(std::make_unique<CxxNativeModule>( | ||
| m_innerInstance, | ||
| StatusBarManagerModule::Name, | ||
| []() { return std::make_unique<StatusBarManagerModule>(); }, |
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.
Intentionally not noexcept. I know this has come up before.
When we call a throwing function (e.g. make_unique) in something noexcept, we need to generate the implicit catch and terminate. This paradoxically means declaring this as noexcept actually increases binary overhead when the caller isn't noexcept either.
I.e. sandwiching noexcept in thin layers between throwing call graphs doesn't help anything.
| }); | ||
| } | ||
|
|
||
| AppTheme::~AppTheme() = default; |
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.
Why is it removed? There are some advantages keeping default destructors in .cpp file. Especially if the default constructor has to clean up a lot of variables.
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.
Could you elaborate a bit?
vmoroz
left a comment
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.
![]()
|
Hello @NickGerleman! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…oft#4609) * Change files * Fix build for ReactUwp/Win32 Playground * Yarn format * Remove unneeded module
Relates to #4363
We needed to remove some JS stubbing during the 0.62 upgrade. This exposed a require-time dependence on some form of StatusBarManager module existing, as we require both Android and iOS JS which will get both. We already have a UWP implementation but don't have one for Win32. Add a new module to share between platforms.
Some design points:
While I was doing this I discovered some other issues, like a shared stub version of AppThemeModule which we don't need or want, and never expose. This is removed, and cleaned up. There was also a bit of cleanup for ReactWindowsCore filters, missing rvalue tokens.
Tested we can boot RNTester for UWP, and that the AppTheme RNTester page shows correct results.
Microsoft Reviewers: Open in CodeFlow