-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(browser): optimize build output and always prebundle vitest #8102
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
base: main
Are you sure you want to change the base?
fix(browser): optimize build output and always prebundle vitest #8102
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@vitest/browser
@vitest/coverage-istanbul
@vitest/coverage-v8
@vitest/expect
@vitest/mocker
@vitest/pretty-format
@vitest/runner
@vitest/snapshot
@vitest/spy
@vitest/ui
@vitest/utils
vite-node
vitest
@vitest/web-worker
@vitest/ws-client
commit: |
This seems to work.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR optimizes the browser build output and adjusts prebundling for Vitest. Key changes include updating export snapshots, refining module paths and dependencies for browser and node modules, and modifying timing calculations in the browser client tester.
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/core/test/exports.test.ts | Added exports for additional functions and objects |
packages/vitest/src/public/browser.ts | Updated public exports to include new modules |
packages/vitest/src/node/project.ts | Modified prebundle imports to include additional modules |
packages/vitest/rollup.config.js | Added '@vitest/mocker/browser' as external dependency |
packages/utils/package.json | Removed "./ast" export block |
packages/mocker/* | Adjusted exports and dependencies for module mocker |
packages/browser/* | Updated module imports, exclusion/inclusion lists, and timing logic |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
packages/browser/src/client/tester/mocker.ts:1
- [nitpick] The import for ModuleMocker has been changed from '@vitest/mocker/browser' to 'vitest/internal/browser'. Verify that this change is intentional and that it aligns with the intended public API exposure.
import { ModuleMocker } from 'vitest/internal/browser'
packages/browser/src/client/client.ts:3
- [nitpick] Ensure that using 'vitest/internal/browser' for ModuleMocker is consistent with the rest of the codebase and does not inadvertently expose internal APIs.
import type { ModuleMocker } from 'vitest/internal/browser'
@@ -142,7 +144,7 @@ async function prepareTestEnvironment(options: PrepareOptions) { | |||
}) | |||
} | |||
|
|||
state.durations.prepare = performance.now() - options.startTime | |||
state.durations.prepare = options.startTime - now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duration calculation subtracts now() from options.startTime, which is likely reversed. Consider calculating elapsed time as now() - options.startTime.
state.durations.prepare = options.startTime - now() | |
state.durations.prepare = now() - options.startTime |
Copilot uses AI. Check for mistakes.
Description
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.