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

chore: switch to oxc for dts & typescript transform #7472

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sxzz
Copy link
Contributor

@sxzz sxzz commented Feb 12, 2025

Description

Requires #7473 first.

WIP: Migrated @vitest/browser only.

  • Replaced rollup-plugin-esbuild and @rollup/plugin-node-resolve with unplugin-oxc. There are some issues with resolving, so still using @rollup/plugin-node-resolve.
  • Enabled isolatedDeclarations, generated dts with unplugin-isolated-decl, and bundled dts using the original rollup-plugin-dts

Result

Running on my machine: pnpm run build:node in @vitest/browser is now 7.1x faster

Before: 7.28 secs
After: 1.02 secs

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Feb 12, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 263241e
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/67b62eb1a2bdd40008f59405
😎 Deploy Preview https://deploy-preview-7472--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Boshen
Copy link

Boshen commented Feb 12, 2025

It seems like we can get "isolatedDeclarations": true merged first, to ease the transition to oxc.

@sheremet-va
Copy link
Member

just a note, but most packages in the monorepo already have isolatedDeclarations enabled and can just switch to the oxc plugin

@TonyPythoneer
Copy link

Just putting my two cents in.

I found that some changes involve adding type annotations.
It may be better to extract from these changes and merge them into the main branch if it doesn't affect the logic.
It'd be easy to see the integration with oxc.

@sxzz
Copy link
Contributor Author

sxzz commented Feb 13, 2025

Yes, as mentioned, the required PR is #7473.

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.

4 participants