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

Bump path-to-regexp from 6.3.0 to 8.2.0 #12034

Closed

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Oct 7, 2024

I started trying to work on this. The error is being caused by a change in the way path-to-regexp works so the compile function is erroring. The error you see in the cypress tests is because the variant urls are going to a fallback due to the error from

` try {
const compilePath = compile(path, { encode: value => value });

return compilePath({
  ...pathParams,
  variant: `/${variant}`,
  amp: undefined, // we don't want to link to AMP pages directly
  nonCanonicalArticleRenderPlatform: undefined, // we don't want to link to AMP (.amp) or APP (.app) for the Optimo article route
});

} catch {
return fallback;
}`

I think the error is because we have characters in the path that are no longer accepted by path-to-regexp. See this screenshot for some detail:

Screenshot 2024-12-03 at 11 24 20

I tried replacing or escaping the invalid characters in the path and made some progress but my stashed changes got lost.

It was also getting quite complex to replace all the characters so the oath could be valid, so I question whether we could instead of using this dependency, do it in a different way. This dependency is only used in this piece of code.

Bumps path-to-regexp from 6.3.0 to 8.2.0.

Release notes

Sourced from path-to-regexp's releases.

8.2.0

Fixed

  • Allowing path-to-regexp to run on older browsers by targeting ES2015
    • Target ES2015 5969033
      • Also saved 0.22kb (10%!) by removing the private class field down level
    • Remove s flag from regexp 51dbd45

pillarjs/path-to-regexp@v8.1.0...v8.2.0

v8.1.0

Added

  • Adds pathToRegexp method back for generating a regex
  • Adds stringify method for converting TokenData into a path string

pillarjs/path-to-regexp@v8.0.0...v8.1.0

Simpler API

Heads up! This is a fairly large change (again) and I need to apologize in advance. If I foresaw what this version would have ended up being I would not have released version 7. A longer blog post and explanation will be incoming this week, but the pivot has been due to work on Express.js v5 and this will the finalized syntax used in Express moving forward.

Edit: The post is out - https://blakeembrey.com/posts/2024-09-web-redos/

Added

  • Adds key names to wildcards using *name syntax, aligns with : behavior but using an asterisk instead

Changed

  • Removes group suffixes of ?, +, and * - only optional exists moving forward (use wildcards for +, {*foo} for *)
  • Parameter names follow JS identifier rules and allow unicode characters

Added

  • Parameter names can now be quoted, e.g. :"foo-bar"
  • Match accepts an array of values, so the signature is now string | TokenData | Array<string | TokenData>

Removed

  • Removes loose mode
  • Removes regular expression overrides of parameters

pillarjs/path-to-regexp@v7.1.0...v8.0.0

Support array inputs (again)

Added

  • Support array inputs for match and pathToRegexp 3fdd88f

pillarjs/path-to-regexp@v7.1.0...v7.2.0

... (truncated)

Commits

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/path-to-regexp-8.2.0 branch 3 times, most recently from 75f7345 to abedb31 Compare October 14, 2024 09:55
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/path-to-regexp-8.2.0 branch 16 times, most recently from 44864e7 to 610fdfb Compare October 24, 2024 08:01
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/path-to-regexp-8.2.0 branch 2 times, most recently from 666e6af to 19a05ef Compare October 28, 2024 08:21
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) from 6.3.0 to 8.2.0.
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](pillarjs/path-to-regexp@v6.3.0...v8.2.0)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/path-to-regexp-8.2.0 branch from 19a05ef to 7c35d46 Compare October 29, 2024 14:06
@karinathomasbbc
Copy link
Contributor

Closing as this will be deleted as part of https://jira.dev.bbc.co.uk/browse/NEWSWORLDSERVICE-2099

Copy link
Contributor Author

dependabot bot commented on behalf of github Jan 20, 2025

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/npm_and_yarn/path-to-regexp-8.2.0 branch January 20, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants