8000 remove `FromAction` interface by Rich-Harris · Pull Request #15958 · sveltejs/svelte · GitHub
[go: up one dir, main page]

Skip to content

remove FromAction interface #15958

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 3 commits into from
May 19, 2025
Merged

Conversation

Rich-Harris
Copy link
Member

See #15933. This makes some progress — a missing required argument now causes a squiggly, albeit in an odd place (it's essentially backwards, inferring the type of the action from the missing second argument, rather than inferring that the second argument is missing from the type of the action). This is the most important bit. But other stuff is still incorrect — it infers the type of the no_arg attachments from the second argument, instead of objecting to their presence, and () => undefined is considered a valid second argument in the optional_arg case which is probably fine but seems odd.

image

I think I've probably reached the limits of my TypeScript knowledge — if anyone else knows how to fix these remaining issues lmk.

Copy link
changeset-bot bot commented May 19, 2025

⚠️ No Changeset found

Latest commit: 7c2a49e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@paoloricciuti
Copy link
Member

I think this is more than enough in terms of typing...the errors might not be the most descriptive but the important bit imho is that it 890D errors out when it should...a function returning undefined is also probably fine, it just means that if you have a variable that might be undefined it's accepting it like it should.

@paoloricciuti paoloricciuti merged commit 1d4aa8a into from-action May 19, 2025
2 checks passed
@paoloricciuti paoloricciuti deleted the from-action-remove-interface branch May 19, 2025 21:12
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
0