aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

Support for React Native new architecture and bridgeless #13116

Open brentvatne opened 6 months ago

brentvatne commented 6 months ago

Is this related to a new or existing framework?

React Native

Is this related to a new or existing API?

Authentication

Is this related to another service?

Cognito

Describe the feature you'd like to request

Hi there! I'm working on supporting the roll out of the new architecture + bridgeless with Expo and Meta, and as part of that we identified which libraries are depended on by the largest apps and the most popular native libraries on EAS Build to help prioritize which libraries to investigate. amazon-cognito-identity-js came up on that list. See the list on Google Sheets (request edit access if you'd like to update the status of amazon-cognito-identity-js after testing, or if you prefer to report back here on this issue it's fine too).

We want to start recommending folks try out the new architecture in the next release, react-native 0.74 / Expo SDK 51. Ideally we can get the ecosystem ready to switch over to the new architecture within the next few releases. So, we'll have from now until 0.74 release (before May) to give Meta feedback on anything that might not be working as expected with the new arch/bridgeless enabled.

Folks at Meta would really appreciate it if you could test your libraries against the latest release and report any issues that you find. This new version enables an interop layer by default, so hopefully many things will just work, but the more off of the beaten path of a simple module / view that a library goes the more likely it is to encounter possible issues ;) The following gist includes a step by step process for how to test your library and report issues: https://gist.github.com/cipolleschi/82b7a9561b8861330efabbd3eb08c6f5.

Describe the solution you'd like

amazon-cognito-identity-js is compatible with React Native's new architecture and bridgeless, and also compatible with the old architecture.

Describe alternatives you've considered

No alternatives that I'm aware of

Additional context

No response

Is this something that you'd be interested in working on?

cshfang commented 6 months ago

@brentvatne - thanks for bringing this up. I have a couple of a clarifying questions:

  1. Is the ask to validate that amazon-cognito-identity-js works as-is with RN 0.74? I.e. there is not an ask here to update the package itself and
  2. Is this at all related to Expo Go?
brentvatne commented 6 months ago

hi @cshfang! thanks for the quick response.

  1. Is the ask to validate that amazon-cognito-identity-js works as-is with RN 0.74? I.e. there is not an ask here to update the package itself

correct! specifically, that it works with the latest react-native@0.74-rc with the new architecture, with bridgeless enabled and without it enabled, using the information in this doc as guidance: https://gist.github.com/cipolleschi/82b7a9561b8861330efabbd3eb08c6f5

I expect that it will just work because 0.74-rc enables an interop layer by default for new arch, and this module is fairly simple, but it would be good to verify!

  1. Is this at all related to Expo Go?

nope!

cshfang commented 6 months ago

Gotcha. Will follow up with the team tomorrow morning and figure out a test plan.

Thanks!

cwomack commented 6 months ago

@brentvatne, we're marking this as a feature request and are reviewing this internally as @cshfang stated above. We'll let you know if there's any further questions. Thanks!

cshfang commented 4 months ago

@brentvatne

Sorry for not getting back to you sooner. Obviously, at this point, RN 0.74 has been out for weeks 🤦

We did actually run through most of the use cases for amazon-cognito-identity-js against RN 0.74 with and without bridgeless mode enabled on the new an old architecture and were able to confirm that everything worked as expected (as you suspected). We'll keep this ticket open for now to see if we need more in-depth testing but I appreciate you helping us to try to get ahead of this ❤️

brentvatne commented 2 months ago

@cshfang - thanks! I also wanted to update you to let you know we are tracking new arch compatibility status in the official react-native library directory now, eg: for aws libraries, https://reactnative.directory/?search=aws-

you can add/modify entries for your libraries in react-native-libraries.json via a pull request (more info in readme).