8000 fix: allow using typescript in `customElement.extend` option by paoloricciuti · Pull Request #16001 · sveltejs/svelte · GitHub
[go: up one dir, main page]

Skip to content

fix: allow using typescript in customElement.extend option #16001

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

Merged
merged 4 commits into from
May 26, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: add note to custom element docs
  • Loading branch information
paoloricciuti committed May 26, 2025
commit 603d6ba9150b85fe8813e82f3ad219faf5b5009b
2 changes: 2 additions & 0 deletions documentation/docs/07-misc/04-custom-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ When constructing a custom element, you can tailor several aspects by defining `
...
```

> [!NOTE] While Typescript is supported in the `extend` function is subject to the same limitations of the script tags: you need to set `lang="ts"` on one of the scripts AND you can only use [erasable syntax](https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly) in it.

## Caveats and limitations

Custom elements can be a useful way to package components for consumption in a non-Svelte app, as they will work with vanilla HTML and JavaScript as well as [most frameworks](https://custom-elements-everywhere.com/). There are, however, some important differences to be aware of:
Expand Down
0