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

fix: make static element property available #11079

Merged
merged 3 commits into from
Apr 8, 2024
Merged

fix: make static element property available #11079

merged 3 commits into from
Apr 8, 2024

Conversation

dummdidumm
Copy link
Member

for the SvelteComponent type
closes #8936

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
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

Copy link

changeset-bot bot commented Apr 6, 2024

🦋 Changeset detected

Latest commit: d0bf47b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

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

@@ -2215,7 +2218,7 @@ declare module 'svelte/transition' {
* https://svelte.dev/docs/svelte-transition#crossfade
* */
export function crossfade({ fallback, ...defaults }: CrossfadeParams & {
fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig;
fallback?: ((node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig) | undefined;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't update dts-buddy, @Rich-Harris why did this change? isn't the previous version more correct if you're using the "strict property types" option? are we just not using that in the compiler options and it's not available in strict mode by default? need to check

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errr I have no idea. Seems like a TypeScript thing (nothing changed in dts-buddy that would cause that). Seems this is just undoing this recent change: 8cbe8c1#diff-b1326f5f98417cd282e68bc1e4e6b869e69156c42a36afd2fd0721927000bd36R2218

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigated a bit, if exactOptionalPropertyTypes is true the | undefined should show up, else not - so it's correct that the recent change removed it. We could turn this flag (which is not part of strict mode) on later if needed (some people may rely on it and get errors when using our types) but that's a different story (and something that hasn't come up so far with the existing types).

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.

Typescript Error when defining custom elements as a consumer in Svelte v4
2 participants