Skip to content

fix(stripe): allow selecting Stripe.js SDK version#799

Merged
harlan-zw merged 2 commits into
mainfrom
feat/stripe-version
May 27, 2026
Merged

fix(stripe): allow selecting Stripe.js SDK version#799
harlan-zw merged 2 commits into
mainfrom
feat/stripe-version

Conversation

@harlan-zw
Copy link
Copy Markdown
Collaborator

@harlan-zw harlan-zw commented May 27, 2026

🔗 Linked issue

Resolves #796

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

useScriptStripe() previously pinned to the basil release of Stripe.js. This adds an optional version option (union of named releases plus string fallback) that gets interpolated into the loader URL, mirroring the v option pattern used by Google Maps. Default stays basil.

Adds a `version` option to `useScriptStripe()` and the registry config
to pin the Stripe.js SDK release (e.g. `acacia`, `basil`, `clover`,
`dahlia`), mirroring the Google Maps `v` option. Defaults to `basil`
for backward compatibility.

Closes #796
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scripts-playground Ready Ready Preview, Comment May 27, 2026 6:44am

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@799

commit: f4fa04c

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b91c57f-026e-45a8-891b-50d142cc4655

📥 Commits

Reviewing files that changed from the base of the PR and between 82ff525 and f4fa04c.

📒 Files selected for processing (2)
  • packages/script/src/registry-types.json
  • packages/script/src/runtime/registry/schemas.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/script/src/runtime/registry/schemas.ts
  • packages/script/src/registry-types.json

📝 Walkthrough

Walkthrough

This PR adds an optional version field to StripeOptions, allowing users to select which Stripe.js SDK version (v3, acacia, basil, clover, dahlia, or any future release) the useScriptStripe() composable loads. The version is injected into the Stripe script URL, defaulting to basil. The change updates the runtime schema, type metadata, URL generation logic, and documentation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a feature to allow selecting the Stripe.js SDK version instead of it being hardcoded.
Description check ✅ Passed The description is related to the changeset, explaining what was changed and why, referencing the linked issue and describing the new version option feature.
Linked Issues check ✅ Passed The PR implements all requirements from issue #796: adds optional version field to StripeOptions, supports named releases with string fallback, uses version in loader URL construction, maintains backward compatibility with basil default, and integrates with registry config.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the version selection feature for Stripe.js SDK: documentation updates, schema definition, TypeScript schema implementation, and composable URL construction.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/stripe-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@harlan-zw harlan-zw changed the title feat(stripe): allow selecting Stripe.js SDK version fix(stripe): allow selecting Stripe.js SDK version May 27, 2026
@harlan-zw harlan-zw merged commit ae8d2c2 into main May 27, 2026
19 checks passed
@harlan-zw harlan-zw deleted the feat/stripe-version branch May 27, 2026 07:18
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.

Stripe: allow selecting the Stripe.js SDK version (acacia / basil / clover / dahlia / …)

1 participant