feat: add an opt-in HTTP(S) autolink extension #20
Mergedsilouanwright(GitHub profile, opens in a new tab)merged 11 commits into
main fromrefs/pull/20/headmerged by tannerlinsley - scripts/compare-revision.mjs line 58OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -52,3 +55,4 @@5255 for (const entry of [...entries.filter(entry => entry.group === 'tanstack'), ...publicEntries]) {5356 const results = []5457 for (const previous of [true, false]) {58+ if (previous && entry.group === 'tanstack-public' && !Object.hasOwn(baselinePackage.exports, entry.name)) {src/extensions/autolinks.ts line 4OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +1,4 @@1+import type { InlineParseContext, InlineParseResult, MarkdownExtension } from '../types.js'2+3+const protocol = /https?:\/\//iy4+const boundary = /(?<=[\p{L}\p{N}_/@<\\])/uy
- reports/autolinks.md line 19OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +1,19 @@1+# Optional HTTP(S) autolinks2+3+Based on Silouan Wright's PR #20 and composed with released Markdown 1.0.1. The extension stays opt-in, adds no runtime dependency, and leaves existing parser and renderer source unchanged.4+5+The standalone entry passes the original draft ceiling of 994 minified bytes, 632 gzip bytes and 568 Brotli bytes. All existing selective and complete-entry budgets remain unchanged.6+7+The follow-up preserves Unicode letter/number boundaries and the documented empty-string URL-policy rejection behavior. Valid and malformed candidates share text-node construction. The 336 tests include 50 extension cases and HTML/React/Octane parity. Exact-head CI covers full verify, the external corpus, packed consumers on Node 22/24 with React 18/19, skills and six streaming-browser combinations.8+9+## Matched throughput controls10+11+The comparison uses the original extension source at `90796de9df55de2ffa2028aafa972dfac431b24f` with the same current core, compiler, fixtures and completed output. Every streamed update is compared before timing. Astral-boundary and empty-policy cases deliberately change output and are excluded from throughput comparisons.12+13+Each variant runs in a fresh Node process, with 1,000 warmups per fixture, three fixed-iteration samples and five reversed-order process rounds. An emitted-byte-identical original/control pair detects noise. Calibration on an isolated GitHub runner with Node 24.22.1 kept control medians within 2% across six fixtures. Desktop samples overlapped other local validation and are rejected.14+15+Two initial isolated comparisons observed candidate/original ratios of 1.033-1.043 for repeated URL-free prose, 0.952-0.989 for URL-heavy text, 1.010-1.033 for BMP boundaries, 0.997-1.004 for malformed input, 1.000-1.011 for the AI response and 0.992-1.013 for progressive AI updates. One prose control differed by 7%, so these figures do not establish a general speedup. The cleaner repeat's prose difference was about 1.2 microseconds for a 4,960-byte fixture. A final independent repeat is retained with the run receipts before promotion.16+17+These are enabled-extension comparisons, not a claim about default core performance or browser speed. Sampled allocation is separate from retained heap, RSS and peak memory. Local allocation samples suggested fewer allocations for URL-heavy and malformed fixtures, but do not establish a general memory improvement.18+19+Reproduce the isolated calibration before comparison with the dedicated `autolink-benchmarks.yml` workflow with `mode=calibrate` or `compare`. Raw fixtures, source/emitted hashes, runtime metadata and all samples are uploaded by the workflow. The CLI equivalent is:
tannerlinsley merged this5446dcc
tannerlinsley closed this
Sign in to join this conversation.
Findings#
Warning
Review limit reached#
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 19 minutes.
Check out review usage here.
View limit details
Limit details: You’ve used all 2 included reviews currently available.
Learn how review limits work.
Review configuration:
91ca677f-838a-4bfb-9fea-dab715b25f83Reviewing files that changed from the base of the PR and between baeb6abb76196b5c52610ed7cf1d3d4f216fa003 and 41dd9d7c086de8e98bac4619699c293ae70b0959.
docs/guides/extensions.mdreports/autolinks.mdscripts/bench-autolinks-compare.mjsscripts/compare-revision.mjssrc/extensions/autolinks.tstests/autolinks.test.tsx57d0ac05-b993-4e87-980f-85189fc90b1aReviewing files that changed from the base of the PR and between 357a77c63e71553ff668654b0377aad31ac7f32e and baeb6abb76196b5c52610ed7cf1d3d4f216fa003.
.github/workflows/autolink-benchmarks.ymlreports/autolinks.mdIncluded review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
Walkthrough
The package adds an opt-in HTTP(S) autolink extension. It recognizes bare and angle-bracket URL candidates, validates them, and applies the configured URL transformation policy. The changes also add tests, documentation, package metadata, and benchmark tooling.
Changes: Optional HTTP(S) autolinks
package.json,src/extensions/autolinks.ts,tests/autolinks.test.tsx,tests/bundle-size.test.ts,.changeset/optional-http-autolinks.mdautolinksExtension()export and inline parser. Tests cover URL recognition, boundaries, rendering contexts, malformed candidates, and URL transformation. A bundle-size budget is set for the public entry.docs/core-concepts/syntax-profile.md,docs/guides/extensions.md,docs/overview.md,docs/reference/extensions.md,docs/reference/index.md,skills/render-markdown/SKILL.md,scripts/verify-docs.mjsscripts/bench-autolinks.ts,scripts/bench-autolinks-compare.mjs,scripts/compare-revision.mjs,reports/autolinks.md,.github/workflows/autolink-benchmarks.ymlEstimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)#
Merge Risk:
Low · previous review
baeb6The change is mergeable with bounded follow-up: decomposed Unicode words can gain unintended links, and narrow benchmark workflows can fail. Document the pre-merge CLI route and preserve the benchmark baseline if squash merging.
Pre-merge checks:
4 · 
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 7 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share