Skip to content
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

[Feature Request] Possible improvements to cross-platform support #795

Open
leggomuhgreggo opened this issue Aug 22, 2024 · 0 comments
Open

Comments

@leggomuhgreggo
Copy link

leggomuhgreggo commented Aug 22, 2024

Background

I am working on implementing stripe in a cross-platform* expo app, and trying to sort through how to handle the stripe features for different platforms.

[ *Technically it's only shipping to ios, but we use web for E2E testing ]

Acknowledgements

To be fair, it's really not much trouble for us to write our implementation so that the Stripe SDK invocations are behind platform conditioning — just shimming the export interface in a parallel *.web.tsx file, etc

And I understand that this library is intended for just native platforms. [ Related: #372 (comment) ]

Platform Conditioning?

But it would be so cool if the lib exports had platform conditioning baked in. One alternative to shimming the "main" exported modules themselves, would be to shim/condition *just* the specific SDK features that relied on Native APIs — that way it would have at least partial functionality in web!

I think it might even be possible to condition those native API usages, based on the availability of the given API — as opposed to platform — that way if web browsers ever adds support for (say) bluetooth — the functionality will be there.

Conclusion

I understand if roadmap constraints + scope concerns make this difficult to accommodate in the near term. I suspect that this use case will become increasingly common, so it may be advantageous in that sense.

Thank you for your consideration!

EDIT: Oh it might also be nifty to support passing config via an init function, in the JS, instead of the app.json expo.plugins config. Avoids having to create new builds any time there's a change. 🤦 Doh! I Reviewed the plugin code and the interface is all appropriately build-level config. (Nice!!)

@leggomuhgreggo leggomuhgreggo changed the title Add platform conditioning for native dependencies in JS code, to enable (partial) Web/ExpoGo support Possible improvements to cross-platform support Aug 22, 2024
@leggomuhgreggo leggomuhgreggo changed the title Possible improvements to cross-platform support [Feature Request] Possible improvements to cross-platform support Aug 23, 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

No branches or pull requests

1 participant