[WIP]feat(pack): surface initial dev compile issues#3155
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an onCompileDone callback option to the dev server and hot reloader, allowing consumers to receive structured compilation errors and warnings after the initial build and subsequent rebuilds. It also updates the HMR sync mechanism to propagate warnings alongside errors, and adds comprehensive tests for these changes. A critical issue was identified in disposeBackgroundWatchSubscriptions where clearing currentEntryIssues entirely would wipe out initial output issues; it is recommended to only clear watcher-related issues to preserve compiled output issues.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if (clearIssues) { | ||
| currentEntryIssues.clear(); | ||
| } |
There was a problem hiding this comment.
Clearing currentEntryIssues entirely in disposeBackgroundWatchSubscriptions when clearIssues is true will wipe out the initial output issues (keys ending with :output) that were just populated during the entrypoint write phase. This happens because refreshBackgroundWatchers is called after the entrypoints are written to disk, and since backgroundWatchersInitialized is true for subsequent changes, it will clear all issues, causing compile errors/warnings from subsequent entrypoint changes to be lost.
Instead, we should only clear the watcher-related issues (e.g., keys that do not end with :output) to preserve the compiled output issues.
if (clearIssues) {
for (const key of currentEntryIssues.keys()) {
if (!key.endsWith(":output")) {
currentEntryIssues.delete(key);
}
}
}There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e427078a41
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,152 @@ | |||
| import type { Issue } from "@utoo/pack-shared"; | |||
| import { beforeEach, describe, expect, it, vi } from "vitest"; | |||
There was a problem hiding this comment.
Keep tests out of the package build
Because packages/pack/tsconfig.json includes all of src and only excludes src/__test__, this new src/core/hmr.test.ts file is compiled by npm -w @utoo/pack run build:js into both cjs/ and esm/. The published package also exports ./cjs/* and ./esm/*, so this ships a test module that imports vitest even though @utoo/pack does not declare it; moving the test under the existing excluded src/__test__ tree or excluding *.test.ts avoids leaking test-only code into the distributable.
Useful? React with 👍 / 👎.
📊 Performance Benchmark Report (with-antd)Utoopack Performance ReportReport ID: Executive Summary
Build Phase TimelineShows when each build phase is active and how much CPU it consumes.
Workload Distribution by Diagnostic Tier
Top 20 Tasks by Self-TimeSelf-time is the exclusive duration: time spent in the task itself, not in sub-tasks.
Critical Path AnalysisThe longest sequential dependency chains that determine wall-clock time.
Batching CandidatesHigh-volume tasks dominated by a single parent. If the parent can batch them,
Duration Distribution
Action Items
Report generated by Utoopack Performance Analysis Agent |
Summary
Tests