[breaking] visitAllLinks: visit-mode crawls with one render per target (new default) - #135
Merged
Merged
Conversation
…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>
Merged
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.
The click-based crawl does
visit(returnTo)+clickfor 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