-
Notifications
You must be signed in to change notification settings - Fork 25k
Include autolinkin.h in OnLoad.cpp only if it exists #47875
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
|
This pull request was exported from Phabricator. Differential Revision: D66295318 |
Summary: The old architecture looks broken because in the OnLoad.cpp file we try to include the autolinking.h header which is only generated when the New Architecture is enabled. This fix guards the include and the usage of the function provided by the autolinking so that the old architecture should work as well. ## Changelog [Internal] - Include autolinkin.h in OnLoad.cpp only if it exists Differential Revision: D66295318
2ed3eb8 to
4b1c9ea
Compare
|
This pull request was exported from Phabricator. Differential Revision: D66295318 |
Summary: The old architecture looks broken because in the OnLoad.cpp file we try to include the autolinking.h header which is only generated when the New Architecture is enabled. This fix guards the include and the usage of the function provided by the autolinking so that the old architecture should work as well. ## Changelog [Internal] - Include autolinkin.h in OnLoad.cpp only if it exists Reviewed By: blakef Differential Revision: D66295318
4b1c9ea to
fe53b67
Compare
|
This pull request was exported from Phabricator. Differential Revision: D66295318 |
| #endif | ||
|
|
||
| return nullptr; |
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.
Clang might complain about unreachable code (with -Wunreachable-code):
| #endif | |
| return nullptr; | |
| #else | |
| return nullptr; | |
| #endif |
| #include <DefaultComponentsRegistry.h> | ||
| #include <DefaultTurboModuleManagerDelegate.h> | ||
| #if __has_include("<autolinking.h>") | ||
| #define AUTOLINKING_AVAILABLE 1 |
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: Technically, autolinking is still available. Just not TurboModules.
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.
the define is just to have a quick way to compile out the pieces that could not be available in the rest of the file.
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.
No, I know. I was commenting on the name of the macro 😄
| REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry); | ||
| #endif | ||
|
|
||
| #if AUTOLINKING_AVAILABLE |
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.
I think on iOS, we can enable New Arch at runtime. I don't recall if we can on Android. If so, won't this break on Android?
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.
No, android can't disable the new arch at runtime. You can disable some pieces, but it is not recommended.
|
This pull request has been merged in b8419b2. |
|
This pull request was successfully merged by @cipolleschi in b8419b2 When will my fix make it into a release? | How to file a pick request? |
Summary: Pull Request resolved: #47875 The old architecture looks broken because in the OnLoad.cpp file we try to include the autolinking.h header which is only generated when the New Architecture is enabled. This fix guards the include and the usage of the function provided by the autolinking so that the old architecture should work as well. ## Changelog [Internal] - Include autolinkin.h in OnLoad.cpp only if it exists Reviewed By: blakef Differential Revision: D66295318 fbshipit-source-id: 18461e6b70ac92af57b805bef51c0df49db02283
This reverts commit 5b2bbb8.
…k#47875)" Summary: We reverted [this commit](facebook@5b2bbb8) in 0.76 and 0.77 as it was not the right fix. ## Changelog [Internal] - Revert excluding `autolinking.h` only if it exists Differential Revision: D67456530
#48341) Summary: Pull Request resolved: #48341 We reverted [this commit](5b2bbb8) in 0.76 and 0.77 as it was not the right fix. ## Changelog [Internal] - Revert excluding `autolinking.h` only if it exists Reviewed By: alanleedev Differential Revision: D67456530 fbshipit-source-id: 0f7bfc11d23f7a8fef5100784754add5b4ecda58
Summary:
The old architecture looks broken because in the OnLoad.cpp file we try to include the autolinking.h header which is only generated when the New Architecture is enabled.
This fix guards the include and the usage of the function provided by the autolinking so that the old architecture should work as well.
Changelog
[Internal] - Include autolinkin.h in OnLoad.cpp only if it exists
Differential Revision: D66295318