Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
🦋 Changeset detectedLatest commit: 855e6d8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 48 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
marksnode
force-pushed
the
feat/load-entry-timeout
branch
from
September 6, 2026 21:02
dc84253 to
855e6d8
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
createScriptin@module-federation/sdkhard-codes the remote entry load timeout to 20 s, and the only way to change it is acreateScriptruntime hook that returns{ script, timeout }. Remotes behind a slow proxy or a congested staging cluster regularly need more than that and fail withRUNTIME-008 ... timed outeven though the download finishes a few seconds later.This adds a first-class
loadEntryTimeoutruntime option (ms) that flows into the script timer, keeping thecreateScripthook as the per-URL override.@module-federation/sdk(dom.ts):createScriptandloadScriptaccepttimeout; a positive number replaces the 20 s default (DEFAULT_SCRIPT_TIMEOUT), acreateScripthook return value still wins, and a non-finite value (Infinity) skips the timer.@module-federation/runtime-core:Options.loadEntryTimeout?: number(so it is also part ofUserOptionsforinit/createInstance).getRemoteEntry→loadEntryDom→loadEntryScriptpassorigin.options.loadEntryTimeouttoloadScript.preload.tswaitForScriptPreloadpasseshost.options.loadEntryTimeouttocreateScript, so preloaded entries use the same budget.SnapshotHandler.getManifestJsonbounds the manifest fetch (mf-manifest.json) with the same option: whenloadEntryTimeoutis set, thefetchcall (and thefetchloader hook) receive anAbortSignalthat fires after the timeout. Today that request isfetch(url, {})with no timeout at all, so a stalled manifest response holdsloadRemoteopen indefinitely — the entry script has a 20 s budget, the manifest that names it has none. Left unbounded when the option is not set, so default behaviour does not change.SnapshotHandler.getManifestJsonbounds the manifest fetch (mf-manifest.json) with the same option: whenloadEntryTimeoutis set, thefetchcall (and thefetchloader hook) receive anAbortSignalthat fires after the timeout. Today that request isfetch(url, {})with no timeout at all, so a stalled manifest response holdsloadRemoteopen indefinitely — the entry script has a 20 s budget, the manifest that names it has none. Left unbounded when the option is not set, so default behaviour does not change.sdk/__tests__/dom.spec.ts(passed timeout, hook precedence,Infinitydisables the timer);runtime-core/__tests__/load.spec.ts(loadEntryTimeoutreaches the script timer;Infinityarms no timer).runtime-core/__tests__/snapshot.spec.ts(the manifest fetch carries anAbortSignaland arms the timer only when the option is set).runtime-core/__tests__/snapshot.spec.ts(the manifest fetch carries anAbortSignaland arms the timer only when the option is set).runtime-api.mdx(en/zh) — option described undercreateInstance.@module-federation/sdkand@module-federation/runtime-core.Related Issue
Closes #5034.
Types of changes
Checklist