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

chore: don't distribute unused types definitions #15473

Merged
merged 2 commits into from
Mar 14, 2025
Merged

chore: don't distribute unused types definitions #15473

merged 2 commits into from
Mar 14, 2025

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Mar 8, 2025

results in a smaller package. don't need to distribute unused files

this may close (or not, we'll see) #15182

Copy link

changeset-bot bot commented Mar 8, 2025

🦋 Changeset detected

Latest commit: 9ab2793

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

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

types/index.d.ts.map is included for a reason. I'm pretty sure interfaces.d.ts and preprocess.d.ts are needed for backwards compatibility

@dummdidumm
Copy link
Member

dummdidumm commented Mar 14, 2025

This is also missing all the other legacy top level d.ts files. We can only remove those inside src

Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@15473

@dummdidumm dummdidumm merged commit e74fbcb into main Mar 14, 2025
13 checks passed
@dummdidumm dummdidumm deleted the types-files branch March 14, 2025 20:19
@github-actions github-actions bot mentioned this pull request Mar 14, 2025
@benmccann
Copy link
Member Author

There are some I don't see used still, but I might not be familiar with how TypeScript load these. E.g. I don't see any reference to motion.d.ts and ./motion loads ./types/index.d.ts in the package.json. But will motion.d.ts still be loaded instead of ./types/index.d.ts for older versions of TypeScript or something?

@dummdidumm
Copy link
Member

These files are crucial for when you have a tsconfig that have a setting that makes typescript ignore the export map. Then it just looks as the file system, so when you do import {...} from "svelte/motion" then motion.d.ts will be loaded.
They all just defer to the types file so that this one is loaded to then provide the types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants