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
Is your feature request related to a problem? Please describe.
In "edge runtimes" such as Cloudflare Workers, Vercel Edge Functions, the size of the application code comes at a premium (as little as 1MB of JS). In such environments it is beneficial to have modular exports/entrypoints that allow importing only the code that is required so that bundlers can remove unused code.
This concept is also generally useful for reducing the startup time of any app, not just edge runtimes.
The Stripe SDK has many modules so it's not small.
Describe the solution you'd like
In addition to the existing API, provide modular exports as an alternative for importing only the required functionality.
I notice the SDK is already structured in much the same way as this behind the scenes. But there a a few issues with the above proposed API... eg an app would potentially instantiate many instances of the modules around it's codebase. There are a few ways to improve this but needs careful consideration about the API.
Hi @brettwillis. Thanks for bringing this up! We plan to investigate ways to make the SDK less resource-intensive in the future. We have also thought about using tree-shaking to do this, see #1693. I'll keep this issue open and update once there is progress here.
Is your feature request related to a problem? Please describe.
In "edge runtimes" such as Cloudflare Workers, Vercel Edge Functions, the size of the application code comes at a premium (as little as 1MB of JS). In such environments it is beneficial to have modular exports/entrypoints that allow importing only the code that is required so that bundlers can remove unused code.
This concept is also generally useful for reducing the startup time of any app, not just edge runtimes.
The Stripe SDK has many modules so it's not small.
Describe the solution you'd like
In addition to the existing API, provide modular exports as an alternative for importing only the required functionality.
This could look like:
I notice the SDK is already structured in much the same way as this behind the scenes. But there a a few issues with the above proposed API... eg an app would potentially instantiate many instances of the modules around it's codebase. There are a few ways to improve this but needs careful consideration about the API.
So even better yet, something like this:
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: