pillarjs / router

Simple middleware-style router
MIT License
410 stars 103 forks source link

path-to-regexp@^8.0.0 #117

Closed wesleytodd closed 2 months ago

wesleytodd commented 3 months ago

Updates to path-to-regexp@8.

So from the tests, the three breaking changes are:

  1. We drop support for partial capture group router.route('/user(s?)/:user/:op') but still have optional non-capture /user{s}/:user/:op
  2. :name? becomes {:name}
  3. :name* becomes *name.
  4. The splat change also changes splat from strings to an array of strings
  5. Optional splats become {*name}
  6. :name+ becomes *name and thus equivalent to *name so I dropped those tests
  7. Strings as regular expressions are fully removed, need to be converted to native regular expressions

I am going to link this into express and see locally if this set of breaking changes holds up in that test suite now.

wesleytodd commented 3 months ago

I am about to rebase this onto the new CI and lint changes. I should probably just life out the changes, but I like a challenge with git and what is the point of doing this if we are not having fun while we do it?

wesleytodd commented 3 months ago

ok I think I did this correctly. There was a duplicate test and a few things which made it confusing, but I think once we get path-to-regexp@8 released this is nearly ready.

socket-security[bot] commented 3 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/path-to-regexp@8.0.0 None 0 51.3 kB blakeembrey

🚮 Removed packages: npm/path-to-regexp@3.2.0)

View full report↗︎