Skip to content

feat: add new arch#557

Merged
dtroupe-plaid merged 37 commits intoplaid:masterfrom
WoLewicki:@wolewicki/add-fabric
May 9, 2024
Merged

feat: add new arch#557
dtroupe-plaid merged 37 commits intoplaid:masterfrom
WoLewicki:@wolewicki/add-fabric

Conversation

@WoLewicki
Copy link
Copy Markdown
Contributor

Summary

PR adding new arch to the library. It should no longer be needed to do any autolinking since it is done automatically and TurboModule is used when they are enabled in the project.

Motivation

It makes the library compatible with new architecture, so users can take advantage of it.

📝 Checklist

  • I have performed a self-review of my own code.
  • I have optimized code readability (class/variable names, straight forward logic paths, short clarifying docs,...).

💚 Testing

  • I have manually tested my changes. (In Expensify App)

You can run FabricExample app in order to see that it also works correctly on new arch

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes. (theoretically since it should be transparent for the users)

@WoLewicki
Copy link
Copy Markdown
Contributor Author

@dtroupe-plaid for some reason the newest commits were not applied to the previous PR so here is another one. Could you test if it works correctly?

@dtroupe-plaid dtroupe-plaid changed the base branch from develop to master November 9, 2023 18:14
@WoLewicki
Copy link
Copy Markdown
Contributor Author

@dtroupe-plaid is there a chance that it can be reviewed and merged somehow?

@WoLewicki
Copy link
Copy Markdown
Contributor Author

I temporarily added dist folder to be able to use it in the project, but I'll delete it when it is time to merge it 🚀

@dtroupe-plaid
Copy link
Copy Markdown
Collaborator

@dtroupe-plaid is there a chance that it can be reviewed and merged somehow?

Yes. Sorry for the delay I was OOO and prior to that we had a packed roadmap. I will have time to look at this tomorrow in the hopes we can merge it next week 🤞 can you resolve any conflicts and merge master (this change will only be supported in V11.x) 🙏

Copy link
Copy Markdown
Collaborator

@dtroupe-plaid dtroupe-plaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WoLewicki I reviewed the PR and don't have many comments on the code. However, I do have some concerns about the example applications. Both examples work on iOS, but I was unable to get either example to run successfully on Android.

  • For the existing example app npm run android fails with a compiler error.
  • For the Fabric example the app appears to crash or freeze immediately upon opening. (see attached screen recording).
  • I tested android using a Pixel 7 API 34

Once the issues with the example applications are resolved I can approve this 🙏

Additionally, the fabric example will need a simple README similar to the existing example (not a blocker on this PR).

Let me know if you have any questions or concerns.

Screen.Recording.2024-02-02.at.11.53.54.mov

private const val LINK_TOKEN_PREFIX = "link"

const val TAG = "PlaidAndroid"
const val NAME = "PlaidAndroid"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

Comment on lines +116 to +130
override fun continueFromRedirectUriString(redirectUriString: String?) {
Log.e("PlaidModule", "continueFromRedirectUriString is not available on Android")
}

override fun create(token: String, noLoadingState: Boolean) {
Log.e("PlaidModule", "create is not available on Android")
}

override fun open(fullScreen: Boolean, onSuccess: Callback?, onExit: Callback?) {
Log.e("PlaidModule", "open is not available on Android")
}

override fun dismiss() {
Log.e("PlaidModule", "dismiss is not available on Android")
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing we need to have these methods to support iOS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to implement the methods of the interface

Comment thread ios/RNLinksdk.mm Outdated
Comment on lines +175 to +177
- (void)continueFromRedirectUriString:(NSString *)redirectUriString {
RCTLogError(@"continueFromRedirectUriString is not supported on iOS");
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this isn't supported on iOS or Android should be remove this method?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I left it since it was present in JS but I can remove it everywhere 🚀

Comment thread package.json Outdated
"typescript": "^4.9.5"
},
"dependencies": {
"react-native-plaid-link-sdk": "^10.4.0"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"react-native-plaid-link-sdk": "^10.4.0"
"react-native-plaid-link-sdk": "^11.5.0"

@WoLewicki
Copy link
Copy Markdown
Contributor Author

@dtroupe-plaid could you check again if everything builds correctly and there are no more crashes? And if so, could we get it merged and released? 🚀

@davecusatis
Copy link
Copy Markdown

@dtroupe-plaid @WoLewicki I would also love to see this get merged :)

@WoLewicki
Copy link
Copy Markdown
Contributor Author

I am open to merging the newest master branch to resolve conflicts.

@dtroupe-plaid
Copy link
Copy Markdown
Collaborator

I should have time to review this next week. If everything works we can merge it 😄

@WoLewicki
Copy link
Copy Markdown
Contributor Author

@dtroupe-plaid I resolved conflicts and migrated the new view to new arch also. Could you review it and test that the view behaves correctly so we can merge it?

dtroupe-plaid
dtroupe-plaid previously approved these changes May 8, 2024
Copy link
Copy Markdown
Collaborator

@dtroupe-plaid dtroupe-plaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current Android example still does not work. I can't approve this until the example applications work.

I apologize for the delay - Please test the Android example app and ensure it works before requesting another review 🙏

Comment on lines +8 to +9
import com.facebook.react.viewmanagers.PLKEmbeddedViewManagerDelegate
import com.facebook.react.viewmanagers.PLKEmbeddedViewManagerInterface
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file prevent the current example from compiling for Android.

file:///Users/dtroupe/plaid/client/link/react-native/react-native-plaid-link-sdk/example/node_modules/react-native-plaid-link-sdk/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt:8:40 Unresolved reference: PLKEmbeddedViewManagerDelegate
Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
e: file:///Users/dtroupe/plaid/client/link/react-native/react-native-plaid-link-sdk/example/node_modules/react-native-plaid-link-sdk/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt:11:3 Unresolved reference: PLKEmbeddedViewManagerInterface
e: file:///Users/dtroupe/plaid/client/link/react-native/react-native-plaid-link-sdk/example/node_modules/react-native-plaid-link-sdk/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt:15:16 Unresolved reference: PLKEmbeddedViewManagerDelegate
e: file:///Users/dtroupe/plaid/client/link/react-native/react-native-plaid-link-sdk/example/node_modules/react-native-plaid-link-sdk/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt:27:3 'setToken' overrides nothing
e: file:///Users/dtroupe/plaid/client/link/react-native/react-native-plaid-link-sdk/example/node_modules/react-native-plaid-link-sdk/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt:31:3 'setIOSPresentationStyle' overrides nothing FAILURE: Build failed with an exception

@dtroupe-plaid dtroupe-plaid dismissed their stale review May 8, 2024 22:28

should not be approved

Copy link
Copy Markdown
Collaborator

@dtroupe-plaid dtroupe-plaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current Android example app doesn't compile I can't approve this until the example application works.

I apologize for the delay - I would like to get this merged to help, but I don't get a lot of time allocated to this. Please test the current Android example locally to resolve these issues before requesting another review 🙏

You can test local changes with yalc like this:

tsc && yalc publish && cd example && yalc add react-native-plaid-link-sdk && npm install && npm run android

@WoLewicki
Copy link
Copy Markdown
Contributor Author

@dtroupe-plaid could you check again? I added missing files.

Copy link
Copy Markdown
Collaborator

@dtroupe-plaid dtroupe-plaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retested everything looks 👌

@dtroupe-plaid dtroupe-plaid merged commit e521cfe into plaid:master May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants