-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add required changes to run Hybrid App #32471
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.
I added some comments. Could you also explain why are all those patches needed?
@@ -15,3 +15,49 @@ index b4c7106..d5083d3 100644 | |||
} | |||
classDirectories.setFrom(fileTree( | |||
dir: 'build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/onfido/reactnative/sdk', | |||
diff --git a/node_modules/@onfido/react-native-sdk/android/publish.gradle b/node_modules/@onfido/react-native-sdk/android/publish.gradle |
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.
We have a little bit different patch for this, maybe you should do it the same since our PR will also be merged soon most probably 😅 : https://github.com/Expensify/App/pull/31558/files#diff-38078bd96e4f2e196211b4e9eb902a3fd1a02b52238a7476813f92be71492105
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'm testing that out!
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.
It works with your solution, so I'm going to use it instead 😄
project.pluginManager.withPlugin("com.android.library", action) | ||
} | ||
+ | ||
+ fun configureNamespaceForLibraries(appProject: Project) { |
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 needed?
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.
Would be nice to add some 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.
Personally I have not changed this line - @mczernek Maybe you remember what was the reason behind this change?
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.
Because, Gradle from some version requires each and every library to declare namespace, and since not all of them do, we need to do that for them.
Here's more info about that: react-native-community/discussions-and-proposals#671
@@ -7,13 +7,13 @@ index 3a1a548..fe030bb 100644 | |||
|
|||
android { | |||
- compileSdkVersion 28 | |||
+ compileSdkVersion 30 | |||
+ compileSdkVersion 33 |
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.
Maybe we could bump it to 34 already?
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 we can leave it, since our project is currently configured to use 33
} | ||
|
||
Navigation.isNavigationReady().then(() => { | ||
Navigation.navigate(initUrl); |
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.
Is there a difference between null
and undefined
here? Or was there no particular reason that you used null
?
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.
What do you mean by that? I used null
as initial value for the context that contains initUrl
, but this part of code shouldn't be executed anyway if no url is passed in initialProps
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.
Yeah, I'm asking if there is a reason why is null
the initial value for the context, not undefined
.
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.
Actually I have just changed it to undefined
, because after giving it more thought it is better then null
(if no url is passed in initialProps, it's undefined
anyway
@@ -25,11 +26,21 @@ import useDefaultDragAndDrop from './hooks/useDefaultDragAndDrop'; | |||
import OnyxUpdateManager from './libs/actions/OnyxUpdateManager'; | |||
import * as Session from './libs/actions/Session'; | |||
import * as Environment from './libs/Environment/Environment'; | |||
import InitialUrlContext from './libs/InitialUrlContext'; |
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.
Is there a reason why those changes are here and not e.g. in Expensify
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.
That's because we use initial props, that are passed directly to App.js
file. 😄
src/pages/LogOutPreviousUserPage.js
Outdated
const sessionEmail = props.session.email; | ||
const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionURL, sessionEmail); | ||
const transitionUrl = NativeModules.ReactNativeModule ? CONST.DEEPLINK_BASE_URL + initUrl : url; |
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.
Are you sure that ReactNativeModule
is the best name for this new module? Maybe something more descriptive would be a better option?
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.
That is true, it was named this way looking from OldDot perspective, where React Native is a new addition. I believe we could rename it eg. HybridAppModule
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.
or HybridAppUtilsModule
@@ -24,7 +24,6 @@ def use_native_modules!(config = nil) | ||
# Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects | ||
cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" | ||
cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip | ||
- | ||
if (!config) | ||
json = [] | ||
|
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.
@@ -24,7 +24,6 @@ def use_native_modules!(config = nil) | |
# Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects | |
cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" | |
cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip | |
- | |
if (!config) | |
json = [] | |
@@ -26,6 +26,12 @@ - (dispatch_queue_t)methodQueue { | |||
return dispatch_get_main_queue(); | |||
} | |||
|
|||
+ (void)invalidateBootSplash { |
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.
Where do you call it?
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.
While leaving NewDot - in OldDot we use reference to this file, and we call it in ReactNativeManager's close
function. It is used to revert BootSplash to initial state, so it shows up again when NewDot gets opened multiple times.
Hey! I think everything is fine now 😄 |
What's the last change in InitialSettingsPage for? |
I think after the Ideal Nav merge the file changed slightly, and for HybridApp we must adjust the item list - remove the Sign Out, and redirect to Expensify website. We add a button to come back to Expensify Classic instead |
package.json
Outdated
@@ -59,7 +59,7 @@ | |||
}, | |||
"dependencies": { | |||
"@dotlottie/react-player": "^1.6.3", | |||
"@expensify/react-native-live-markdown": "git+ssh://[email protected]/Expensify/react-native-live-markdown.git#c316611781f19815caebfed5540e0faf2a274785", | |||
"@expensify/react-native-live-markdown": "git+ssh://[email protected]/Expensify/react-native-live-markdown.git#f0b63f41fa4c09bfa68439da0550b47bafd92fa2", |
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.
Please undo this change. Latest version will be bumped in #35852
@staszekscp please fix conflict. And Podfile.lock is still not commited |
ios/Podfile.lock
Outdated
- react-native-live-markdown (0.1.0): | ||
- glog | ||
- RCT-Folly (= 2022.05.16.00) | ||
- React-Core |
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 was accidentally removed?
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.
It's not removed, but renamed, you can see the package below. I suppose that in the version bump PR the pod install
command was not executed, so Podfile.lock
was not edited
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 run pod install
on latest main and diff doesn't occur
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.
Ok, you're right, I know what happened. npm i
didn't update react-native-live-markdown.podspec
file without deleting node_modules
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'll push the change in a moment
ios/Podfile.lock
Outdated
Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047 | ||
|
||
PODFILE CHECKSUM: 0ccbb4f2406893c6e9f266dc1e7470dcd72885d2 | ||
|
||
COCOAPODS: 1.13.0 | ||
COCOAPODS: 1.14.3 |
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.
Let's not bump pod version here. It's out of scope
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.
Yeah, I was aware of that, it is fixed already
typecheck failing |
VisionCamera: 7d13aae043ffb38b224a0f725d1e23ca9c190fe7 | ||
Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047 | ||
VisionCamera: fda554d8751e395effcc87749f8b7c198c1031be | ||
Yoga: 13c8ef87792450193e117976337b8527b49e8c03 |
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 need to update Yoga as well
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.
Here I cannot do much about it, removing and generating Podfile.lock
geve me the same result.
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 could manually update the file, but I would rather not do it.
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 checksum depends on device or OS where pod is being installed.
i.e. 13c8ef87792450193e117976337b8527b49e8c03 on your device and e64aa65de36c0832d04e8c7bd614396c77a80047 on my device
If you check commit history, this line has changed many times depending on PR author's device where pod is installed and committed
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.
In that case what would you suggest?
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.
nothing to suggest as this is RN upstream issue
either value is fine to me
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 prefer e64aa65de36c0832d04e8c7bd614396c77a80047 since it seems to match with COCOAPODS: 1.13.0 on most devices
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.
But anyway I think in that case we can leave it as it is, and the PR is currently ready 😄
@AndrewGable all yours |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@situchan @AndrewGable could you explain what exactly the QA team to validate? |
🚀 Deployed to staging by https://github.com/AndrewGable in version: 1.4.38-0 🚀
|
@kavimuru nothing new to validate. |
🚀 Deployed to staging by https://github.com/AndrewGable in version: 1.4.38-0 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.38-6 🚀
|
const HYBRID_APP_ROUTES = { | ||
MONEY_REQUEST_CREATE: '/request/new/scan', | ||
} as const; | ||
|
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.
@staszekscp @situchan, coming from #35455 (comment) /request/new/scan
is now replaced by a dynamic route now, can you pls let us know if we can change this to start/request/scan
?
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.
Hey! Thanks for tagging, and catching that! Actually it can stay as it is - the value is passed from OldDot, and then is mapped in NewDot to provide correct url. So unless the ROUTES.MONEY_REQUEST_CREATE.getRoute
function changes, we don't have to update anything there. I'll keep it in mind for future changes, though!
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.
@staszekscp thanks for the answer, there are typecheck fails so we need to update something to get rid of that, can you pls check this, just to be 100% sure.
cc: @AndrewGable
Details
The changes required to run Hybrid App. In this PR we tweak deeplink handling, and add patches required for running the app in OldDot. For more context, the patches are necessary to build app in a project with custom folder structure. They look for specific variables declared in
Podfile
orbuild.gradle
, if the variables are not found, the patches will fallback to the current behaviour. Therefore they should introduce no change to NewDot.Fixed Issues
$ #31511 #31510 #31509 #31508 #31512
PROPOSAL: Design Doc
Tests
Offline tests
QA Steps
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