Skip to content
The React Framework
JavaScript TypeScript Other
Branch: canary
Clone or download

Latest commit

Janpot Update route regex for optional catch-all parameters in named regexes (
…#14456)

Noticed while working on #14400 that the optional catch-all handling was missing in `namedRegex`.

This whole file also seemed quite regex heavy so I took a look at the overall logic and changed a few things. It worked by regex escaping the whole route then unescape the dynamic parts. I changed it to only regex escape the static parts, this eliminates unnecessary back and forth escaping. It also makes the dynamic parts handling more readable. The whole logic is less reliant on regexes and just uses simple string manipulation to translate the route into a regex, I didn't measure anything but as an effect this should make it more performant.
Latest commit a7af013 Jun 22, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update stats action for running locally (#14143) Jun 13, 2020
.vscode skip node internals (#13345) May 25, 2020
bench Upgrade to Prettier 2 (#13061) May 18, 2020
docs docs: update links to docs site (#14305) Jun 18, 2020
errors docs: update links to docs site (#14305) Jun 18, 2020
examples Add example for proxying upstream with custom routes (#14374) Jun 22, 2020
packages Update route regex for optional catch-all parameters in named regexes ( Jun 22, 2020
test Update route regex for optional catch-all parameters in named regexes ( Jun 22, 2020
.eslintignore [examples] with-ts-eslint-jest example app (#12025) May 25, 2020
.eslintrc.json Remove unused variable (#13716) Jun 3, 2020
.gitignore Add .vercel to gitignore (#13595) May 31, 2020
.npmrc Remove version prefix Oct 1, 2018
.prettierignore Migrate PR stats action into Next.js repo (#13177) May 21, 2020
.prettierignore_staged Upgrade to Prettier 2 (#13061) May 18, 2020
.prettierrc.json Prettier `trailingComma` default value to `es5` since 2.0 (#14391) Jun 22, 2020
CODE_OF_CONDUCT.md Update Code of Conduct email address (#12108) Apr 22, 2020
UPGRADING.md Move upgrading guide to /docs (#10727) Feb 28, 2020
azure-pipelines.yml Update to track test timings separate for Azure and Actions (#12083) Apr 21, 2020
check-pre-compiled.sh Pre-ncc compiled packages to prevent re-nccing unnecessarily (#11569) Apr 7, 2020
contributing.md Suggest `npx` over `npm init` (#13637) Jun 1, 2020
jest.config.js Use the jest-circus test runner (#12974) May 16, 2020
lerna.json v9.4.5-canary.15 Jun 22, 2020
license.md Update year on license files Apr 21, 2020
lint-staged.config.js Update browserslist/caniuse-lite (#13605) May 31, 2020
package.json Update firebase to fix install errors on node 14 (#13493) May 28, 2020
publish-release.sh Make sure to exit publish script with correct code (#10310) Jan 28, 2020
readme.md Monorepo (#5341) Sep 30, 2018
run-tests.js Upgrade to Prettier 2 (#13061) May 18, 2020
test-file.txt Add additional file serving tests (#12479) May 4, 2020
yarn.lock update AMP Optimizer to v2.5.3 (#14173) Jun 15, 2020

readme.md

You can’t perform that action at this time.