You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(pack): include library runtime config in entry content hashes - #3429
Changing a library name or export path changes its entry wrapper even when the module factories remain unchanged. Previously, these builds could share a content-hashed URL and serve a stale wrapper from cache.
Include the library runtime configuration in evaluate-chunk content hashes, including entries with no other chunks. Keep non-entry chunk hashing unchanged and avoid hashing the entry's own output path or generated content.
Add a production regression fixture that checks identical-build stability, filename and body changes for library name/export changes, and the actual browser-global exports.
Refresh the four affected library/server-entry snapshot fixtures. The snapshot changes are limited to entry filenames and their references; shared chunks and map/LICENSE contents are unchanged.
Test Plan
Verified on this branch, based on next at 0603a3f639e0cba5a76d87cffb6c8629e2a83d97:
Reproduced the original snapshot mismatch, then verified all four affected snapshot tests without UPDATE — passed.
Rebuilt pack-napi --features plugin from this branch and ran npm test --workspace @utoo/pack -- src/__test__/libraryContentHash.test.ts — passed.
The full Rust suite is delegated to CI: local loader tests cannot bind localhost sockets in the sandbox. The original CI failure started with the stale multi_server_entries snapshot; its panic poisoned the shared test lock, causing the subsequent PoisonError failures.
Shows when each build phase is active and how much CPU it consumes. Self-Time is the time spent exclusively in that phase (excluding children).
Phase
Spans
Inclusive (ms)
Self-Time (ms)
Wall Range (ms)
Resolve
51,214
7,138.7
1,975.1
3,471.1
Parse
8,203
1,432.0
1,080.8
6,243.5
Analyze
152,265
47,726.2
9,961.1
6,149.6
Chunk
5,455
5,991.0
795.9
2,445.6
Codegen
12,304
2,596.6
1,563.7
2,104.9
Emit
33
43.6
21.9
8.0
Other
3,304
7,349.8
4,252.8
6,952.3
Workload Distribution by Diagnostic Tier
Category
Spans
Inclusive (ms)
% Work
Self-Time (ms)
% Self
P0: Scheduling & Resolution
204,185
55,507.0
260.9%
12,213.7
57.4%
P1: I/O & Heavy Tasks
2,894
115.7
0.5%
94.0
0.4%
P2: Architecture (Locks/Memory)
0
0.0
0.0%
0.0
0.0%
P3: Asset Pipeline
24,551
10,036.7
47.2%
3,441.9
16.2%
P4: Bridge/Interop
0
0.0
0.0%
0.0
0.0%
Other
1,148
6,618.6
31.1%
3,901.8
18.3%
Top 20 Tasks by Self-Time
Self-time is the exclusive duration: time spent in the task itself, not in sub-tasks.
This is the most accurate indicator of where CPU cycles are actually spent.
Self (ms)
Inclusive (ms)
Count
Avg Self (us)
P95 Self (ms)
Max Self (ms)
% Work
Task Name
Top Caller
4,973.2
27,918.6
103,273
48.2
0.1
21.4
23.4%
module
module (63%)
2,722.2
2,844.2
19
143273.6
348.7
617.9
12.8%
save snapshot
persist (5%)
2,456.2
2,594.1
2,613
940.0
3.1
329.6
11.5%
analyze ecmascript module
module (67%)
1,659.3
16,118.4
36,413
45.6
0.1
9.3
7.8%
process module
process module (83%)
1,292.0
3,472.5
27,893
46.3
0.1
4.7
6.1%
internal resolving
internal resolving (77%)
1,020.5
1,371.7
6,028
169.3
0.6
52.3
4.8%
parse ecmascript
parse ecmascript (65%)
863.8
951.1
10,020
86.2
0.4
6.7
4.1%
precompute code generation
generate merged code (42%)
754.9
862.2
7,311
103.3
0.4
124.9
3.5%
compute async module info
compute async module info (57%)
671.3
3,654.4
22,635
29.7
0.0
4.6
3.2%
resolving
module (56%)
667.1
5,684.1
4,055
164.5
0.2
36.5
3.1%
chunking
chunking (52%)
652.2
2,144.4
878
742.9
1.8
237.2
3.1%
generate merged code
chunking (49%)
455.7
455.7
329
1385.1
1.1
283.7
2.1%
generate source map
code generation (83%)
378.4
806.2
129
2933.4
6.0
215.2
1.8%
emit code
generate merged code (41%)
319.8
586.1
1,718
186.2
0.1
163.0
1.5%
write all entrypoints to disk
write all entrypoints to disk (21%)
244.3
1,189.8
1,955
125.0
0.2
56.0
1.1%
code generation
code generation (83%)
125.0
125.0
8
15619.6
64.0
71.3
0.6%
blocking
save snapshot (50%)
124.9
302.6
1,340
93.2
0.2
11.6
0.6%
compute async chunks
compute async chunks (43%)
61.7
77.4
764
80.8
0.0
29.7
0.3%
compute binding usage info
compute binding usage info (51%)
60.3
60.3
2,173
27.7
0.0
1.8
0.3%
read file
parse ecmascript (91%)
41.9
75.1
1,870
22.4
0.0
14.5
0.2%
collect mergeable modules
collect mergeable modules (100%)
Critical Path Analysis
The longest sequential dependency chains that determine wall-clock time.
Focus on reducing the depth of these chains to improve parallelism.
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
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.
Summary
Changing a library name or export path changes its entry wrapper even when the module factories remain unchanged. Previously, these builds could share a content-hashed URL and serve a stale wrapper from cache.
Include the library runtime configuration in evaluate-chunk content hashes, including entries with no other chunks. Keep non-entry chunk hashing unchanged and avoid hashing the entry's own output path or generated content.
Add a production regression fixture that checks identical-build stability, filename and body changes for library name/export changes, and the actual browser-global exports.
Refresh the four affected library/server-entry snapshot fixtures. The snapshot changes are limited to entry filenames and their references; shared chunks and map/LICENSE contents are unchanged.
Test Plan
Verified on this branch, based on
nextat0603a3f639e0cba5a76d87cffb6c8629e2a83d97:cargo fmt --all— passed.cargo clippy --offline --locked --all-targets -- -D warnings --no-deps— passed.git diff --check— passed.UPDATE— passed.pack-napi --features pluginfrom this branch and rannpm test --workspace @utoo/pack -- src/__test__/libraryContentHash.test.ts— passed.The full Rust suite is delegated to CI: local loader tests cannot bind localhost sockets in the sandbox. The original CI failure started with the stale
multi_server_entriessnapshot; its panic poisoned the shared test lock, causing the subsequentPoisonErrorfailures.