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

More forgiving SvelteComponentDev typings #5937

Merged

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Jan 28, 2021

Add $$events_def and $$slot_def so that TS users can do

let el: SvelteComponent;
<SomeComponent bind:this={el} />

Without type errors.

Without this change, TS complains that $$events_def and $$slot_def is missing from SvelteComponentDev and therefore cannot be assigned to it.

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 npm test and lint the project with npm run lint

Simon Holthausen and others added 3 commits January 28, 2021 13:21
Add `$$events_def` and `$$slot_def` so that users can do
```
let el: SvelteComponent;
<SomeComponent bind:this={el} />
```
Without type errors.

Without this change, TS complains that `$$events_def` and `$$slot_def` is missing from `SvelteComponentDev` and therefore cannot be assigned to it.
@Conduitry Conduitry merged commit 0f3264e into sveltejs:master Jan 29, 2021
@dummdidumm dummdidumm deleted the more-forgiving-sveltecomponentdev-typings branch January 29, 2021 16:04
@Conduitry
Copy link
Member

Included in 3.32.1, thanks!

hontas added a commit to hontas/svelte that referenced this pull request Feb 11, 2021
* 'master' of https://github.com/sveltejs/svelte: (129 commits)
  -> v3.32.3
  fix remove of lone :host selectors (sveltejs#5984)
  -> v3.32.2
  update changelog
  fix extra invalidation with component prop binding to object property (sveltejs#5890)
  update css-tree@^1.1.2 (sveltejs#5958)
  fix :host and :global css scoping (sveltejs#5957)
  Tutorial : a better explanation of component events (sveltejs#4639)
  "What's new in Svelte" February newsletter (sveltejs#5925)
  Change color on 404 page (sveltejs#5932)
  -> v3.32.1
  warn module variables are nonreactive and make them truly nonreactive (sveltejs#5847)
  update changelog
  fix: "foreign" namespace elements should still allow binding 'this' (sveltejs#5942)
  inline `prop_values` in `init` helper (sveltejs#5909)
  update changelog
  don't create class update functions when dependencies aren't reactive (sveltejs#5926)
  fix extraneous store subscription in SSR (sveltejs#5929)
  make `SvelteComponentDev` typings more forgiving (sveltejs#5937)
  make animation/transition params optional (sveltejs#5936)
  ...
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