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

Svelte 5: $host() rune for custom elements #11022

Closed
Rich-Harris opened this issue Apr 1, 2024 · 0 comments · Fixed by #11059
Closed

Svelte 5: $host() rune for custom elements #11022

Rich-Harris opened this issue Apr 1, 2024 · 0 comments · Fixed by #11059
Assignees
Milestone

Comments

@Rich-Harris
Copy link
Member

Describe the problem

Previously: #3091

The current workaround for getting hold of the host element, when compiling as a custom element, is convoluted and weird.

Describe the proposed solution

It would be useful to have a $host() rune, which would be a compile error without the relevant option.

With this, we could treat createEventDispatcher as deprecated — IIRC the only real reason it isn't already is that we need it to dispatch events from custom elements.

Importance

nice to have

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

Successfully merging a pull request may close this issue.

2 participants