Skip to content
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

Propagate the fetch settings object when loading module graphs #9520

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 30 additions & 19 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -103101,8 +103101,8 @@ document.querySelector("button").addEventListener("click", bound);
steps.</p></li>

<li><p><span data-x="fetch the descendants of and link a module script">Fetch the descendants of
and link</span> <var>result</var> given "<code data-x="">script</code>" and
<var>onComplete</var>.</p></li>
and link</span> <var>result</var> given <var>settings object</var>, "<code
data-x="">script</code>", and <var>onComplete</var>.</p></li>
</ol>
</li>
</ol>
Expand All @@ -103127,7 +103127,7 @@ document.querySelector("button").addEventListener("click", bound);
<li>
<p>If <var>result</var> is not null, optionally <span data-x="fetch the descendants of and
link a module script">fetch the descendants of and link</span> <var>result</var> given
<var>destination</var> and an empty algorithm.</p>
<var>settings object</var>, <var>destination</var>, and an empty algorithm.</p>

<p class="note">Generally, performing this step will be beneficial for performance, as it
allows pre-loading the modules that will invariably be requested later, via algorithms such as
Expand All @@ -103154,8 +103154,8 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>If <var>script</var> is null, run <var>onComplete</var> given null, and return.</p></li>

<li><p><span data-x="fetch the descendants of and link a module script">Fetch the descendants of
and link</span> <var>script</var>, given "<code data-x="">script</code>" and
<var>onComplete</var>.</p></li>
and link</span> <var>script</var>, given <var>settings object</var>, "<code
data-x="">script</code>", and <var>onComplete</var>.</p></li>
</ol>

<p>To <dfn export id="fetch-a-module-worker-script-tree">fetch a module worker script graph</dfn>
Expand Down Expand Up @@ -103320,17 +103320,19 @@ document.querySelector("button").addEventListener("click", bound);
steps.</p></li>

<li><p><span data-x="fetch the descendants of and link a module script">Fetch the descendants
of and link</span> <var>result</var> given <var>destination</var> and <var>onComplete</var>. If
<var>performFetch</var> was given, pass it along as well.</p></li>
of and link</span> <var>result</var> given <var>fetch client settings object</var>,
<var>destination</var>, and <var>onComplete</var>. If <var>performFetch</var> was given, pass
it along as well.</p></li>
</ol>
</li>
</ol>

<p>To <dfn>fetch the descendants of and link a module script</dfn> <var>module
script</var>, given a <var>destination</var>, an <var>onComplete</var> algorithm, and an optional
<span data-x="fetching-scripts-perform-fetch">perform the fetch hook</span>
<var>performFetch</var>, run these steps. <var>onComplete</var> must be an algorithm accepting
null (on failure) or a <span>module script</span> (on success).</p>
script</var>, given a <var>fetch client settings object</var>, a <var>destination</var>, an
<var>onComplete</var> algorithm, and an optional <span
data-x="fetching-scripts-perform-fetch">perform the fetch hook</span> <var>performFetch</var>, run
these steps. <var>onComplete</var> must be an algorithm accepting null (on failure) or a
<span>module script</span> (on success).</p>

<ol>
<li><p>Let <var>record</var> be <var>module script</var>'s <span
Expand All @@ -103350,7 +103352,8 @@ document.querySelector("button").addEventListener("click", bound);
</li>

<li><p>Let <var>state</var> be <span>Record</span> { [[ParseError]]: null, [[Destination]]:
<var>destination</var>, [[PerformFetch]]: null }.</p></li>
<var>destination</var>, [[PerformFetch]]: null, [[SettingsObject]]: <var>fetch client settings
object</var> }.</p></li>

<li><p>If <var>performFetch</var> was given, set <var>state</var>.[[PerformFetch]] to
<var>performFetch</var>.</p></li>
Expand Down Expand Up @@ -105797,15 +105800,23 @@ import "https://example.com/foo/../module2.mjs";</code></pre>

<li><p>Let <var>destination</var> be <code data-x="">"script"</code>.</p></li>

<li><p>If <var>loadState</var> is not undefined, then set <var>destination</var> to
<var>loadState</var>.[[Destination]].</p></li>
<li>
<p>If <var>loadState</var> is not undefined, then:</p>

<ol>
<li><p>Set <var>destination</var> to <var>loadState</var>.[[Destination]].</p></li>

<li><p>Set <var>settingsObject</var> <var>loadState</var>.[[SettingsObject]].</p></li>
</ol>
</li>

<li>
<p><span>Fetch a single imported module script</span> given <var>url</var>, <var>settings
object</var>, <var>destination</var>, <var>fetchOptions</var>, <var>fetchReferrer</var>,
<var>moduleRequest</var>, and <var>onSingleFetchComplete</var> as defined below. If
<var>loadState</var> is not undefined and <var>loadState</var>.[[PerformFetch]] is not null,
pass <var>loadState</var>.[[PerformFetch]] along as well.</p>
<p><span>Fetch a single imported module script</span> given <var>url</var>,
<var>settingsObject</var>, <var>destination</var>, <var>fetchOptions</var>,
<var>fetchReferrer</var>, <var>moduleRequest</var>, and <var>onSingleFetchComplete</var> as
defined below. If <var>loadState</var> is not undefined and
<var>loadState</var>.[[PerformFetch]] is not null, pass <var>loadState</var>.[[PerformFetch]]
along as well.</p>

<p><var>onSingleFetchComplete</var> given <var>moduleScript</var> is the following
algorithm:</p>
Expand Down