-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix: move svelteHTML to load the correct svelte/element #9070
Conversation
so it can be extend with declare module converting to module so it can extend without needing another type alias
🦋 Changeset detectedLatest commit: 272909b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name sounds good to me! I'm not sure what you mean by the "declare module thing"? Do you mean that people are now able to extend svelte/elements
? Because yes, that's a great side effect of this.
Btw this needs a changeset.
Co-authored-by: Simon H <[email protected]>
Looks good! Let's try this out locally first by adjusting the language-tools and trying it on a local copy of Svelte. |
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint
For sveltejs/language-tools#2109. This file is currently in the language-tools repo and ships with svelte2tsx, but the problem is that TypeScript will load the
svelte/elements
version that comes with the svelte-language-server. Moving this to the Svelte core makes TypeScript always resolve it to the user-installed/workspace version of Svelte. Making it resolve to the user version also fixes the problem with the declaration merging ofdeclare module "svelte/elements"
. This allows the user/library to add custom types with it. For example:This file is meant to be loaded by ts or svelte-language-server. It's not meant to be user-facing. So this doesn't need to be in the package.json export and doesn't need documentation on its usage. @dummdidumm What do you think about the file naming and the declare module thing?