Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StoresValues no longer exported from svelte/store #15594

Closed
hmnd opened this issue Mar 22, 2025 · 3 comments
Closed

StoresValues no longer exported from svelte/store #15594

hmnd opened this issue Mar 22, 2025 · 3 comments

Comments

@hmnd
Copy link

hmnd commented Mar 22, 2025

Describe the bug

When migrating a project to Svelte 5, I discovered that StoresValues is no longer exported from svelte/store. I know that stores are technically deprecated, but I don't see the need to make that type private. Instead, I would just remove it entirely in Svelte 6/7 when stores are eliminated as a feature and keep it public for now.

Reproduction

import type { StoresValues } from 'svelte/store';

Logs

System Info

Irrelevant

Severity

annoyance

@Ocean-OS
Copy link
Contributor

Ocean-OS commented Mar 23, 2025

It's currently private, so you could either:

  1. Import it from the file
  2. Copy-paste it from here:
import type { Readable } from 'svelte/store'; // if you haven't already
type StoresValues<T> =
	T extends Readable<infer U> ? U : { [K in keyof T]: T[K] extends Readable<infer U> ? U : never };

I should have the pull request made in a few minutes.

@hmnd
Copy link
Author

hmnd commented Mar 23, 2025

Yes. I've already copied it over. I just thought this change might be unnecessarily confusing for others migrating to Svelte 5.

@dummdidumm
Copy link
Member

This type was never meant to be public - it only was by accident because we didn't know that not having export {} within a module declaration would make all the types public.

Given that this is a type that is easily copied over I'd rather like to keep it that way. Therefore closing - thank you.

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2025
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 a pull request may close this issue.

3 participants