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

Ensure has segments are allowed in destination #23588

Merged
merged 2 commits into from Apr 1, 2021

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Mar 31, 2021

This ensures we gather segments from the experimental has field when validating segments used in the destination to prevent the invalid segments in the destination error from showing incorrectly. This usage has been added to the custom-routes test suite to ensure the segments are passed correctly from the has field.

Fixes: #23415

Bug

  • Related issues linked using fixes #number
  • Integration tests added

@ijjk
Copy link
Member Author

ijjk commented Mar 31, 2021

Stats from current PR

Default Server Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
buildDuration 14.2s 14s -231ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +2.72 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
/ failed reqs 0 0
/ total time (seconds) 2.456 2.389 -0.07
/ avg req/sec 1018.03 1046.43 +28.4
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.727 1.759 ⚠️ +0.03
/error-in-render avg req/sec 1448.01 1421.42 ⚠️ -26.59
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
677f882d2ed8..7edd.js gzip 13.4 kB 13.4 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 7.12 kB 7.12 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 60.2 kB 60.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/has-segments-dest 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/has-segments-dest Change
_app-8fbabfc..6440.js gzip 1.28 kB 1.28 kB
_error-af59f..582f.js gzip 3.46 kB 3.46 kB
amp-9716187d..0aa8.js gzip 536 B 536 B
hooks-107e90..74c7.js gzip 888 B 888 B
index-ac435c..ecf2.js gzip 227 B 227 B
link-c31053f..c329.js gzip 1.64 kB 1.64 kB
routerDirect..dc9d.js gzip 303 B 303 B
withRouter-6..0e02.js gzip 302 B 302 B
Overall change 8.64 kB 8.64 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
_buildManifest.js gzip 370 B 370 B
Overall change 370 B 370 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
index.html gzip 613 B 613 B
link.html gzip 621 B 621 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
buildDuration 16.3s 16s -291ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +2.72 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
677f882d2ed8..7edd.js gzip 13.4 kB 13.4 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 7.12 kB 7.12 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 60.2 kB 60.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/has-segments-dest 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/has-segments-dest Change
_app-8fbabfc..6440.js gzip 1.28 kB 1.28 kB
_error-af59f..582f.js gzip 3.46 kB 3.46 kB
amp-9716187d..0aa8.js gzip 536 B 536 B
hooks-107e90..74c7.js gzip 888 B 888 B
index-ac435c..ecf2.js gzip 227 B 227 B
link-c31053f..c329.js gzip 1.64 kB 1.64 kB
routerDirect..dc9d.js gzip 303 B 303 B
withRouter-6..0e02.js gzip 302 B 302 B
Overall change 8.64 kB 8.64 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
_buildManifest.js gzip 370 B 370 B
Overall change 370 B 370 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
_error.js 1.36 MB 1.36 MB ⚠️ +664 B
404.html 2.67 kB 2.67 kB
500.html 2.65 kB 2.65 kB
amp.amp.html 10.6 kB 10.6 kB
amp.html 1.86 kB 1.86 kB
hooks.html 1.92 kB 1.92 kB
index.js 1.36 MB 1.36 MB ⚠️ +664 B
link.js 1.42 MB 1.42 MB ⚠️ +664 B
routerDirect.js 1.41 MB 1.41 MB ⚠️ +664 B
withRouter.js 1.41 MB 1.41 MB ⚠️ +664 B
Overall change 6.99 MB 6.99 MB ⚠️ +3.32 kB

Webpack 5 Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
buildDuration 16.7s 16.8s ⚠️ +36ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +2.72 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
/ failed reqs 0 0
/ total time (seconds) 2.497 2.513 ⚠️ +0.02
/ avg req/sec 1001.4 994.89 ⚠️ -6.51
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.708 1.711 0
/error-in-render avg req/sec 1463.5 1461.2 ⚠️ -2.3
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
597-e27c5352..db8c.js gzip 13.3 kB 13.3 kB
778-84582755..aa9b.js gzip 7.05 kB 7.05 kB
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 151 B 151 B
webpack-HASH.js gzip 993 B 993 B
Overall change 60.8 kB 60.8 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/has-segments-dest 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/has-segments-dest Change
_app-5cc66b2..6f03.js gzip 1.3 kB 1.3 kB
_error-b58c1..9b8e.js gzip 3.4 kB 3.4 kB
amp-89a5460c..567f.js gzip 558 B 558 B
hooks-8c2e74..be37.js gzip 924 B 924 B
index-fec729..83b2.js gzip 243 B 243 B
link-dd34d9b..0ade.js gzip 1.66 kB 1.66 kB
routerDirect..5759.js gzip 336 B 336 B
withRouter-1..98bf.js gzip 334 B 334 B
Overall change 8.76 kB 8.76 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
_buildManifest.js gzip 349 B 349 B
Overall change 349 B 349 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/has-segments-dest Change
index.html gzip 610 B 610 B
link.html gzip 615 B 615 B
withRouter.html gzip 605 B 605 B
Overall change 1.83 kB 1.83 kB

Diffs

Diff for index.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/",
         "query": {},
-        "buildId": "ZROIYe5lGsZ--zmkxOd7h",
+        "buildId": "MhLBRuuzxC6R094IEkhmO",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/ZROIYe5lGsZ--zmkxOd7h/_buildManifest.js"
+      src="/_next/static/MhLBRuuzxC6R094IEkhmO/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/ZROIYe5lGsZ--zmkxOd7h/_ssgManifest.js"
+      src="/_next/static/MhLBRuuzxC6R094IEkhmO/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for link.html
@@ -48,7 +48,7 @@
         "props": { "pageProps": {} },
         "page": "/link",
         "query": {},
-        "buildId": "ZROIYe5lGsZ--zmkxOd7h",
+        "buildId": "MhLBRuuzxC6R094IEkhmO",
         "isFallback": false,
         "gip": true
       }
@@ -82,11 +82,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/ZROIYe5lGsZ--zmkxOd7h/_buildManifest.js"
+      src="/_next/static/MhLBRuuzxC6R094IEkhmO/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/ZROIYe5lGsZ--zmkxOd7h/_ssgManifest.js"
+      src="/_next/static/MhLBRuuzxC6R094IEkhmO/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for withRouter.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/withRouter",
         "query": {},
-        "buildId": "ZROIYe5lGsZ--zmkxOd7h",
+        "buildId": "MhLBRuuzxC6R094IEkhmO",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/ZROIYe5lGsZ--zmkxOd7h/_buildManifest.js"
+      src="/_next/static/MhLBRuuzxC6R094IEkhmO/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/ZROIYe5lGsZ--zmkxOd7h/_ssgManifest.js"
+      src="/_next/static/MhLBRuuzxC6R094IEkhmO/_ssgManifest.js"
       async=""
     ></script>
   </body>
Commit: 4305618

@kodiakhq kodiakhq bot merged commit 65c2216 into vercel:canary Apr 1, 2021
@ijjk ijjk deleted the fix/has-segments-dest branch April 2, 2021 02:55
kodiakhq bot pushed a commit that referenced this pull request Apr 13, 2021
This is a follow-up to #23588 to update to use a regex lexer to gather the named regex groups instead of attempting to gather them through executing the regex since it can fail to gather the regex groups when they are using specific matching. This also ensures we don't pass the value as a segment when value is defined and it doesn't use a capture group. Additional tests are added to cover these cases and documentation updated to reflect this. 

Closes: #23415

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

## Documentation / Examples

- [x] Make sure the linting passes
SokratisVidros pushed a commit to SokratisVidros/next.js that referenced this pull request Apr 20, 2021
This ensures we gather segments from the experimental has field when validating segments used in the destination to prevent the invalid segments in the destination error from showing incorrectly. This usage has been added to the custom-routes test suite to ensure the segments are passed correctly from the has field. 

Fixes: vercel#23415

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
SokratisVidros pushed a commit to SokratisVidros/next.js that referenced this pull request Apr 20, 2021
This is a follow-up to vercel#23588 to update to use a regex lexer to gather the named regex groups instead of attempting to gather them through executing the regex since it can fail to gather the regex groups when they are using specific matching. This also ensures we don't pass the value as a segment when value is defined and it doesn't use a capture group. Additional tests are added to cover these cases and documentation updated to reflect this. 

Closes: vercel#23415

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

## Documentation / Examples

- [x] Make sure the linting passes
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Apr 29, 2021
This ensures we gather segments from the experimental has field when validating segments used in the destination to prevent the invalid segments in the destination error from showing incorrectly. This usage has been added to the custom-routes test suite to ensure the segments are passed correctly from the has field. 

Fixes: vercel#23415

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

has field example seems wrong in next@canary
2 participants