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

Fix experimental optimizeCss for SSR #22513

Merged
merged 2 commits into from
Feb 25, 2021
Merged

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Feb 24, 2021

This ensures distDir is set under renderOpts in next-server so that it is present when experimental optimizeCss is enabled.

x-ref: #16539

@ijjk ijjk marked this pull request as ready for review February 24, 2021 23:39
@ijjk
Copy link
Member Author

ijjk commented Feb 24, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
buildDuration 11.9s 11.7s -241ms
nodeModulesSize 42.7 MB 42.7 MB ⚠️ +129 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
/ failed reqs 0 0
/ total time (seconds) 2.249 2.233 -0.02
/ avg req/sec 1111.46 1119.79 +8.33
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.553 1.589 ⚠️ +0.04
/error-in-render avg req/sec 1609.7 1573.04 ⚠️ -36.66
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
677f882d2ed8..e7a0.js gzip 13.4 kB 13.4 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.65 kB 6.65 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.7 kB 59.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css 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/ssr-optimize-css Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
amp-e3e9bc99..932c.js gzip 536 B 536 B
hooks-5023ef..3670.js gzip 888 B 888 B
index-3a2b03..c677.js gzip 227 B 227 B
link-177412b..043e.js gzip 1.67 kB 1.67 kB
routerDirect..1a66.js gzip 303 B 303 B
withRouter-9..1b7d.js gzip 302 B 302 B
Overall change 8.66 kB 8.66 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
_buildManifest.js gzip 347 B 347 B
Overall change 347 B 347 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
index.html gzip 613 B 613 B
link.html gzip 619 B 619 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
buildDuration 14s 14s -41ms
nodeModulesSize 42.7 MB 42.7 MB ⚠️ +129 B
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
677f882d2ed8..e7a0.js gzip 13.4 kB 13.4 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.65 kB 6.65 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.7 kB 59.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css 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/ssr-optimize-css Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
amp-e3e9bc99..932c.js gzip 536 B 536 B
hooks-5023ef..3670.js gzip 888 B 888 B
index-3a2b03..c677.js gzip 227 B 227 B
link-177412b..043e.js gzip 1.67 kB 1.67 kB
routerDirect..1a66.js gzip 303 B 303 B
withRouter-9..1b7d.js gzip 302 B 302 B
Overall change 8.66 kB 8.66 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
_buildManifest.js gzip 347 B 347 B
Overall change 347 B 347 B
Serverless bundles
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
_error.js 1.01 MB 1.01 MB
404.html 2.67 kB 2.67 kB
500.html 2.65 kB 2.65 kB
amp.amp.html 10.4 kB 10.4 kB
amp.html 1.86 kB 1.86 kB
hooks.html 1.92 kB 1.92 kB
index.js 1.01 MB 1.01 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.06 MB 1.06 MB
withRouter.js 1.06 MB 1.06 MB
Overall change 5.21 MB 5.21 MB

Webpack 5 Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
buildDuration 14s 15.3s ⚠️ +1.3s
nodeModulesSize 42.7 MB 42.7 MB ⚠️ +129 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
/ failed reqs 0 0
/ total time (seconds) 2.248 2.284 ⚠️ +0.04
/ avg req/sec 1112.06 1094.81 ⚠️ -17.25
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.566 1.62 ⚠️ +0.05
/error-in-render avg req/sec 1596.48 1543.07 ⚠️ -53.41
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
597-74632e79..1d47.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 6.59 kB 6.59 kB
webpack-HASH.js gzip 954 B 954 B
Overall change 60.1 kB 60.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css 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/ssr-optimize-css Change
_app-aedc815..1421.js gzip 1.26 kB 1.26 kB
_error-71ec2..1a96.js gzip 3.38 kB 3.38 kB
amp-33a09cb0..6745.js gzip 536 B 536 B
hooks-4e968a..f870.js gzip 902 B 902 B
index-5c6845..f75c.js gzip 230 B 230 B
link-99f0c6c..b84a.js gzip 1.65 kB 1.65 kB
routerDirect..bb56.js gzip 306 B 306 B
withRouter-7..2133.js gzip 302 B 302 B
Overall change 8.57 kB 8.57 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
_buildManifest.js gzip 326 B 326 B
Overall change 326 B 326 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
index.html gzip 587 B 587 B
link.html gzip 594 B 594 B
withRouter.html gzip 582 B 582 B
Overall change 1.76 kB 1.76 kB

Diffs

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

Copy link
Contributor

@janicklas-ralph janicklas-ralph 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
Copy link
Member Author

ijjk commented Feb 25, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
buildDuration 12.2s 12.4s ⚠️ +175ms
nodeModulesSize 42.7 MB 42.7 MB ⚠️ +129 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
/ failed reqs 0 0
/ total time (seconds) 2.293 2.292 0
/ avg req/sec 1090.04 1090.78 +0.74
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.582 1.592 ⚠️ +0.01
/error-in-render avg req/sec 1580.36 1570.8 ⚠️ -9.56
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
677f882d2ed8..e7a0.js gzip 13.4 kB 13.4 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.65 kB 6.65 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.7 kB 59.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css 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/ssr-optimize-css Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
amp-e3e9bc99..932c.js gzip 536 B 536 B
hooks-5023ef..3670.js gzip 888 B 888 B
index-3a2b03..c677.js gzip 227 B 227 B
link-177412b..043e.js gzip 1.67 kB 1.67 kB
routerDirect..1a66.js gzip 303 B 303 B
withRouter-9..1b7d.js gzip 302 B 302 B
Overall change 8.66 kB 8.66 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
_buildManifest.js gzip 347 B 347 B
Overall change 347 B 347 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
index.html gzip 613 B 613 B
link.html gzip 619 B 619 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
buildDuration 14.5s 14.4s -60ms
nodeModulesSize 42.7 MB 42.7 MB ⚠️ +129 B
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
677f882d2ed8..e7a0.js gzip 13.4 kB 13.4 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.65 kB 6.65 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.7 kB 59.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css 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/ssr-optimize-css Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
amp-e3e9bc99..932c.js gzip 536 B 536 B
hooks-5023ef..3670.js gzip 888 B 888 B
index-3a2b03..c677.js gzip 227 B 227 B
link-177412b..043e.js gzip 1.67 kB 1.67 kB
routerDirect..1a66.js gzip 303 B 303 B
withRouter-9..1b7d.js gzip 302 B 302 B
Overall change 8.66 kB 8.66 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
_buildManifest.js gzip 347 B 347 B
Overall change 347 B 347 B
Serverless bundles
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
_error.js 1.01 MB 1.01 MB
404.html 2.67 kB 2.67 kB
500.html 2.65 kB 2.65 kB
amp.amp.html 10.4 kB 10.4 kB
amp.html 1.86 kB 1.86 kB
hooks.html 1.92 kB 1.92 kB
index.js 1.01 MB 1.01 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.06 MB 1.06 MB
withRouter.js 1.06 MB 1.06 MB
Overall change 5.21 MB 5.21 MB

Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
buildDuration 14.7s 14.6s -94ms
nodeModulesSize 42.7 MB 42.7 MB ⚠️ +129 B
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
/ failed reqs 0 0
/ total time (seconds) 2.325 2.234 -0.09
/ avg req/sec 1075.32 1119.03 +43.71
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.652 1.566 -0.09
/error-in-render avg req/sec 1513.66 1596.45 +82.79
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
597-74632e79..1d47.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 6.59 kB 6.59 kB
webpack-HASH.js gzip 954 B 954 B
Overall change 60.1 kB 60.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css 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/ssr-optimize-css Change
_app-aedc815..1421.js gzip 1.26 kB 1.26 kB
_error-71ec2..1a96.js gzip 3.38 kB 3.38 kB
amp-33a09cb0..6745.js gzip 536 B 536 B
hooks-4e968a..f870.js gzip 902 B 902 B
index-5c6845..f75c.js gzip 230 B 230 B
link-99f0c6c..b84a.js gzip 1.65 kB 1.65 kB
routerDirect..bb56.js gzip 306 B 306 B
withRouter-7..2133.js gzip 302 B 302 B
Overall change 8.57 kB 8.57 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
_buildManifest.js gzip 326 B 326 B
Overall change 326 B 326 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/ssr-optimize-css Change
index.html gzip 587 B 587 B
link.html gzip 594 B 594 B
withRouter.html gzip 582 B 582 B
Overall change 1.76 kB 1.76 kB

Diffs

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

@kodiakhq kodiakhq bot merged commit 6d068ae into vercel:canary Feb 25, 2021
@ijjk ijjk deleted the fix/ssr-optimize-css branch February 25, 2021 14:26
@ijjk ijjk added the type: next label Mar 3, 2021
@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.

3 participants