richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
219 stars 77 forks source link

[Feature Request] Bump @stripe/stripe-js dependency to v2 releases #224

Closed ainsly closed 11 months ago

ainsly commented 1 year ago

Is your feature request related to a problem? Please describe. So the @stripe/stripe-js package has been on v2 since last month. And I'm curious as to what your release schedule will be for bumping the dependency to the latest version (currently 2.1.2)

This technically is a breaking change, since they removed a value from an enum in the Appearance API Here's the PR in question I'm not sure if this was very widely used feature, which is probably why they removed it. But it may affect people that are using it.

My main concern is that I can see that the ngx-stripe versions are tracking Angular's versions (16, 15, 14 etc.), so I'm not sure if you'd want to release a v17 which would break this convention. However, it would be good to be proactive and stay up to date with @stripe/stripe-js changes.

All the current changes on the v2 branch are minor/patch versions which only seem to update types, nevertheless, once they start adding more substantial commits it would be nice to be able to easily get them downstream from this package without the need for overrides, and the updates may start rolling in more frequently since Stripe released a new API version recently.

Instead of a full v17 release, might it be possible to switch @stripe/stripe-js to a peer dependency, but with a range that also accepts v2? Then it could potentially prevent a breaking change and allow developers to choose which version suits them.

To be fair, provided no bigger changes are made to the @stripe/stripe-js, waiting for Angular v17 wouldn't be the end of the world, since the release schedule is forecast for Nov 6th 2023, not too far off. But something is to be said of the coupling between angular, @stripe/stripe-js and ngx-stripe versions; would we need to wait until a new Angular version is released (and ngx-stripe afterwards) every time a new major version of @stripe/stripe-js is released?

OR, maybe a v17 release of ngx-stripe isn't an issue, or maybe only a minor version release if it's documented clearly. But to adhere to strict semver versioning a new major release should probably be done since the @stripe/stripe-js API is directly used by the package and also exposes it.

Let me know your thoughts!

Describe the solution you'd like Bump @stripe/stripe-js version to use latest v2 versions.

Describe alternatives you've considered Using npm overrides / yarn resolutions to force the ngx-stripe to use latest version of @stripe/stripe-js

Additional context

richnologies commented 1 year ago

hey @ainsly,

Yeah, one of the reasons I have not update them yet, is because of this. TBH, right now I'm inclined to keep our major system and just upgrade them. The point is, if you're using Angular v13 you might also want the latest StripeJS features.

Not sure if there is a good way to notify people of the potential breaking change other than add it to the Changelog, and perhaps the readme.

So, you're absolutely right, we will be "bending" semver here, but I think is the best choice. The alternative is no one other than v17 users can get access to the latest features. I think is a great affordance in ngx-stripe major matching Angular's major