Skip to content

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Jul 6, 2021

This ensures we encode / to %2F properly while interpolating dynamic route params into a path since previously we were using encodeURI on the resulting string which doesn't encode / since it is a valid path value.

Bug

  • Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Fixes: #24775

Copy link
Member

@huozhi huozhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member Author

ijjk commented Jul 6, 2021

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
buildDuration 13.4s 13.6s ⚠️ +176ms
buildDurationCached 3.3s 3.3s -68ms
nodeModulesSize 49.3 MB 49.3 MB ⚠️ +279 B
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
/ failed reqs 0 0
/ total time (seconds) 2.413 2.391 -0.02
/ avg req/sec 1036.2 1045.53 +9.33
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.341 1.34 0
/error-in-render avg req/sec 1864.91 1865.24 +0.33
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
359.HASH.js gzip 3.09 kB 3.09 kB
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 20.6 kB 20.6 kB
webpack-HASH.js gzip 1.49 kB 1.49 kB
Overall change 67.2 kB 67.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
_app-HASH.js gzip 803 B 803 B
_error-HASH.js gzip 3.18 kB 3.18 kB
amp-HASH.js gzip 526 B 526 B
css-HASH.js gzip 329 B 329 B
hooks-HASH.js gzip 903 B 903 B
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.65 kB 1.65 kB
routerDirect..HASH.js gzip 322 B 322 B
withRouter-HASH.js gzip 320 B 320 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 8.42 kB 8.42 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
_buildManifest.js gzip 390 B 390 B
Overall change 390 B 390 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
index.html gzip 523 B 523 B
link.html gzip 537 B 537 B
withRouter.html gzip 515 B 515 B
Overall change 1.57 kB 1.57 kB

Webpack 4 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
buildDuration 12s 12s ⚠️ +71ms
buildDurationCached 4.9s 4.7s -193ms
nodeModulesSize 49.3 MB 49.3 MB ⚠️ +279 B
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
/ failed reqs 0 0
/ total time (seconds) 2.451 2.414 -0.04
/ avg req/sec 1019.8 1035.43 +15.63
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.406 1.356 -0.05
/error-in-render avg req/sec 1777.91 1844.19 +66.28
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
14.HASH.js gzip 3.11 kB 3.11 kB
677f882d2ed8..HASH.js gzip 13.9 kB 13.9 kB
framework.HASH.js gzip 41.8 kB 41.8 kB
main-HASH.js gzip 7.81 kB 7.81 kB
webpack-HASH.js gzip 1.19 kB 1.19 kB
Overall change 67.8 kB 67.8 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
_app-HASH.js gzip 791 B 791 B
_error-HASH.js gzip 3.83 kB 3.83 kB
amp-HASH.js gzip 531 B 531 B
css-HASH.js gzip 333 B 333 B
hooks-HASH.js gzip 910 B 910 B
index-HASH.js gzip 227 B 227 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 295 B 295 B
withRouter-HASH.js gzip 292 B 292 B
e025d2764813..52f.css gzip 125 B 125 B
Overall change 8.98 kB 8.98 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
_buildManifest.js gzip 418 B 418 B
Overall change 418 B 418 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/interpolate-slash-encoding Change
index.html gzip 569 B 569 B
link.html gzip 581 B 581 B
withRouter.html gzip 561 B 561 B
Overall change 1.71 kB 1.71 kB
Commit: 05f8a3d

@ijjk ijjk merged commit c53b60a into vercel:canary Jul 6, 2021
@ijjk ijjk deleted the fix/interpolate-slash-encoding branch July 6, 2021 21:28
kodiakhq bot pushed a commit that referenced this pull request Aug 4, 2021
This is a follow-up to #26963 which after discussion changes to interpolate the decoded variant of the value into the path. 

x-ref: #24775

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Aug 19, 2021
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Aug 19, 2021
This is a follow-up to vercel#26963 which after discussion changes to interpolate the decoded variant of the value into the path. 

x-ref: vercel#24775

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encoded slashes not working as expected in production in a catch-all route
2 participants