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

feat(create-vite): use typescript 5.0 in templates #12481

Merged
merged 11 commits into from Mar 30, 2023

Conversation

nickmccurdy
Copy link
Contributor

@nickmccurdy nickmccurdy commented Mar 19, 2023

Description

TypeScript 5.0 has been released with standard decorator support and various config improvements, notably including --moduleResolution bundler which is recommended by Evan You and Daniel Rosenwasser for Vite users.

Additional context

Note that due to TypeScript not following semver, 4.9 and 5.0 are both releases with breaking changes, so this upgrade should be roughly as compatible as previous major and minor upgrades.


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 PR Title 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.

@stackblitz
Copy link

stackblitz bot commented Mar 19, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@nickmccurdy nickmccurdy marked this pull request as ready for review March 19, 2023 11:37
@nickmccurdy

This comment was marked as resolved.

Copy link
Member

@fi3ework fi3ework left a comment

Choose a reason for hiding this comment

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

AFAIK, the tsconfig in vite package could not use moduleResolution: "bundler" for these reasons:

  1. ufo does not ship a types field in exports, they had added it https://github.com/unjs/ufo/blob/main/package.json#L10 and I believe it gonna be published in days.
  2. @ampproject/remapping relies on an old version of @jridgewell/gen-mapping which does not provide correct exports.types. The source code has been updated but not published. I filed an issue to track this Considering publish a new version to NPM? ampproject/remapping#184
  3. api-extractor somehow seems like do not recognize bundler for now and will throw an error.

ArnaudBarre
ArnaudBarre previously approved these changes Mar 26, 2023
patak-dev
patak-dev previously approved these changes Mar 26, 2023
@patak-dev patak-dev dismissed stale reviews from ArnaudBarre and themself via 35d1389 March 26, 2023 20:25
@patak-dev patak-dev changed the title fix(types): use typescript 5.0 fix(create-vite): use typescript 5.0 in templates Mar 26, 2023
@patak-dev patak-dev changed the title fix(create-vite): use typescript 5.0 in templates feat(create-vite): use typescript 5.0 in templates Mar 26, 2023
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.

I think we can merge this, then merge #12604

@patak-dev patak-dev merged commit 8582e2d into vitejs:main Mar 30, 2023
14 checks passed
@nickmccurdy nickmccurdy deleted the use-typescript-5.0 branch April 20, 2023 01:47
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.

None yet

6 participants