Skip to content

Conversation

joshnuss
Copy link
Owner

@joshnuss joshnuss commented Dec 4, 2024

  • Convert state management to Runes
  • Remove svelte/legacy
  • Remove createEventDispatcher and replace on:event -> onevent
  • Convert code to TypeScript
  • Update docs
  • Ensure All wrapper <div>'s use CSS display: contents
  • Simplify Props types, use Stripe's option types directly when possible.
  • Use onMount for initializing components
  • Use $effect() to sync prop changes with Stripe via element.update()
  • Check each component to confirm is supports of all Stripe's attributes and events
  • Add <Elements.Deferred> component for creating payment intent later.
  • Lint and prettify
  • Manually test all components
  • Create changelog of breaking changes

Copy link

vercel bot commented Dec 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-stripe-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 6:04pm

@niemyjski
Copy link

I'd be willing to help test a pre-release of this.

@joshnuss
Copy link
Owner Author

Thanks @niemyjski!

@Aylay
Copy link

Aylay commented Apr 1, 2025

any news here ?

@buhodev
Copy link

buhodev commented Jul 9, 2025

Thanks for the awesome work! I would like to bring up that using the new async svelte branch (PR, discussion) produces this error:

Uncaught Svelte error: set_context_after_init
setContext must be called when a component first initializes, not in a subsequent effect or after an await expression.

in the Elements.svelte, because the context is being set in the onMount function.

@buhodev
Copy link

buhodev commented Aug 1, 2025

I was able to fix the set_context_after_init error locally with getters:

Elements.svelte before

onMount(() => {
	elements = stripe.elements({
		mode,
		currency,
		amount,
		appearance,
		clientSecret,
		fonts,
		loader,
		locale
	});

	register(stripe);
	setContext('stripe', { stripe, elements });
});

Elements.svelte after

onMount(() => {
	register(stripe);
});

$effect(() => {
	if (stripe) {
		elements = stripe?.elements({
			mode,
			currency,
			amount,
			appearance,
			clientSecret,
			fonts,
			loader,
			locale
		});
	}
});

setContext('stripe', {
	get stripe() {
		return stripe;
	},
	get elements() {
		return elements;
	}
});

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.

4 participants