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

Add nccing AMP optimizer #21980

Merged
merged 8 commits into from
Feb 11, 2021
Merged

Add nccing AMP optimizer #21980

merged 8 commits into from
Feb 11, 2021

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Feb 8, 2021

This adds ncc'ing the AMP optimizer package to speed up install times and cache the runtime.

Closes: #20404

@ijjk ijjk added the type: next label Feb 8, 2021
@ijjk

This comment has been minimized.

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

ijjk commented Feb 10, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
buildDuration 11.9s 12s ⚠️ +39ms
nodeModulesSize 75.4 MB 69.8 MB -5.56 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
/ failed reqs 0 0
/ total time (seconds) 2.26 2.374 ⚠️ +0.11
/ avg req/sec 1106.08 1053.16 ⚠️ -52.92
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.547 1.678 ⚠️ +0.13
/error-in-render avg req/sec 1616.21 1489.79 ⚠️ -126.42
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
677f882d2ed8..49c4.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.5 kB 59.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js inline/amp-runtime 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 inline/amp-runtime 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-f8ee040..45b1.js gzip 1.64 kB 1.64 kB
routerDirect..1a66.js gzip 303 B 303 B
withRouter-9..1b7d.js gzip 302 B 302 B
Overall change 8.63 kB 8.63 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
_buildManifest.js gzip 347 B 347 B
Overall change 347 B 347 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
index.html gzip 614 B 614 B
link.html gzip 620 B 620 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
buildDuration 13.9s 14.4s ⚠️ +507ms
nodeModulesSize 75.4 MB 69.8 MB -5.56 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
677f882d2ed8..49c4.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.5 kB 59.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js inline/amp-runtime 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 inline/amp-runtime 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-f8ee040..45b1.js gzip 1.64 kB 1.64 kB
routerDirect..1a66.js gzip 303 B 303 B
withRouter-9..1b7d.js gzip 302 B 302 B
Overall change 8.63 kB 8.63 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
_buildManifest.js gzip 347 B 347 B
Overall change 347 B 347 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
_error.js 1 MB 1 MB ⚠️ +19 B
404.html 2.67 kB 2.67 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 ⚠️ +19 B
link.js 1.06 MB 1.06 MB ⚠️ +19 B
routerDirect.js 1.06 MB 1.06 MB ⚠️ +19 B
withRouter.js 1.06 MB 1.06 MB ⚠️ +19 B
Overall change 5.2 MB 5.2 MB ⚠️ +95 B

Webpack 5 Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
buildDuration 15s 13.7s -1.3s
nodeModulesSize 75.4 MB 69.8 MB -5.56 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
/ failed reqs 0 0
/ total time (seconds) 2.236 2.222 -0.01
/ avg req/sec 1118.19 1125.1 +6.91
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.57 1.547 -0.02
/error-in-render avg req/sec 1592.17 1616.23 +24.06
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
597-6c246419..806f.js gzip 13 kB 13 kB
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 6.58 kB 6.58 kB
webpack-HASH.js gzip 954 B 954 B
Overall change 59.9 kB 59.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js inline/amp-runtime 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 inline/amp-runtime Change
_app-6e0a903..b885.js gzip 1.26 kB 1.26 kB
_error-9e190..f9d6.js gzip 3.38 kB 3.38 kB
amp-7fd79cc4..99ee.js gzip 538 B 538 B
hooks-f7e199..11b9.js gzip 904 B 904 B
index-3dc22c..ffbb.js gzip 232 B 232 B
link-89095fe..14f1.js gzip 1.62 kB 1.62 kB
routerDirect..323a.js gzip 308 B 308 B
withRouter-a..2ef8.js gzip 304 B 304 B
Overall change 8.55 kB 8.55 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
index.html gzip 586 B 586 B
link.html gzip 592 B 592 B
withRouter.html gzip 579 B 579 B
Overall change 1.76 kB 1.76 kB

Diffs

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

@ijjk
Copy link
Member Author

ijjk commented Feb 11, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
buildDuration 8.3s 9.1s ⚠️ +770ms
nodeModulesSize 75.4 MB 69.8 MB -5.56 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
/ failed reqs 0 0
/ total time (seconds) 1.607 1.698 ⚠️ +0.09
/ avg req/sec 1555.24 1472.59 ⚠️ -82.65
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.002 1.069 ⚠️ +0.07
/error-in-render avg req/sec 2493.86 2337.63 ⚠️ -156.23
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
677f882d2ed8..49c4.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.5 kB 59.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js inline/amp-runtime 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 inline/amp-runtime 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-f8ee040..45b1.js gzip 1.64 kB 1.64 kB
routerDirect..1a66.js gzip 303 B 303 B
withRouter-9..1b7d.js gzip 302 B 302 B
Overall change 8.63 kB 8.63 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
_buildManifest.js gzip 347 B 347 B
Overall change 347 B 347 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
index.html gzip 614 B 614 B
link.html gzip 620 B 620 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
buildDuration 10s 10.8s ⚠️ +764ms
nodeModulesSize 75.4 MB 69.8 MB -5.56 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
677f882d2ed8..49c4.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.5 kB 59.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js inline/amp-runtime 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 inline/amp-runtime 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-f8ee040..45b1.js gzip 1.64 kB 1.64 kB
routerDirect..1a66.js gzip 303 B 303 B
withRouter-9..1b7d.js gzip 302 B 302 B
Overall change 8.63 kB 8.63 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
_buildManifest.js gzip 347 B 347 B
Overall change 347 B 347 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
_error.js 1 MB 1 MB ⚠️ +19 B
404.html 2.67 kB 2.67 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 ⚠️ +19 B
link.js 1.06 MB 1.06 MB ⚠️ +19 B
routerDirect.js 1.06 MB 1.06 MB ⚠️ +19 B
withRouter.js 1.06 MB 1.06 MB ⚠️ +19 B
Overall change 5.2 MB 5.2 MB ⚠️ +95 B

Webpack 5 Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
buildDuration 10.3s 10.2s -33ms
nodeModulesSize 75.4 MB 69.8 MB -5.56 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
/ failed reqs 0 0
/ total time (seconds) 1.564 1.707 ⚠️ +0.14
/ avg req/sec 1598.87 1464.27 ⚠️ -134.6
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 0.985 1.082 ⚠️ +0.1
/error-in-render avg req/sec 2538 2309.69 ⚠️ -228.31
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
597-6c246419..806f.js gzip 13 kB 13 kB
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 6.58 kB 6.58 kB
webpack-HASH.js gzip 954 B 954 B
Overall change 59.9 kB 59.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js inline/amp-runtime 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 inline/amp-runtime Change
_app-6e0a903..b885.js gzip 1.26 kB 1.26 kB
_error-9e190..f9d6.js gzip 3.38 kB 3.38 kB
amp-7fd79cc4..99ee.js gzip 538 B 538 B
hooks-f7e199..11b9.js gzip 904 B 904 B
index-3dc22c..ffbb.js gzip 232 B 232 B
link-89095fe..14f1.js gzip 1.62 kB 1.62 kB
routerDirect..323a.js gzip 308 B 308 B
withRouter-a..2ef8.js gzip 304 B 304 B
Overall change 8.55 kB 8.55 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js inline/amp-runtime Change
index.html gzip 586 B 586 B
link.html gzip 592 B 592 B
withRouter.html gzip 579 B 579 B
Overall change 1.76 kB 1.76 kB

Diffs

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

@hedytang
Copy link

hedytang commented Mar 3, 2021

Heyy,,have a silly question...I'm trying to understand why the optimizer is moved into dev dependency..would like to know what NCC stands for and what it means...Thanks!

@Herra47juu

This comment has been minimized.

@ijjk
Copy link
Member Author

ijjk commented Mar 3, 2021

@hedytang It's moved into a devDependency since it's no longer installed via npm separately each time you install Next.js since it's bundled with Next.js now. You can read more on what ncc is here https://github.com/vercel/ncc#readme

This was referenced Jan 18, 2022
@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.

AMP OPTIMIZER Failed downloading latest AMP runtime data. Proxies need to be configured manually
4 participants