Skip to content

feat: implement Beta.2.1 unified Router and standalone Element tooling - #1343

Draft
SisyphusZheng wants to merge 3 commits into
devfrom
codex/beta2-1-router-core
Draft

feat: implement Beta.2.1 unified Router and standalone Element tooling#1343
SisyphusZheng wants to merge 3 commits into
devfrom
codex/beta2-1-router-core

Conversation

@SisyphusZheng

Copy link
Copy Markdown
Member

Pull Request

Target

Beta.2.1 implementation for #1320, #1338, #1324, #1325 and #1323; limited early #1339 page/form and Element proofs. Implements ADR-0152 and preserves ADR-0148's private compiler boundary.

Dependency: #1342 remains OPEN. This branch starts at its verified head 0d826954cb96b3a9306119830defd6000a798c95; targeting dev preserves the required PR CI trigger. The comparison therefore includes that prerequisite plan until it lands. Neither PR is being merged by this task.

What Changed

URL selection now occurs once in App RouteTable/RouteResolution before HTTP method dispatch. For an ordered GET-only /products/new before POST /products/:id, POST /products/new returns 405 with GET, HEAD, never dispatching to id=new. Explicit records retain declaration order; file records have deterministic static/parameter/catch-all ordering and duplicate-shape diagnostics.

  • Add private owned URLPatternList, derived from upstream v0.5.0 commit 4911e649cc11860c7da90c9d0d9b05626c5cbb83, with MIT license/provenance. Literal indexing and conservative candidates merge by original sequence before URLPattern.exec; no replacement pattern grammar.
  • Expose pure @openelement/app/router and Hono integration @openelement/app/router/http. Generated page handlers dispatch directly from the selected record. GET fallback for HEAD removes the actual response body; Allow belongs to the selected record.
  • Browser navigation uses the same resolver with complete URL components. Navigation API has History/Hash fallbacks; stale guards/loaders/actions cannot redirect or commit over newer navigation. Preserve download anchors even across Firefox's follow-up event with null downloadRequest.
  • Separate path captures and URLSearchParams. File source owns the path; reject duplicate descriptor route.path. Replace path-keyed generated routeManifest with ordered, explicitly projected routeRecords and stable file identities.
  • Add @openelement/adapter-vite/element using the existing private compiler. Packed adapter App/UI edges become optional peers so standalone Element authors need no Router. This does not claim the whole App package is independent of Element.
  • Centralize multi-identifier prerelease semantics; checkpoint successor is beta.2 → beta.2.1 → beta.2.2 → beta.2.3, followed only by explicit product-stage transition to 1.0.0-alpha.1. Historical internal 0.44 alpha.0–10 are not admitted for public release; 1.0 Alpha retains release verification.

Cleanup

Removed the old RouteTable static map/dynamic list/sorting/query proxy and method-dependent winner fallback; moved the normalization helper out of Element and deleted its old exports/adapter alias; removed generated per-page Hono winner/405 paths and migrated their callers/tests. Retained the boolean host-admission predicate (not a winner selector), non-OE host mounts, conservative list candidates, and necessary navigation fallbacks.

Evidence

Local macOS arm64, Deno 2.9.0 / Node 24.18.0; Chromium 147.0.7727.15, Firefox 148.0.2, WebKit 26.4.

  • PASS: deno test --frozen -A packages/app/__tests__ — 116 tests; benchmark now requires explicit execution and does not run when imported as a test.

  • PASS: changed Adapter entry/manifest/admission/SSG/foreign-scanner suites — 136 tests + 9 steps.

  • PASS: scanner/compiler/authoring/compiled-pack regressions — 46 tests + 29 steps.

  • PASS: version/bump/release/anchors/truth/publish/verifier suites — 118 tests.

  • PASS: deno task fixture:request-time:build; request-time parity — 1 test + 23 steps; deno task fixture:request-time:e2e:browsers — 213 tests.

  • PASS: deno run --frozen -A tools/consumer-packaged-element.ts after packing Element/adapter: isolated npm author without Router, separate plain HTML consumer, real registration/attribute/event updates in all three browsers, browser graph and 32 reachable declaration modules checked, authored sourcemap retained.

  • PASS: request-time fixture built with Node/Nitro 3.0.0 cloudflare_module preset and served locally by Wrangler 4.129.1/workerd at compatibility date 2026-06-12; GET 200, HEAD empty, form 422, PRG 303, PUT 405/Allow. No deployment. Initial Deno-driven Nitro build failed in upstream Terser CommonJS worker loading; do not interpret Node build success as a pass for that command.

  • PASS: deno task nitro:proof:node; Bun 1.4.1 serves generated fixture / and /live using the existing smoke scope.

  • PASS: isolated temporary version manifests: dry-run makes no writes, beta.2.1 apply works, repeated apply is idempotent; prepare/published-window and failed-resume covered by release tests. Working package versions remain beta.2.

  • URLPattern differential: 19,360 ordered pair/input cases across native and polyfill, also checked as URL objects; 300 seeded lists, full results and identity, with failure-sequence shrinking. Bounded corpus, not full standards certification.

  • Diagnostic: 5,000 literal routes, five samples × 100 lookups: original static route lookup ~1.64µs, owned list ~3.55µs, new full table ~5.75µs; linear oracle ~15.53ms. List construction median ~226.8ms; original construction is a separately labelled single ~229.2ms observation. Conservative-first patterns intentionally reduce selectivity. Memory NOT MEASURED. No general speedup claim.

  • deno task workflow:check

  • deno task arch:check (including staged new files)

  • deno task graph:check

  • deno task docs:check-current

  • deno task docs:check-strategy

  • deno task fmt:check

  • deno task lint

  • deno task typecheck

  • package-surface / interface snapshot / version anchors / release truth / release state-machine gates

  • Full required exact-SHA PR CI — pending; local scopes are not the release GO.

  • deno task test and whole-repository deno task build — not run locally; scoped builds/tests above are the local evidence.

Release Impact

  • Necessary current ownership/public-surface/release-policy docs and generated interface/API artifacts updated.
  • Package bump: none. Source/published facts, tags, dist-tags and release evidence unchanged.
  • Native Framework/Document convergence and expanded consumer qualification remain Beta.2.2. No Lit provider, universal renderer interface, or CEM redesign is included.
  • No examples changes, merge, tag, npm publish, production deployment, or issue closure. Independent review and exact-SHA CI remain required.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

@SisyphusZheng

Copy link
Copy Markdown
Member Author

Maintainer-approved Beta.2.x plan updated on 2026-09-08 in planning PR #1342, ADR-0152, VERSION_PLAN, 15 existing issues and Project 3.

The review comment #1343 (comment) says APIError: Insufficient Balance. The review workflow's SUCCESS is not a completed review. #1332 explicitly owns service recovery and failure propagation as an immediate merge prerequisite, not deferred cleanup. No provider/model or billing changes have been made.

#1343 remains incomplete: SSG output/navigation findings, fork migration/memory baselines, actual review, final-SHA CI and fresh verifier evidence are outstanding. Confirming #1342 ancestry is not a claim of baseline CI success. These planning updates do not repair product code or authorize release. Consume the updated #1342 planning contract before continuing implementation.

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.

1 participant