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

Clean up RenderOptsPartial #23614

Merged
merged 6 commits into from
Apr 2, 2021
Merged

Clean up RenderOptsPartial #23614

merged 6 commits into from
Apr 2, 2021

Conversation

devknoll
Copy link
Contributor

@devknoll devknoll commented Apr 1, 2021

Cleans up some cases where RenderOptsPartial was being used to output a result:

  • Removes isAmpMode and hybridAmp: this was used as output for next export. These values are now derived manually.
  • Removes autoExport: this was used as output in __NEXT_DATA__. I just moved it there instead.

There are still more cases to clean up, but this is a good start.

The goal here is to move closer to a spot where we have all of the output (html, data, err, ...) as return values, instead of mutating input.

@ijjk
Copy link
Member

ijjk commented Apr 1, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
buildDuration 12s 11.7s -277ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +1.59 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
/ failed reqs 0 0
/ total time (seconds) 1.955 2.015 ⚠️ +0.06
/ avg req/sec 1279 1240.76 ⚠️ -38.24
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.201 1.287 ⚠️ +0.09
/error-in-render avg req/sec 2081.01 1942.56 ⚠️ -138.45
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts Change
_buildManifest.js gzip 370 B 370 B
Overall change 370 B 370 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js remove-unused-opts 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 (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
buildDuration 14.4s 13.6s -795ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +1.59 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts Change
_buildManifest.js gzip 370 B 370 B
Overall change 370 B 370 B
Serverless bundles Overall decrease ✓
vercel/next.js canary azukaru/next.js remove-unused-opts Change
_error.js 1.36 MB 1.36 MB -48 B
404.html 2.67 kB 2.67 kB
500.html 2.65 kB 2.65 kB
amp.amp.html 10.7 kB 10.7 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 -48 B
link.js 1.42 MB 1.42 MB -48 B
routerDirect.js 1.41 MB 1.41 MB -48 B
withRouter.js 1.41 MB 1.41 MB -48 B
Overall change 6.99 MB 6.99 MB -240 B

Webpack 5 Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
buildDuration 14.4s 14.1s -288ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +1.59 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
/ failed reqs 0 0
/ total time (seconds) 2.08 2.025 -0.06
/ avg req/sec 1201.78 1234.29 +32.51
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.258 1.289 ⚠️ +0.03
/error-in-render avg req/sec 1988.02 1939.41 ⚠️ -48.61
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts Change
_buildManifest.js gzip 349 B 349 B
Overall change 349 B 349 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js remove-unused-opts 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": "f_5OSdddKA9aj3MTUmoZA",
+        "buildId": "f-UVRinF9FhDWGblZouCQ",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/f_5OSdddKA9aj3MTUmoZA/_buildManifest.js"
+      src="/_next/static/f-UVRinF9FhDWGblZouCQ/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/f_5OSdddKA9aj3MTUmoZA/_ssgManifest.js"
+      src="/_next/static/f-UVRinF9FhDWGblZouCQ/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for link.html
@@ -48,7 +48,7 @@
         "props": { "pageProps": {} },
         "page": "/link",
         "query": {},
-        "buildId": "f_5OSdddKA9aj3MTUmoZA",
+        "buildId": "f-UVRinF9FhDWGblZouCQ",
         "isFallback": false,
         "gip": true
       }
@@ -82,11 +82,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/f_5OSdddKA9aj3MTUmoZA/_buildManifest.js"
+      src="/_next/static/f-UVRinF9FhDWGblZouCQ/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/f_5OSdddKA9aj3MTUmoZA/_ssgManifest.js"
+      src="/_next/static/f-UVRinF9FhDWGblZouCQ/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for withRouter.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/withRouter",
         "query": {},
-        "buildId": "f_5OSdddKA9aj3MTUmoZA",
+        "buildId": "f-UVRinF9FhDWGblZouCQ",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/f_5OSdddKA9aj3MTUmoZA/_buildManifest.js"
+      src="/_next/static/f-UVRinF9FhDWGblZouCQ/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/f_5OSdddKA9aj3MTUmoZA/_ssgManifest.js"
+      src="/_next/static/f-UVRinF9FhDWGblZouCQ/_ssgManifest.js"
       async=""
     ></script>
   </body>
Commit: 9653a7a

@ijjk
Copy link
Member

ijjk commented Apr 1, 2021

@devknoll it looks like you'll need to update this PR manually before merge as kodiak/us don't have permission to update it

@ijjk
Copy link
Member

ijjk commented Apr 1, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
buildDuration 12s 12.2s ⚠️ +244ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +1.59 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
/ failed reqs 0 0
/ total time (seconds) 2.05 2.113 ⚠️ +0.06
/ avg req/sec 1219.66 1183.16 ⚠️ -36.5
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.254 1.351 ⚠️ +0.1
/error-in-render avg req/sec 1993.39 1850.73 ⚠️ -142.66
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts Change
_buildManifest.js gzip 370 B 370 B
Overall change 370 B 370 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js remove-unused-opts Change
index.html gzip 612 B 612 B
link.html gzip 620 B 620 B
withRouter.html gzip 607 B 607 B
Overall change 1.84 kB 1.84 kB

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
buildDuration 14.1s 14s -67ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +1.59 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts Change
_buildManifest.js gzip 370 B 370 B
Overall change 370 B 370 B
Serverless bundles Overall decrease ✓
vercel/next.js canary azukaru/next.js remove-unused-opts Change
_error.js 1.36 MB 1.36 MB -48 B
404.html 2.67 kB 2.67 kB
500.html 2.65 kB 2.65 kB
amp.amp.html 10.7 kB 10.7 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 -48 B
link.js 1.42 MB 1.42 MB -48 B
routerDirect.js 1.41 MB 1.41 MB -48 B
withRouter.js 1.41 MB 1.41 MB -48 B
Overall change 6.99 MB 6.99 MB -240 B

Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js remove-unused-opts Change
buildDuration 14.1s 14.2s ⚠️ +22ms
nodeModulesSize 45.9 MB 45.9 MB ⚠️ +1.59 kB
Page Load Tests Overall increase ✓
vercel/next.js canary azukaru/next.js remove-unused-opts Change
/ failed reqs 0 0
/ total time (seconds) 2.112 2.079 -0.03
/ avg req/sec 1183.65 1202.64 +18.99
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.291 1.274 -0.02
/error-in-render avg req/sec 1936.56 1962.81 +26.25
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js remove-unused-opts Change
597-e27c5352..db8c.js gzip 13.3 kB 13.3 kB
778-c0be2426..e455.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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts 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 azukaru/next.js remove-unused-opts Change
_buildManifest.js gzip 349 B 349 B
Overall change 349 B 349 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js remove-unused-opts Change
index.html gzip 609 B 609 B
link.html gzip 614 B 614 B
withRouter.html gzip 604 B 604 B
Overall change 1.83 kB 1.83 kB

Diffs

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

@ijjk ijjk merged commit af3315b into vercel:canary Apr 2, 2021
kodiakhq bot pushed a commit that referenced this pull request Apr 5, 2021
Follow up to #23614. `resolvedAsPath` isn't actually even being used as an output, we're just mutating it for convenience. If we do want to output it in the future, we can do it a different way (i.e. via return).
SokratisVidros pushed a commit to SokratisVidros/next.js that referenced this pull request Apr 20, 2021
* Remove autoExport from RenderOpts

* Remove ampMode from RenderOpts

* Stop passing inAmpMode and hybridAmp

* Unset nextExport when falsy
SokratisVidros pushed a commit to SokratisVidros/next.js that referenced this pull request Apr 20, 2021
Follow up to vercel#23614. `resolvedAsPath` isn't actually even being used as an output, we're just mutating it for convenience. If we do want to output it in the future, we can do it a different way (i.e. via return).
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Apr 29, 2021
* Remove autoExport from RenderOpts

* Remove ampMode from RenderOpts

* Stop passing inAmpMode and hybridAmp

* Unset nextExport when falsy
@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.

2 participants