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: vite client types #7877

Merged
merged 3 commits into from May 5, 2022
Merged

fix: vite client types #7877

merged 3 commits into from May 5, 2022

Conversation

poyoho
Copy link
Member

@poyoho poyoho commented Apr 23, 2022

Description

fix: #3905

Additional context

I remove the /// <reference lib="dom" />, it can run. I think we can remove it. Let users add dom / webworker in tsconfig.json to determine env. And the create-vite is also define {"lib": ["dom"]}


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

sapphi-red
sapphi-red previously approved these changes Apr 27, 2022
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

I checked WebAssembly, Worker, SharedWorker type exists in dom and webworker.
https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts
https://github.com/microsoft/TypeScript/blob/main/lib/lib.webworker.d.ts

Also I think this approach makes sense.

bluwy
bluwy previously approved these changes Apr 27, 2022
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

This looks like a good solution to me too. I think we could merge in Vite 3 to not accidentally break existing project typechecking.

@bluwy bluwy added the p2-nice-to-have Not breaking anything but nice to have (priority) label Apr 27, 2022
@bluwy bluwy added this to the 3.0 milestone Apr 27, 2022
@patak-dev
Copy link
Member

Should we add a note in the docs about how to let users add dom / webworker in tsconfig.json to determine env?

@poyoho poyoho dismissed stale reviews from bluwy and sapphi-red via 22896e4 May 5, 2022 14:52
@patak-dev patak-dev requested a review from bluwy May 5, 2022 14:53
docs/guide/env-and-mode.md Outdated Show resolved Hide resolved
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
@patak-dev patak-dev merged commit 0e67fe8 into vitejs:main May 5, 2022
@poyoho poyoho deleted the fix/vite-client-types branch May 6, 2022 01:07
@poyoho poyoho mentioned this pull request May 21, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

client types are incompatible with 'webworker' lib
4 participants