[browser][coreCLR] throttling + WBT#124969
Conversation
|
Tagging subscribers to this area: @agocke, @jeffschwMSFT, @elinor-fung |
There was a problem hiding this comment.
Pull request overview
This pull request refactors the download throttling mechanism in the browser WASM loader. The main changes include renaming the "webcil10" asset behavior to "webcil", splitting the old noThrottleNoRetry map into separate noRetry and noBuffer maps, and restructuring throttling logic to better handle assets that don't buffer immediately (such as dotnetwasm, webcil, and symbols).
Changes:
- Renamed "webcil10" to "webcil" (breaking API change) in public-api.ts and dotnet.d.ts
- Added
priorityfield to AssetEntryInternal for potential future priority-based download handling - Refactored
fetchWasmtofetchMainWasmand restructured throttling logic with newenterThrottling()andleaveThrottling()helper functions - Split old
noThrottleNoRetrymap intonoRetry(for disabling retries) andnoBuffer(for skipping immediate buffering) - Added try-finally blocks to fetch functions for better error handling and resource cleanup
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/libs/Common/JavaScript/types/public-api.ts | Renamed "webcil10" to "webcil" in AssetBehaviors type (breaking change) |
| src/native/libs/Common/JavaScript/types/internal.ts | Added optional priority field to AssetEntryInternal for throttling bypass |
| src/native/libs/Common/JavaScript/loader/run.ts | Updated import and call from fetchWasm to fetchMainWasm |
| src/native/libs/Common/JavaScript/loader/dotnet.d.ts | Renamed "webcil10" to "webcil" in type definitions (breaking change) |
| src/native/libs/Common/JavaScript/loader/assets.ts | Major refactoring: renamed fetchWasm to fetchMainWasm, extracted enterThrottling/leaveThrottling helpers, split noThrottleNoRetry into noRetry and noBuffer maps, added try-finally blocks for error handling, and updated webcil10 references to webcil |
2ab8d4a to
438a60a
Compare
8fc616e to
26e56c7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (2)
src/native/libs/Common/JavaScript/loader/assets.ts:504
onDownloadedAssetassignsasset.buffer = null!, which sidesteps the declared type (ArrayBuffer | Promise<ArrayBuffer> | undefined) and forces a non-null assertion. Consider setting it toundefinedinstead so the runtime value matches the type and you can drop thenull!cast while still releasing memory.
// release memory
asset.buffer = null!;
asset.pendingDownload = undefined;
src/native/libs/Common/JavaScript/types/internal.ts:65
- The newly introduced
inprogressfield is inconsistent with the existing camelCase naming (e.g.,useCredentials,pendingDownload). Consider renaming it toinProgress(and updating its uses) to keep naming consistent and reduce confusion.
priority?: boolean
shortName?: string
inprogress?: boolean
}
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Passing test Log |
|
+1 on Ilona's comments |
|
/ba-g bad exit infra failures |
leaveThrottling();after instantiation for some of themasset.priorityfor later useonDownloadedAsset();is counted even when it failsFixes #124900