Skip to content

Comments

simplify types#4010

Merged
Rich-Harris merged 1 commit intomasterfrom
simplify-types
Feb 19, 2022
Merged

simplify types#4010
Rich-Harris merged 1 commit intomasterfrom
simplify-types

Conversation

@Rich-Harris
Copy link
Member

The motivation behind this is an idea I had about documenting types (#4002), but I think it's valuable in its own right so I'm opening this separately from any docs changes.

Right now we have types scattered amongst a bunch of nebulously-scoped .d.ts files. It would be much simpler all round if we just split the types into public (index.d.ts), private (internal.d.ts) and ambient (ambient.d.ts). I don't think the current setup serves any real purpose.

I haven't made any changes to the types themselves — just where they live — but I do think there's a worthwhile conversation to be had about where we draw the line between public and private. There's definitely some things in internal.d.ts that wouldn't be terribly out of place in index.d.ts. I don't think we need to solve that in this PR though.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpx changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2022

⚠️ No Changeset found

Latest commit: 6a2dc68

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@Rich-Harris Rich-Harris mentioned this pull request Feb 19, 2022
7 tasks
Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Agree with this change. The files are not that huge that it gets out of hand and I also often wasn't sure what goes where

@Rich-Harris Rich-Harris merged commit 4476ccb into master Feb 19, 2022
@Rich-Harris Rich-Harris deleted the simplify-types branch February 19, 2022 22:10
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.

2 participants