Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency path-to-regexp to v7 #756

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 21, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
path-to-regexp ^6.2.1 -> ^7.0.0 age adoption passing confidence

Release Notes

pillarjs/path-to-regexp (path-to-regexp)

v7.1.0: Strict mode

Compare Source

Added

  • Adds a strict option to detect potential ReDOS issues

Fixed

  • Fixes separator to default to suffix + prefix when not specified
  • Allows separator to be undefined in TokenData
    • This is only relevant if you are building TokenData manually, previously parse filled it in automatically

Comments

  • I highly recommend enabling strict: true and I'm probably releasing a V8 with it enabled by default ASAP as a necessary security mitigation

v7.0.0: Wildcard, unicode, and modifier changes

Compare Source

Hi all! There's a few major breaking changes in this release so read carefully.

Breaking changes:

  • Parameter names can now contain all unicode identifier characters (defined as regex \p{XID_Continue}).
  • No more implied prefix with / and . (this is relevant when using ?, *, or +)
  • Modifiers (?, *, +) must be used after a param explicitly wrapped in {}
  • The API is no longer supporting arrays or regexes as input
  • The wildcard (standalone *) has been added back and matches Express.js expected behavior
  • Removed endsWith option
  • Renamed strict: true to trailing: false
  • Reserved ;, ,, !, and @ for future use-cases
  • Removed tokensToRegexp, tokensToFunction and regexpToFunction in favor of simplifying exports
  • Enable a "loose" mode by default, so / can be repeated multiple times in a matched path (i.e. /foo works like //foo, etc)
  • encode and decode no longer receive the token as the second parameter
  • Removed the ESM + CommonJS dual package in favor of only one CommonJS supported export
  • Minimum JS support for ES2020 (previous ES2015)
  • Stricter compile function - expects an array of strings in repeated parameters, and strings in non-repeated parameters

Added:

  • Adds encodePath to fix an issue around encode being used for both path and parameters (the path and parameter should be encoded slightly differently)
  • Adds loose as an option to support arbitrarily matching the delimiter in paths, e.g. foo/bar and foo///bar should work the same
  • Allow encode and decode to be set to false which skips all processing of the parameters input/output
  • All remaining methods support TokenData (exported, returned by parse) as input
    • This should be useful if you are programmatically building paths to match or want to avoid parsing multiple times

Requests for feedback:

  • Requiring {} is an obvious drawback but I'm seeking feedback on whether it helps make path behavior clearer
    • Related: Removing / and . as implicit prefixes
  • Removing array and regex support is to reduce the overall package size for things many users don't need
  • Unicode IDs are added to align more closely with browser URLPattern behavior, which uses JS identifiers

Configuration

📅 Schedule: Branch creation - "after 9am every weekday,before 5pm every weekday" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/path-to-regexp-7.x branch 4 times, most recently from 14585f2 to f2007f6 Compare July 11, 2024 12:28
@renovate renovate bot force-pushed the renovate/path-to-regexp-7.x branch from f2007f6 to eb030cb Compare July 24, 2024 09:06
@renovate renovate bot force-pushed the renovate/path-to-regexp-7.x branch from eb030cb to 05cd3f5 Compare August 1, 2024 10:07
@renovate renovate bot force-pushed the renovate/path-to-regexp-7.x branch from 05cd3f5 to 9aa5c78 Compare August 1, 2024 10:21
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.

None yet

0 participants