You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.jsonexpo.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!!)
The text was updated successfully, but these errors were encountered:
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
changed the title
Possible improvements to cross-platform support
[Feature Request] Possible improvements to cross-platform support
Aug 23, 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 useweb
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, etcAnd 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🤦 Doh! I Reviewed the plugin code and the interface is all appropriately build-level config. (Nice!!)app.json
expo.plugins
config. Avoids having to create new builds any time there's a change.The text was updated successfully, but these errors were encountered: