-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[config][dev-launcher] Fix compatibility with SDK 44 #15562
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esamelson
approved these changes
Dec 14, 2021
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.
🎉
esamelson
force-pushed
the
@lukmccall/dev-launcher/fix-config-plugin
branch
from
December 15, 2021 01:18
05bdedb
to
e7a90b3
Compare
esamelson
pushed a commit
that referenced
this pull request
Dec 15, 2021
3 tasks
lukmccall
pushed a commit
that referenced
this pull request
Dec 15, 2021
Co-authored-by: Łukasz Kosmaty <lukasz.kosmaty@swmansion.com># Why when testing #15562 on the sdk-44 branch I found there were still a few issues -- (1) some expo-modules stuff would be inadvertently removed from AppDelegate, even though the project would build, and (2) tests were failing. # How (commit 1) added the correct logic for SDK 44's `initializeReactNativeApp` function (these regexes are getting so messy, we can't move to expo module initialization soon enough 😅 ), and added tests with a corresponding SDK 44 AppDelegate.m. (commit 2) fixed wrong string constant that was causing failures for SDK 43 and below (commit 3) fixed tests on the Android side that were logging warnings. @lukmccall is it correct to say that this config plugin cannot handle projects where `createReactActivityDelegate` isn't already overridden in MainActivity? I modified the tests as such, but if that isn't the case, [this warning](https://github.com/expo/expo/blob/4ca5ff72ef3abcc30cb7936eaf9c4b97fed9a5ad/packages/expo-dev-launcher/plugin/src/withDevLauncher.ts#L205-L209) needs to be changed. # Test Plan All tests pass. Manually tested in a blank SDK 44 app; cherry picked these commits onto sdk-44 and then used patch-package to patch entire the expo-dev-launcher package to match sdk-44 HEAD. Ran expo prebuild, saw no errors, eyeballed the code changes, and tested the following scenarios: ✅ project builds on iOS and Android ✅ iOS: can open app served by `expo start --dev-client` ✅ iOS: can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ Android: can open app served by `expo start --dev-client` ✅ Android: can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ expo install expo-updates@0.11.2, expo prebuild --clean, project builds ✅ iOS (with expo-updates integration): can open app served by `expo start --dev-client` ✅ iOS (with expo-updates integration): can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ iOS (with expo-updates integration): can open published app ✅ Android (with expo-updates integration): can open app served by `expo start --dev-client` ✅ Android (with expo-updates integration): can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ Android (with expo-updates integration): can open published app
lukmccall
pushed a commit
that referenced
this pull request
Dec 15, 2021
Co-authored-by: Łukasz Kosmaty <lukasz.kosmaty@swmansion.com># Why when testing #15562 on the sdk-44 branch I found there were still a few issues -- (1) some expo-modules stuff would be inadvertently removed from AppDelegate, even though the project would build, and (2) tests were failing. # How (commit 1) added the correct logic for SDK 44's `initializeReactNativeApp` function (these regexes are getting so messy, we can't move to expo module initialization soon enough 😅 ), and added tests with a corresponding SDK 44 AppDelegate.m. (commit 2) fixed wrong string constant that was causing failures for SDK 43 and below (commit 3) fixed tests on the Android side that were logging warnings. @lukmccall is it correct to say that this config plugin cannot handle projects where `createReactActivityDelegate` isn't already overridden in MainActivity? I modified the tests as such, but if that isn't the case, [this warning](https://github.com/expo/expo/blob/4ca5ff72ef3abcc30cb7936eaf9c4b97fed9a5ad/packages/expo-dev-launcher/plugin/src/withDevLauncher.ts#L205-L209) needs to be changed. # Test Plan All tests pass. Manually tested in a blank SDK 44 app; cherry picked these commits onto sdk-44 and then used patch-package to patch entire the expo-dev-launcher package to match sdk-44 HEAD. Ran expo prebuild, saw no errors, eyeballed the code changes, and tested the following scenarios: ✅ project builds on iOS and Android ✅ iOS: can open app served by `expo start --dev-client` ✅ iOS: can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ Android: can open app served by `expo start --dev-client` ✅ Android: can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ expo install expo-updates@0.11.2, expo prebuild --clean, project builds ✅ iOS (with expo-updates integration): can open app served by `expo start --dev-client` ✅ iOS (with expo-updates integration): can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ iOS (with expo-updates integration): can open published app ✅ Android (with expo-updates integration): can open app served by `expo start --dev-client` ✅ Android (with expo-updates integration): can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ Android (with expo-updates integration): can open published app
DominickVale
pushed a commit
to DominickVale/expo
that referenced
this pull request
Dec 15, 2021
DominickVale
pushed a commit
to DominickVale/expo
that referenced
this pull request
Dec 15, 2021
Co-authored-by: Łukasz Kosmaty <lukasz.kosmaty@swmansion.com># Why when testing expo#15562 on the sdk-44 branch I found there were still a few issues -- (1) some expo-modules stuff would be inadvertently removed from AppDelegate, even though the project would build, and (2) tests were failing. # How (commit 1) added the correct logic for SDK 44's `initializeReactNativeApp` function (these regexes are getting so messy, we can't move to expo module initialization soon enough 😅 ), and added tests with a corresponding SDK 44 AppDelegate.m. (commit 2) fixed wrong string constant that was causing failures for SDK 43 and below (commit 3) fixed tests on the Android side that were logging warnings. @lukmccall is it correct to say that this config plugin cannot handle projects where `createReactActivityDelegate` isn't already overridden in MainActivity? I modified the tests as such, but if that isn't the case, [this warning](https://github.com/expo/expo/blob/4ca5ff72ef3abcc30cb7936eaf9c4b97fed9a5ad/packages/expo-dev-launcher/plugin/src/withDevLauncher.ts#L205-L209) needs to be changed. # Test Plan All tests pass. Manually tested in a blank SDK 44 app; cherry picked these commits onto sdk-44 and then used patch-package to patch entire the expo-dev-launcher package to match sdk-44 HEAD. Ran expo prebuild, saw no errors, eyeballed the code changes, and tested the following scenarios: ✅ project builds on iOS and Android ✅ iOS: can open app served by `expo start --dev-client` ✅ iOS: can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ Android: can open app served by `expo start --dev-client` ✅ Android: can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ expo install expo-updates@0.11.2, expo prebuild --clean, project builds ✅ iOS (with expo-updates integration): can open app served by `expo start --dev-client` ✅ iOS (with expo-updates integration): can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ iOS (with expo-updates integration): can open published app ✅ Android (with expo-updates integration): can open app served by `expo start --dev-client` ✅ Android (with expo-updates integration): can open app served by `expo start --dev-client --force-manifest-type=expo-updates` ✅ Android (with expo-updates integration): can open published app
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
A follow-up to #15541 (review).
How
The regex which wraps activity delegates caused an infinity loop. I replaced that with a different approach - I'm not longed using regex.
Also, the init block on iOS is different.
Test Plan
expo prebuild
in a project with SDK 44 beta.