Skip to report

Route helpers read from a new request module

Trace Hono’s Route Helper, which reads matched routes and base paths from a new internal request module, while the request-based route properties are deprecated.

honojs/hono #4204 · PR by usualoma · Merged

honojs/hono 0bb821a4..fbf23b54

base and head as given

  • Request matching state now has a dedicated internal boundary.
  • Route helpers now depend on request matching state.
  • Route helpers expose base-path inspection.
files changed
9
in a component
5
lines in components
146
components
3
public routes changed
0
schema statements
0
new dependencies
0
excluded by role
4
Based on 5 of 5 eligible changed files

Route inspection helpers

Added
Before
Requests exposed route inspection
After
Helpers expose route inspection

Handlers can now retrieve matched routes, the current registered route, and raw or parameter-resolved base paths through standalone route helpers. Existing request-based route access remains available but deprecated.

In favour

  • In favour: Keeps deprecated request accessors during migration

Against

  • Against: Route helpers couple to a hidden request accessor
Files changed in 3 components. Dependencies shown: 3 new
new · 32 components added

3 new dependencies between components — Route Helpers → Core Source · Core Source → Request Handling · Route Helpers → Request Handling

What else could behave differently

53 components · 104 files

These components import changed code, directly or through other files. A traced dependency is a place to review, not a confirmed runtime failure.

Reached 3

ComponentSymbolCited atFilesReached by
Core Sourcesrc/Signature changed 1 of 3 changed symbols reaching itsrc/request.ts:30-41974 direct · 3 at two steps
Trace path

Shortest component path from the changed symbol:

  1. Core Source

Later steps follow file imports; they do not prove this symbol is called.

src/utils/Signature changed 1 of 3 changed symbols reaching itsrc/request.ts:30-41951 direct · 2 at three steps · 2 at four steps
Trace path

Shortest component path from the changed symbol:

  1. Core Source
  2. src/utils/

Later steps follow file imports; they do not prove this symbol is called.

src/client/Signature changed 1 of 3 changed symbols reaching itsrc/types.ts:58-634none direct · 1 at two steps · 3 at three steps
Trace path

Shortest component path from the changed symbol:

  1. Core Source
  2. src/client/

Later steps follow file imports; they do not prove this symbol is called.

Held back 15

ComponentFilesReached byResolution
runtime-tests/workerd/1none direct · 1 at three stepsprecise
runtime-tests/lambda/2none direct · 2 at four stepsprecise
perf-measures/type-check/1none direct · 1 at four stepsprecise
src/adapter/cloudflare-workers/5none direct · 4 at three steps · 1 at four stepsprecise
src/adapter/aws-lambda/2none direct · 1 at three steps · 1 at four stepsprecise
src/adapter/deno/5none direct · 4 at three steps · 1 at four stepsprecise
src/adapter/vercel/3none direct · 2 at three steps · 1 at four stepsprecise
src/adapter/netlify/2none direct · 1 at three steps · 1 at four stepsprecise
src/adapter/service-worker/2none direct · 1 at three steps · 1 at four stepsprecise
src/middleware/compress/1none direct · 1 at three stepsprecise
src/middleware/etag/1none direct · 1 at three stepsprecise
src/middleware/logger/1none direct · 1 at three stepsprecise
src/middleware/powered-by/1none direct · 1 at three stepsprecise
src/middleware/pretty-json/1none direct · 1 at three stepsprecise
src/middleware/trailing-slash/1none direct · 1 at three stepsprecise

Ranked lower 35

ComponentFilesReached by
src/helper/conninfo/2none direct · 1 at two steps · 1 at three steps
src/preset/2none direct · 2 at two steps
src/validator/2none direct · 1 at two steps · 1 at three steps
benchmarks/deno/1none direct · 1 at two steps
src/helper/cookie/1none direct · 1 at two steps
src/helper/websocket/1none direct · 1 at two steps
src/middleware/serve-static/1none direct · 1 at two steps
src/helper/ssg/41 direct · 2 at two steps · 1 at three steps
src/helper/adapter/1none direct · 1 at two steps
src/helper/dev/11 direct
src/helper/route/11 direct
src/adapter/bun/6none direct · 2 at two steps · 4 at three steps
src/helper/streaming/4none direct · 3 at two steps · 1 at three steps
src/adapter/lambda-edge/3none direct · 1 at two steps · 2 at three steps
src/adapter/cloudflare-pages/2none direct · 1 at two steps · 1 at three steps
src/helper/accepts/2none direct · 1 at two steps · 1 at three steps
src/middleware/jwk/2none direct · 1 at two steps · 1 at three steps
src/middleware/jwt/2none direct · 2 at two steps
src/middleware/language/2none direct · 1 at two steps · 1 at three steps
src/middleware/request-id/2none direct · 1 at two steps · 1 at three steps
src/middleware/secure-headers/2none direct · 1 at two steps · 1 at three steps
src/middleware/timing/2none direct · 1 at two steps · 1 at three steps
src/helper/factory/1none direct · 1 at two steps
src/middleware/basic-auth/1none direct · 1 at two steps
src/middleware/bearer-auth/1none direct · 1 at two steps
src/middleware/body-limit/1none direct · 1 at two steps
src/middleware/cache/1none direct · 1 at two steps
src/middleware/combine/1none direct · 1 at two steps
src/middleware/context-storage/1none direct · 1 at two steps
src/middleware/cors/1none direct · 1 at two steps
src/middleware/csrf/1none direct · 1 at two steps
src/middleware/ip-restriction/1none direct · 1 at two steps
src/middleware/jsx-renderer/1none direct · 1 at two steps
src/middleware/method-override/1none direct · 1 at two steps
src/middleware/timeout/1none direct · 1 at two steps

Statements 3

The HonoRequest signature change, affecting 1 of 4 names in its file, reached 7 files in src. 43
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 5 files in src/utils. 122
src/request.ts:30-419
The RouterRoute signature change, affecting 1 of 48 names in its file, reached 4 files in src/client. 13
src/types.ts:58-63

81 reached files belong to no component — tests, docs and config.

Routes, schema, dependencies

No public URL, no migration and no new package.

Inspect components, files and symbols

Component

Core SourceModified
src/

3 files · 16 lines

53 dependents

Request HandlingAdded
src/request/

1 file · 1 line

2 dependents

Request handling added GET_MATCH_RESULT to its exported surface.
Route HelpersAdded
src/helper/route/

1 file · 129 lines

Route helpers added the exported names basePath, baseRoutePath, matchedRoutes, and routePath.

File

Core Sourcesrc/
src/request.ts

+13 −0

Core Sourcesrc/
src/hono-base.ts

+1 −1

Core Sourcesrc/
src/types.ts

+1 −0

Request Handlingsrc/request/
src/request/constants.ts

+1 −0

Route Helperssrc/helper/route/
src/helper/route/index.ts

+129 −0

Function

imports what changeddownstream of it, one mark per step

HonoRequest()src/request.ts

reaches 43 components

The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/helper/conninfo. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/validator. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in benchmarks/deno. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/helper/cookie. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/helper/websocket. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/serve-static. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/helper/adapter. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 6 files in src/adapter/bun. 24
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 4 files in src/helper/streaming. 31
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 3 files in src/adapter/lambda-edge. 12
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/adapter/cloudflare-pages. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/helper/accepts. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/middleware/jwk. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/middleware/jwt. 2
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/middleware/language. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/middleware/request-id. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/middleware/secure-headers. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/middleware/timing. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/basic-auth. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/bearer-auth. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/body-limit. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/cache. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/combine. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/context-storage. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/cors. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/csrf. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/ip-restriction. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/jsx-renderer. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/method-override. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/timeout. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in runtime-tests/workerd. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in runtime-tests/lambda. 2
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in perf-measures/type-check. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 5 files in src/adapter/cloudflare-workers. 41
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 2 files in src/adapter/aws-lambda. 11
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 5 files in src/adapter/deno. 41
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 3 files in src/adapter/vercel. 21
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/compress. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/etag. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/logger. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/powered-by. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/pretty-json. 1
src/request.ts:30-419
The HonoRequest signature change, affecting 1 of 4 names in its file, reached 1 file in src/middleware/trailing-slash. 1
src/request.ts:30-419
RouterRoute()src/types.ts

reaches 6 components

The RouterRoute signature change, affecting 1 of 48 names in its file, reached 2 files in src/preset. 2
src/types.ts:58-63
The RouterRoute signature change, affecting 1 of 48 names in its file, reached 4 files in src/helper/ssg. 121
src/types.ts:58-63
The RouterRoute signature change, affecting 1 of 48 names in its file, reached 1 file in src/helper/dev. 1
src/types.ts:58-63
The RouterRoute signature change, affecting 1 of 48 names in its file, reached 1 file in src/helper/factory. 1
src/types.ts:58-63
The RouterRoute signature change, affecting 1 of 48 names in its file, reached 2 files in src/adapter/netlify. 11
src/types.ts:58-63
The RouterRoute signature change, affecting 1 of 48 names in its file, reached 2 files in src/adapter/service-worker. 11
src/types.ts:58-63

Diff

Core Sourcesrc/
src/request.ts

2–2, 365–368, 372–375 and 1 more span

Core Sourcesrc/
src/hono-base.ts

374–374

Core Sourcesrc/
src/types.ts

59–59

Request Handlingsrc/request/
src/request/constants.ts

1–1

Route Helperssrc/helper/route/
src/helper/route/index.ts

1–129

Analysis scope

463 → 3
  1. 463
    files at head
  2. 70
    components
  3. 3
    changed by this change

Where the new files landed

2 new files
New fileBelongs toUsed byCallsServes
src/request/constants.ts
Request Handlingnew territory
Core SourceRoute Helpers
nothing outside its own component
src/helper/route/index.ts
Route Helpersnew territory
Core SourceRequest Handlingsrc/utils/
./route

1 added file carries no component — 1 test.

3components changed
51reached, not changed
2components added/removed
4dependencies added between components
0dependencies removed between components
0files moved to another path

9 files changed, 58 claims stated. 53 components reached in total.

naming: “model

narrative: “model

analyzer 0.2.0, config v1.9.0-phase8

Every line above is derived from 0bb821a4..fbf23b54 and nothing else.