KEMBAR78
[breaking] Replace optional stripe.elements mode params with discriminated union by alexlande-stripe · Pull Request #756 · stripe/stripe-js · GitHub
Skip to content

Conversation

@alexlande-stripe
Copy link
Contributor

@alexlande-stripe alexlande-stripe commented May 7, 2025

Summary & motivation

Updates StripeElementsOptionsMode to use a discriminated union on mode for better type safety around conditionally required parameters amount and currency. See the updated tests for examples!

This is a breaking change because these type changes are not backwards compatible, although no behavior has actually changed (the types are just more accurate).

Testing & documentation

Added valid and invalid test cases, and fixed a valid test case that was not actually valid but was caught by this change.

Copy link

@ssablan-stripe ssablan-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! 😎

@alexlande-stripe alexlande-stripe changed the title Replace optional stripe.elements mode params with discriminated union [breaking] Replace optional stripe.elements mode params with discriminated union May 7, 2025
@stale
Copy link

stale bot commented May 28, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 28, 2025
@stale stale bot closed this Jun 5, 2025
@cbala-stripe cbala-stripe reopened this Jul 15, 2025
@github-actions github-actions bot removed the stale label Jul 16, 2025
@pololi-stripe pololi-stripe merged commit bfa9dd1 into master Sep 9, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

6 participants