Skip to content

docs: explain the throttling of soft navigations and how to set it for a flow - #12

Merged
ChristopherPHolder merged 2 commits into
mainfrom
docs/throttling
Nov 13, 2026
Merged

ChristopherPHolder merged 2 commits into
mainfrom
docs/throttling

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

Closes #6

Note

Builds on #11, whose commit is the first one here. Merge #11 first; this PR's diff then shrinks to the second commit. The project-wide setup documented here only works with #11.

What

The README's Throttling section now explains:

  • why a soft navigation step needs devtools or provided: simulate estimates from the document request, and a soft navigation has none. It also says what devtools and provided each do.
  • why the package can't switch it: one config per flow, and the soft navigation is only recognised while the step runs. Links to the upstream change.
  • both setups: on each step (Usage), or once for the whole flow through softNavigationConfig({ extends, settings: { throttlingMethod: 'devtools' } }).
  • the trade-off: for the whole flow, page loads are actually slowed down, vary more, and no longer compare with PageSpeed Insights or a default Lighthouse run. Use the per-step setting when they have to compare.
  • the extra wait: with any throttling but simulate, Lighthouse waits at least 5.25 s instead of 1 s after FCP, after load and for network and CPU quiet (nonSimulatedSettingsOverrides in Lighthouse's config.js). This came up while testing fix: return only the settings softNavigationConfig is given #11.
  • user-flow: both setups work in a flow file, and a project can set the throttling method once in .user-flowrc.json (the Settings section, now with throttlingMethod in its example).

Usage points to the Throttling section for the flow-wide setup.

Test

throttling.e2e-test.ts runs fixtures/flow-wide-throttling.mjs: a stock Lighthouse flow with DevTools throttling in the config and no step options. It has a page load and soft navigations from a callback and from startNavigation/endNavigation. Every step is observed, both soft navigations are reported and scored, and no step has an errored audit or a run warning.

The project-wide user-flow setup is covered by the project-settings e2e test in #11.

Verified

pnpm nx run-many -t lint test build typecheck e2e and pnpm nx format:check pass: 79 unit tests and 50 e2e tests.

Resolving the default config copied every default setting into the
result. user-flow merges its project settings under the flow config's,
so each of them was replaced by its default without a warning.
Lighthouse fills in the defaults itself.

Closes #8
…r a flow

Explain why a soft navigation step can't use simulated throttling, why
the package can't switch it per step, how to set it on each step or
for the whole flow or project, and what each costs. Add an e2e test of
a flow with DevTools throttling for the whole flow.

Closes #6
@ChristopherPHolder
ChristopherPHolder merged commit 01a00b6 into main Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document why soft navigation steps need devtools throttling and how to set it for the whole flow

1 participant