Skip to content

fix: relax form typings for union types#15687

Merged
Rich-Harris merged 1 commit into
mainfrom
union-types-remote-functions
Apr 9, 2026
Merged

fix: relax form typings for union types#15687
Rich-Harris merged 1 commit into
mainfrom
union-types-remote-functions

Conversation

@dummdidumm

Copy link
Copy Markdown
Member

someField.set(...) now works on union types; it no longer only accepts the intersection of all unions.

Similarly, someField.someSubProperty now works on unions, though at the slight cost of potentially accessing a combination of things you shouldn't be able to. But I think that's better than the other workarounds you have to do, and you can always narrow it if you want to (in a much easier way than the other way around).

Fixes #14667

`someField.set(...)` now works on union types; it no longer only accepts the intersection of all unions.

Similarly, `someField.someSubProperty` now works on unions, though at the slight cost of potentially accessing a combination of things you shouldn't be able to. But I think that's better than the other workarounds you have to do, and you can always narrow it if you want to (in a much easier way than the other way around).

Fixes #14667
@changeset-bot

changeset-bot Bot commented Apr 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7b06f8d

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit 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

@svelte-docs-bot

Copy link
Copy Markdown

@Rich-Harris Rich-Harris merged commit 6a9cdaa into main Apr 9, 2026
29 checks passed
@Rich-Harris Rich-Harris deleted the union-types-remote-functions branch April 9, 2026 17:23
@github-actions github-actions Bot mentioned this pull request Apr 9, 2026
elliott-with-the-longest-name-on-github pushed a commit that referenced this pull request Apr 9, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @sveltejs/kit@2.57.1

### Patch Changes

- fix: better validation for `redirect` inputs
([`10d7b44`](10d7b44))


- fix: enforce `BODY_SIZE_LIMIT` on chunked requests
([`3202ed6`](3202ed6))


- fix: use default values as fallbacks
([#15680](#15680))


- fix: relax form typings for union types
([#15687](#15687))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Remote Function Form typechecking does not work with variant / discriminatedUnion

2 participants