fix: move svelteHTML to load the correct svelte/element #9070
+276
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?