Repository navigation
perf: bundle vitest's own dependencies - #10685
Merged
Merged
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
sheremet-va
force-pushed
the
perf/improve-loading-perf
branch
from
July 3, 2026 14:07
ba33fed to
2ca824b
Compare
sheremet-va
marked this pull request as ready for review
July 3, 2026 16:32
sheremet-va
marked this pull request as draft
July 3, 2026 16:32
sheremet-va
marked this pull request as ready for review
July 4, 2026 14:06
sheremet-va
force-pushed
the
perf/improve-loading-perf
branch
from
July 4, 2026 14:23
e2513ed to
053dce5
Compare
AriPerkkio
reviewed
Jul 5, 2026
Reduces worker boot time by cutting the external module resolutions Node performs when loading the worker bundle. tinyrainbow is pinned to a single shared chunk (its default export is a mutable color object toggled at runtime) and re-exported as disableDefaultColors from vitest/node so programmatic consumers can disable colors on the instance Vitest renders with. NativeModuleRunner is imported lazily to keep local-pkg out of the default worker startup graph.
sheremet-va
force-pushed
the
perf/improve-loading-perf
branch
from
July 7, 2026 10:23
c5f2e54 to
2396184
Compare
This was referenced Jul 7, 2026
sheremet-va
commented
Jul 23, 2026
AriPerkkio
previously approved these changes
Jul 23, 2026
sheremet-va
force-pushed
the
perf/improve-loading-perf
branch
from
July 23, 2026 11:52
ad4b124 to
2545356
Compare
sheremet-va
commented
Jul 23, 2026
| @@ -0,0 +1 @@ | |||
| export * from './dist/display.js' | |||
Member
Author
There was a problem hiding this comment.
These are required for the dts-bundle plugin, it doesn't seem to support export conditions 👀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bundles vitest's own dependencies into its dist to reduce the boot time by cutting the external module resolutions Node performs when loading the worker bundle:
Details:
tinyrainbowis pinned to a single shared chunk: its default export is a mutable color object whose formatters are toggled at runtime, so inlining it into several chunks would give each chunk its own copy and break runtime color toggling. It is re-exported asdisableDefaultColorsfromvitest/nodeso programmatic consumers (e.g. our test suite) can disable colors on the instance Vitest actually renders with.NativeModuleRunneris imported lazily solocal-pkgstays out of the default worker startup graph; only theviteModuleRunner: falsepath needs it.Note
This PR was previously stacked and also carried an isolate-hint diagnostic and the browser optimizeDeps pre-bundling. The stack was split into independent feature PRs: the isolate hint now ships as part of
experimental.diagnosticsin #10710, and the browser pre-bundling moved to #10713.TODO