Skip to content

fix(router): handle slashes after regex quantifiers - #5552

Open
usualoma wants to merge 1 commit into
v5from
fix-route-regex-quantifiers-v5
Open

usualoma wants to merge 1 commit into
v5from
fix-route-regex-quantifiers-v5

Conversation

@usualoma

Copy link
Copy Markdown
Member

Route patterns such as /x/:prefix{a{2}/b}/x should match /x/aa/b/x, capturing aa/b as prefix.

Currently, pattern masking stops at the quantifier’s closing }, leaving the following / exposed to path splitting.

This is a fairly rare edge case, so I hesitated over whether it was worth adding code to support it. However, the routing syntax allows this pattern, so I’m opening this PR.

The author should do the following, if applicable

  • Add tests
  • Run tests
  • pnpm run check:fix to format and lint the code

@github-actions

Copy link
Copy Markdown

Bundle size check

main (552ea02) #5552 (4ea316b) +/-
Bundle Size (B) 18,335B 18,693B +358B
Bundle Size (KB) 17.91K 18.25K +0.34K

Compiler Diagnostics (tsc)

main (552ea02) #5552 (4ea316b) +/-
Files 83 84 +1
Lines 59,446 59,530 +84
Identifiers 60,625 61,878 +1,253
Symbols 106,532 115,720 +9,188
Types 163,092 171,784 +8,692
Instantiations 414,023 452,803 +38,780
Memory used 208,711K 193,259K -15,452K
I/O read 0.01s 0.01s 0s
I/O write 0s 0s 0s
Parse time 0.29s 0.22s -0.07s
Bind time 0.1s 0.09s -0.01s
Check time 1.25s 1.01s -0.24s
Emit time 0s 0s 0s
Total time 1.65s 1.32s -0.33s

Compiler Diagnostics (typescript-go)

main (552ea02) #5552 (4ea316b) +/-
Files 215 216 +1
Lines 121,008 121,092 +84
Identifiers 107,353 108,609 +1,256
Symbols 181,164 189,748 +8,584
Types 262,348 271,038 +8,690
Instantiations 621,588 660,480 +38,892
Memory used 153,867K 158,591K +4,724K
Memory allocs 1,781,675 1,851,858 +70,183
Config time 0.001s 0.001s 0s
BuildInfo read time 0.001s 0s -0.001s
Parse time 0.086s 0.065s -0.021s
Bind time 0s 0s 0s
Check time 0.459s 0.385s -0.074s
Emit time 0.004s 0.003s -0.001s
Changes compute time 0.021s 0.017s -0.004s
Total time 0.601s 0.496s -0.105s

Reported by octocov

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v5@b0d28c4). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v5    #5552   +/-   ##
=====================================
  Coverage      ?   79.93%           
=====================================
  Files         ?      131           
  Lines         ?    10151           
  Branches      ?     2237           
=====================================
  Hits          ?     8114           
  Misses        ?     2037           
  Partials      ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 77,093.06 99,154.50 73,868.29 58,256.38
hono (current) bun 100,781.85 130,009.34 95,759.50 76,576.71
Change +30.73% +31.12% +29.64% +31.45%

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