Skip to content

docs: phase 5 — architecture page (Layout + Why pure Python → docs/)#8

Merged
chad-loder merged 1 commit into
mainfrom
docs/phase-5-architecture
May 12, 2026
Merged

docs: phase 5 — architecture page (Layout + Why pure Python → docs/)#8
chad-loder merged 1 commit into
mainfrom
docs/phase-5-architecture

Conversation

@chad-loder
Copy link
Copy Markdown
Owner

Summary

Migrates the README's contributor-only Layout + Why-pure-Python sections (both already below the `` marker) into a polished `docs/explanation/architecture.md`. Adds three things the README sections didn't have room for:

  1. The matching pipeline — ASCII diagrams of compile-time (constructor FSM → canonicalize → tokenize → parts → regex → engine) and match-time (yarl.URL → canonicalize → fullmatch → structured result). Makes the "same canonicalization on both sides" property explicit.
  2. The engine seam — Protocol sketch showing how a future PyO3 backend around `liburlpattern` or `rust-urlpattern` would slot in next to the existing `re` / `regex` adapters.
  3. Deliberate-divergence notes — the three places the implementation isn't the simplest possible shape: yarl.URL fast path, `with_*` derivers, the three WHATWG-strictness rules.

README collapses the two sections to a three-line forward-link block. properdocs nav grows an "Explanation" section.

Test plan

Migrates the README's contributor-only "Layout" and "Why pure Python"
sections (both below the <!-- pypi-end --> marker, so neither showed
on PyPI in the first place) into a polished docs/explanation/
architecture.md, with three deepenings the README sections didn't
have room for:

* **The matching pipeline.** Two ASCII diagrams: pattern compile
  (input → constructor FSM → canonicalize → tokenize → parts → regex
  source → compiled engine) and match-time (yarl.URL → canonicalize →
  fullmatch → structured URLPatternResult). Made the "same
  canonicalization runs on both sides" property explicit.

* **The engine seam.** A Protocol sketch showing how the optional
  regex-package adapter plugs in, and how a future PyO3 backend
  around liburlpattern or rust-urlpattern would slot under
  ``_regex_engine/`` without touching the URLPattern surface.

* **Where the implementation diverges from the simplest possible
  shape.** Names the three places (yarl.URL fast path, ``with_*``
  derivers, the three WHATWG-strictness rules) so a reader doesn't
  have to spelunk to find them — and forward-links the strictness
  detail to the existing yarl comparison page.

README's Layout and Why-pure-Python sections collapse to a single
three-line forward-link block. properdocs nav gets a new "Explanation"
section. Phase 5 task #47 closed.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 12, 2026
@chad-loder chad-loder merged commit 05782d3 into main May 12, 2026
11 checks passed
@chad-loder chad-loder deleted the docs/phase-5-architecture branch May 12, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant