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

Move URL out of RequestInfo to match DOM types #3121

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

penalosa
Copy link
Collaborator

Fixes #3090

To improve the typing situation when loading dom types in the same environment as workers-types, this PR moves the URL type out of RequestInfo, in favour of e.g. fetch() referencing fetch(req: RequestInfo | URL) directly. This matches how dom types are defined.

There should be no user-observable behaviour change for users using just workers-types, but this should improve the situation if e.g. the fetch definition comes from workers-types but the RequestInfo definition comes from dom types.

@petebacondarwin
Copy link
Contributor

I manually applied this fix (or approximately this fix 😄) to the reproduction in the issue and it appears to resolve the typings problem.

Copy link
Contributor

@andyjessop andyjessop left a comment

Choose a reason for hiding this comment

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

Nice work 👍

@penalosa penalosa merged commit f374a34 into main Nov 15, 2024
14 checks passed
@penalosa penalosa deleted the penalosa/move-url-out branch November 15, 2024 23:00
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.

Cannot use browser rendering with svelte kit
4 participants