Skip to content

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

Merged
patak-cat merged 11 commits intovitejs:mainfrom
nickserv:use-typescript-5.0
Mar 30, 2023
Merged

feat(create-vite): use typescript 5.0 in templates#12481
patak-cat merged 11 commits intovitejs:mainfrom
nickserv:use-typescript-5.0

Conversation

@nickserv
Copy link
Copy Markdown
Contributor

@nickserv nickserv 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.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

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

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

This comment was marked as resolved.

Copy link
Copy Markdown
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 ampproject/remapping#184
  3. api-extractor somehow seems like do not recognize bundler for now and will throw an error.

@nickserv nickserv requested a review from fi3ework March 20, 2023 10:10
Comment thread packages/vite/src/node/server/pluginContainer.ts
ArnaudBarre
ArnaudBarre previously approved these changes Mar 26, 2023
patak-cat
patak-cat previously approved these changes Mar 26, 2023
@patak-cat patak-cat dismissed stale reviews from ArnaudBarre and themself via 35d1389 March 26, 2023 20:25
@patak-cat patak-cat changed the title fix(types): use typescript 5.0 fix(create-vite): use typescript 5.0 in templates Mar 26, 2023
@patak-cat patak-cat 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
Copy Markdown
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-cat patak-cat merged commit 8582e2d into vitejs:main Mar 30, 2023
@nickserv nickserv 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.

6 participants