Fubinator / react-native-userbase-poc

MIT License
2 stars 1 forks source link

Add patch-package and update rn-nodeify #4

Closed jneterer closed 3 years ago

jneterer commented 3 years ago

Adding patch-package to manage local dependency code changes. This is used to modify Userbase's hash algorithm name, changing it to lowercase sha-256 to work with browserify-sign which is used by rn-nodeify. The change will be made automatically when installing dependencies, triggered by the postinstall script in package.json.

Also updating rn-nodeify to 10.3.0 which includes a PR from @Fubinator.

Fubinator commented 3 years ago

This is looking good so far! Could you please update the README so that the instructions that are now no longer necessary no longer appear there?

Fubinator commented 3 years ago

Okay, I've just tested it: The patch overwrites userbase's /lib/Crypto/sha-256.js file. This file won't be executed because in userbase's package.json is a main entry which points to the /dist/userbase.cjs.js file. So the patch should either overwrite /dist/userbase.cjs.js or change the main entry in the package.json file.

jneterer commented 3 years ago

@Fubinator Okay the PR is updated. I merged your master with my PR and ran some quick tests. Performing sign in 10 times took 10.86, 11.086, 11.567, 13.65, 10.992, 10.246, 13.455, 10.992, 10.7, and 11.997 seconds, respectively.

Fubinator commented 3 years ago

@jneterer Thank you very much! Signing in takes about 3x as long for me, as I said. I will try to investigate this further. I'm not sure if it's the emulator or some implementations are very slow. However, I am happy that we both can now at least already sign in :smile: