Skip to content

[breaking] visitAllLinks: visit-mode crawls with one render per target (new default) - #135

Merged
NullVoxPopuli merged 1 commit into
mainfrom
visit-mode
Jul 28, 2026
Merged

NullVoxPopuli merged 1 commit into
mainfrom
visit-mode

Conversation

@NullVoxPopuli

Copy link
Copy Markdown
Contributor

The click-based crawl does visit(returnTo) + click for every processed link: two page renders per unique target. In apps whose pages are expensive to render — docs apps that runtime-compile markdown and live demos — that constant is the entire wall-clock: AuditBoard's 265-page docs app measured ~4.8s per target, and the full crawl exceeded 30 minutes even after #133 made it linear.

'visit' mode (the new default) navigates straight to each discovered target and collects links there: one render per unique URL — the floor for a full crawl. Reachability is identical (parity test included). What click mode uniquely exercised — link interception via @properLinks, the relative-href rewrite, non-SPA skips — is covered once by this repo's own test-app rather than once per link per consuming app. visit() also surfaces route errors directly, which the crawl reports as a failed navigation carrying the error text (click mode only showed these indirectly, as a URL mismatch after the app's error substate).

'click' mode remains available — visitAllLinks(callback, knownRedirects, { mode: 'click' }) — for apps that want per-link click fidelity. The relative-href authoring warning (with its fix-your-docs action item) fires in both modes.

Tests: a parity test asserts both modes crawl the same URL set (which also keeps the click-path anchor rewrite exercised); the existing relative-href, hash, non-SPA, and visited-once tests now run against visit mode. 9/9 passing.

🤖 Generated with Claude Code

…ult)

The click-based crawl does visit(returnTo) + click for every processed
link: two page renders per unique target. In apps whose pages are
expensive to render — e.g. docs apps that runtime-compile markdown and
live demos — that constant is the whole wall-clock: a 265-page app
measured ~4.8s per target, and the full crawl exceeded 30 minutes.

'visit' mode (now the default) navigates straight to each target and
collects its links there: one render per unique URL, the floor for a
full crawl. Reachability is identical (covered by a parity test), and
what click mode uniquely exercised — link interception, the
relative-href rewrite, non-SPA skips — is covered once by this repo's
own test-app instead of once per link per consuming app. visit() also
surfaces route errors directly, which the crawl reports as a failed
navigation with the error text.

'click' mode remains available via visitAllLinks(cb, redirects,
{ mode: 'click' }) for apps that want per-link click fidelity. The
relative-href authoring warning fires in both modes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NullVoxPopuli NullVoxPopuli added the enhancement New feature or request label Jul 28, 2026
@NullVoxPopuli NullVoxPopuli changed the title visitAllLinks: visit-mode crawls with one render per target (new default) [breaking] visitAllLinks: visit-mode crawls with one render per target (new default) Jul 28, 2026
@NullVoxPopuli
NullVoxPopuli merged commit 9f00f1e into main Jul 28, 2026
4 checks passed
@NullVoxPopuli
NullVoxPopuli deleted the visit-mode branch July 28, 2026 22:18
@github-actions github-actions Bot mentioned this pull request Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant