feat: implement Beta.2.1 unified Router and standalone Element tooling - #1343
feat: implement Beta.2.1 unified Router and standalone Element tooling#1343SisyphusZheng wants to merge 3 commits into
Conversation
|
APIError: Insufficient Balance |
|
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. |
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; targetingdevpreserves 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/newbefore POST/products/:id, POST/products/newreturns 405 withGET, HEAD, never dispatching toid=new. Explicit records retain declaration order; file records have deterministic static/parameter/catch-all ordering and duplicate-shape diagnostics.4911e649cc11860c7da90c9d0d9b05626c5cbb83, with MIT license/provenance. Literal indexing and conservative candidates merge by original sequence before URLPattern.exec; no replacement pattern grammar.@openelement/app/routerand 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.@openelement/adapter-vite/elementusing 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.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.tsafter 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/liveusing 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:checkdeno task arch:check(including staged new files)deno task graph:checkdeno task docs:check-currentdeno task docs:check-strategydeno task fmt:checkdeno task lintdeno task typecheckpackage-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 testand whole-repositorydeno task build— not run locally; scoped builds/tests above are the local evidence.Release Impact