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

Drop the unstable web vital hook and remove exports of flush effects #36912

Merged
merged 5 commits into from May 14, 2022

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented May 14, 2022

  • remove the experimental web vital hook api
  • remove the exported flush effects api and only error on development, keep only usage to styled-jsx

for web vital hook API: The usage is not widly adopted since the existing exported vital api could do the same work. In the future we'll deprecate the _app.server in favor of _app in server component pages. so that this api won't be required.

for flush effects api: other css-in-js libs are not using the same approach like styled-jsx which holding a style registry and could flush it during streaming. emotion-js and styled-components are still relying on Document.getInitialProps atm and we have supported it in latest canary

@ijjk
Copy link
Member

ijjk commented May 14, 2022

Failing test suites

Commit: 756f90b

yarn testheadless test/integration/relay-analytics-disabled/test/index.test.js

  • Analytics relayer (disabled) > Does not relay any data
  • Analytics relayer (disabled) > Does not include the code
Expand output

● Analytics relayer (disabled) › Does not relay any data

Cannot find module '/home/runner/work/next.js/next.js/test/integration/relay-analytics-disabled/.next/build-manifest.json' from 'integration/relay-analytics-disabled/test/index.test.js'

  19 |       stdout: true,
  20 |     }))
> 21 |     buildManifest = require(path.join(
     |                     ^
  22 |       appDir,
  23 |       '.next/build-manifest.json'
  24 |     ), 'utf8')

  at Resolver.resolveModule (../node_modules/jest-resolve/build/resolver.js:311:11)
  at integration/relay-analytics-disabled/test/index.test.js:21:21

● Analytics relayer (disabled) › Does not include the code

Cannot find module '/home/runner/work/next.js/next.js/test/integration/relay-analytics-disabled/.next/build-manifest.json' from 'integration/relay-analytics-disabled/test/index.test.js'

  19 |       stdout: true,
  20 |     }))
> 21 |     buildManifest = require(path.join(
     |                     ^
  22 |       appDir,
  23 |       '.next/build-manifest.json'
  24 |     ), 'utf8')

  at Resolver.resolveModule (../node_modules/jest-resolve/build/resolver.js:311:11)
  at integration/relay-analytics-disabled/test/index.test.js:21:21

● Test suite failed to run

TypeError: Cannot read properties of undefined (reading 'pid')

  403 | // Kill a launched app
  404 | export async function killApp(instance) {
> 405 |   await killProcess(instance.pid)
      |                              ^
  406 | }
  407 |
  408 | export async function startApp(app) {

  at Object.killApp (lib/next-test-utils.js:405:30)
  at integration/relay-analytics-disabled/test/index.test.js:27:33

Read more about building and testing Next.js in contributing.md.

@huozhi huozhi marked this pull request as ready for review May 14, 2022 13:48
@ijjk
Copy link
Member

ijjk commented May 14, 2022

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
buildDuration 21.6s 21.7s ⚠️ +128ms
buildDurationCached 8.5s 8.5s ⚠️ +13ms
nodeModulesSize 475 MB 475 MB -11.6 kB
Page Load Tests Overall increase ✓
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
/ failed reqs 0 0
/ total time (seconds) 5.785 5.882 ⚠️ +0.1
/ avg req/sec 432.12 424.99 ⚠️ -7.13
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 2.243 2.137 -0.11
/error-in-render avg req/sec 1114.75 1169.75 +55
Client Bundles (main, webpack) Overall decrease ✓
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
925.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 28.8 kB 28.6 kB -202 B
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 72.5 kB 72.3 kB -202 B
Legacy Client Bundles (polyfills)
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
_app-HASH.js gzip 1.36 kB 1.36 kB
_error-HASH.js gzip 193 B 193 B
amp-HASH.js gzip 308 B 308 B
css-HASH.js gzip 327 B 327 B
dynamic-HASH.js gzip 2.7 kB 2.7 kB
head-HASH.js gzip 359 B 359 B
hooks-HASH.js gzip 920 B 920 B
image-HASH.js gzip 5.71 kB 5.71 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.65 kB 2.65 kB
routerDirect..HASH.js gzip 320 B 320 B
script-HASH.js gzip 391 B 391 B
withRouter-HASH.js gzip 318 B 318 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 15.9 kB 15.9 kB
Client Build Manifests
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
_buildManifest.js gzip 458 B 458 B
Overall change 458 B 458 B
Rendered Page Sizes
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
index.html gzip 532 B 532 B
link.html gzip 544 B 544 B
withRouter.html gzip 527 B 527 B
Overall change 1.6 kB 1.6 kB

Diffs

Diff for main-HASH.js
@@ -478,7 +478,6 @@
       var _routeAnnouncer = __webpack_require__(8483);
       var _router1 = __webpack_require__(880);
       var _isError = __webpack_require__(676);
-      var _vitals = __webpack_require__(7185);
       var _refresh = __webpack_require__(2129);
       var _imageConfigContext = __webpack_require__(8730);
       function asyncGeneratorStep(
@@ -848,7 +847,6 @@
               appEntrypoint,
               app,
               mod,
-              exportedReportWebVitals,
               pageEntrypoint,
               isValidElementType,
               getNodeError,
@@ -873,73 +871,70 @@
                       (app = appEntrypoint.component),
                         (mod = appEntrypoint.exports);
                       CachedApp = app;
-                      exportedReportWebVitals = mod && mod.reportWebVitals;
-                      onPerfEntry = function(param) {
-                        var id = param.id,
-                          name = param.name,
-                          startTime = param.startTime,
-                          value = param.value,
-                          duration = param.duration,
-                          entryType = param.entryType,
-                          entries = param.entries;
-                        // Combines timestamp with random number for unique ID
-                        var uniqueID = ""
-                          .concat(Date.now(), "-")
-                          .concat(
-                            Math.floor(Math.random() * (9000000000000 - 1)) +
-                              1000000000000
-                          );
-                        var perfStartEntry;
-                        if (entries && entries.length) {
-                          perfStartEntry = entries[0].startTime;
-                        }
-                        var webVitals = {
-                          id: id || uniqueID,
-                          name: name,
-                          startTime: startTime || perfStartEntry,
-                          value: value == null ? duration : value,
-                          label:
-                            entryType === "mark" || entryType === "measure"
-                              ? "custom"
-                              : "web-vital"
+                      if (mod && mod.reportWebVitals) {
+                        onPerfEntry = function(param) {
+                          var id = param.id,
+                            name = param.name,
+                            startTime = param.startTime,
+                            value = param.value,
+                            duration = param.duration,
+                            entryType = param.entryType,
+                            entries = param.entries;
+                          // Combines timestamp with random number for unique ID
+                          var uniqueID = ""
+                            .concat(Date.now(), "-")
+                            .concat(
+                              Math.floor(Math.random() * (9000000000000 - 1)) +
+                                1000000000000
+                            );
+                          var perfStartEntry;
+                          if (entries && entries.length) {
+                            perfStartEntry = entries[0].startTime;
+                          }
+                          var webVitals = {
+                            id: id || uniqueID,
+                            name: name,
+                            startTime: startTime || perfStartEntry,
+                            value: value == null ? duration : value,
+                            label:
+                              entryType === "mark" || entryType === "measure"
+                                ? "custom"
+                                : "web-vital"
+                          };
+                          mod.reportWebVitals(webVitals);
                         };
-                        exportedReportWebVitals === null ||
-                        exportedReportWebVitals === void 0
-                          ? void 0
-                          : exportedReportWebVitals(webVitals);
-                        (0, _vitals).trackWebVitalMetric(webVitals);
-                      };
+                      }
                       if (
                         // error, so we need to skip waiting for the entrypoint.
                         true
                       ) {
-                        _ctx.next = 15;
+                        _ctx.next = 14;
                         break;
                       }
                       _ctx.t0 = {
                         error: initialData.err
                       };
-                      _ctx.next = 18;
-                      break;
-                    case 15:
                       _ctx.next = 17;
+                      break;
+                    case 14:
+                      _ctx.next = 16;
                       return pageLoader.routeLoader.whenEntrypoint(
                         initialData.page
                       );
-                    case 17:
+                    case 16:
                       _ctx.t0 = _ctx.sent;
-                    case 18:
+                    case 17:
                       pageEntrypoint = _ctx.t0;
                       if (!("error" in pageEntrypoint)) {
-                        _ctx.next = 21;
+                        _ctx.next = 20;
                         break;
                       }
                       throw pageEntrypoint.error;
-                    case 21:
+                    case 20:
                       CachedComponent = pageEntrypoint.component;
                       isRSCPage = !!pageEntrypoint.exports.__next_rsc__;
                       if (true) {
-                        _ctx.next = 27;
+                        _ctx.next = 26;
                         break;
                       }
                       isValidElementType = Object(
@@ -952,7 +947,7 @@
                         })()
                       );
                       if (isValidElementType(CachedComponent)) {
-                        _ctx.next = 27;
+                        _ctx.next = 26;
                         break;
                       }
                       throw new Error(
@@ -961,24 +956,24 @@
                           '"'
                         )
                       );
-                    case 27:
-                      _ctx.next = 32;
+                    case 26:
+                      _ctx.next = 31;
                       break;
-                    case 29:
-                      _ctx.prev = 29;
+                    case 28:
+                      _ctx.prev = 28;
                       _ctx.t1 = _ctx["catch"](1);
                       // This catches errors like throwing in the top level of a module
                       initialErr = (0, _isError).getProperError(_ctx.t1);
-                    case 32:
+                    case 31:
                       if (false) {
                       }
                       if (!window.__NEXT_PRELOADREADY) {
-                        _ctx.next = 36;
+                        _ctx.next = 35;
                         break;
                       }
-                      _ctx.next = 36;
+                      _ctx.next = 35;
                       return window.__NEXT_PRELOADREADY(initialData.dynamicIds);
-                    case 36:
+                    case 35:
                       exports.router = router = (0, _router1).createRouter(
                         initialData.page,
                         initialData.query,
@@ -1019,21 +1014,21 @@
                           ? void 0
                           : opts.beforeRender)
                       ) {
-                        _ctx.next = 41;
+                        _ctx.next = 40;
                         break;
                       }
-                      _ctx.next = 41;
+                      _ctx.next = 40;
                       return opts.beforeRender();
-                    case 41:
+                    case 40:
                       render(renderCtx);
-                    case 42:
+                    case 41:
                     case "end":
                       return _ctx.stop();
                   }
               },
               _callee,
               null,
-              [[1, 29]]
+              [[1, 28]]
             );
           })
         );
@@ -1516,7 +1511,6 @@
         // don't cause any hydration delay:
         _react.default.useEffect(function() {
           (0, _performanceRelayer).default(onPerfEntry);
-          (0, _vitals).flushBufferedVitalsMetrics();
         }, []);
         if (false) {
         }
@@ -3330,71 +3324,6 @@
       /***/
     },
 
-    /***/ 7185: /***/ function(module, exports, __webpack_require__) {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true
-      });
-      exports.getBufferedVitalsMetrics = getBufferedVitalsMetrics;
-      exports.flushBufferedVitalsMetrics = flushBufferedVitalsMetrics;
-      exports.trackWebVitalMetric = trackWebVitalMetric;
-      exports.useWebVitalsReport = useWebVitalsReport;
-      exports.webVitalsCallbacks = void 0;
-      var _react = __webpack_require__(7294);
-      var webVitalsCallbacks = new Set();
-      exports.webVitalsCallbacks = webVitalsCallbacks;
-      var flushed = false;
-      var metrics = [];
-      function getBufferedVitalsMetrics() {
-        return metrics;
-      }
-      function flushBufferedVitalsMetrics() {
-        flushed = true;
-        metrics.length = 0;
-      }
-      function trackWebVitalMetric(metric) {
-        metrics.push(metric);
-        webVitalsCallbacks.forEach(function(callback) {
-          return callback(metric);
-        });
-      }
-      function useWebVitalsReport(callback) {
-        var metricIndexRef = (0, _react).useRef(0);
-        if (false) {
-        }
-        (0, _react).useEffect(
-          function() {
-            // Flush calculated metrics
-            var reportMetric = function(metric) {
-              callback(metric);
-              metricIndexRef.current = metrics.length;
-            };
-            for (var i = metricIndexRef.current; i < metrics.length; i++) {
-              reportMetric(metrics[i]);
-            }
-            webVitalsCallbacks.add(reportMetric);
-            return function() {
-              webVitalsCallbacks.delete(reportMetric);
-            };
-          },
-          [callback]
-        );
-      }
-      if (
-        typeof exports.default === "function" ||
-        (typeof exports.default === "object" && exports.default !== null)
-      ) {
-        Object.defineProperty(exports.default, "__esModule", {
-          value: true
-        });
-        Object.assign(exports.default, exports);
-        module.exports = exports.default;
-      } //# sourceMappingURL=vitals.js.map
-
-      /***/
-    },
-
     /***/ 5407: /***/ function(module, exports) {
       "use strict";
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-48f45c4cae8866c7.js"
+      src="/_next/static/chunks/main-6da128ecb4ea3638.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-48f45c4cae8866c7.js"
+      src="/_next/static/chunks/main-6da128ecb4ea3638.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-48f45c4cae8866c7.js"
+      src="/_next/static/chunks/main-6da128ecb4ea3638.js"
       defer=""
     ></script>
     <script

Default Build with SWC (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
buildDuration 24.4s 24.2s -178ms
buildDurationCached 8.6s 8.4s -131ms
nodeModulesSize 475 MB 475 MB -11.6 kB
Page Load Tests Overall increase ✓
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
/ failed reqs 0 0
/ total time (seconds) 5.874 5.727 -0.15
/ avg req/sec 425.59 436.51 +10.92
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 2.324 2.136 -0.19
/error-in-render avg req/sec 1075.52 1170.47 +94.95
Client Bundles (main, webpack) Overall decrease ✓
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
925.HASH.js gzip 178 B 178 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 29.3 kB 29.1 kB -200 B
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 73.2 kB 73 kB -200 B
Legacy Client Bundles (polyfills)
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 179 B 179 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 324 B 324 B
dynamic-HASH.js gzip 2.72 kB 2.72 kB
head-HASH.js gzip 357 B 357 B
hooks-HASH.js gzip 921 B 921 B
image-HASH.js gzip 5.8 kB 5.8 kB
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 2.77 kB 2.77 kB
routerDirect..HASH.js gzip 322 B 322 B
script-HASH.js gzip 392 B 392 B
withRouter-HASH.js gzip 317 B 317 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 16.1 kB 16.1 kB
Client Build Manifests
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
_buildManifest.js gzip 458 B 458 B
Overall change 458 B 458 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary huozhi/next.js drop-unstable-streaming-apis Change
index.html gzip 527 B 528 B ⚠️ +1 B
link.html gzip 542 B 543 B ⚠️ +1 B
withRouter.html gzip 524 B 525 B ⚠️ +1 B
Overall change 1.59 kB 1.6 kB ⚠️ +3 B

Diffs

Diff for main-HASH.js
@@ -478,7 +478,6 @@
       var _routeAnnouncer = __webpack_require__(8483);
       var _router1 = __webpack_require__(880);
       var _isError = __webpack_require__(676);
-      var _vitals = __webpack_require__(7185);
       var _refresh = __webpack_require__(2129);
       var _imageConfigContext = __webpack_require__(8730);
       function asyncGeneratorStep(
@@ -848,7 +847,6 @@
               appEntrypoint,
               app,
               mod,
-              exportedReportWebVitals,
               pageEntrypoint,
               isValidElementType,
               getNodeError,
@@ -873,73 +871,70 @@
                       (app = appEntrypoint.component),
                         (mod = appEntrypoint.exports);
                       CachedApp = app;
-                      exportedReportWebVitals = mod && mod.reportWebVitals;
-                      onPerfEntry = function(param) {
-                        var id = param.id,
-                          name = param.name,
-                          startTime = param.startTime,
-                          value = param.value,
-                          duration = param.duration,
-                          entryType = param.entryType,
-                          entries = param.entries;
-                        // Combines timestamp with random number for unique ID
-                        var uniqueID = ""
-                          .concat(Date.now(), "-")
-                          .concat(
-                            Math.floor(Math.random() * (9000000000000 - 1)) +
-                              1000000000000
-                          );
-                        var perfStartEntry;
-                        if (entries && entries.length) {
-                          perfStartEntry = entries[0].startTime;
-                        }
-                        var webVitals = {
-                          id: id || uniqueID,
-                          name: name,
-                          startTime: startTime || perfStartEntry,
-                          value: value == null ? duration : value,
-                          label:
-                            entryType === "mark" || entryType === "measure"
-                              ? "custom"
-                              : "web-vital"
+                      if (mod && mod.reportWebVitals) {
+                        onPerfEntry = function(param) {
+                          var id = param.id,
+                            name = param.name,
+                            startTime = param.startTime,
+                            value = param.value,
+                            duration = param.duration,
+                            entryType = param.entryType,
+                            entries = param.entries;
+                          // Combines timestamp with random number for unique ID
+                          var uniqueID = ""
+                            .concat(Date.now(), "-")
+                            .concat(
+                              Math.floor(Math.random() * (9000000000000 - 1)) +
+                                1000000000000
+                            );
+                          var perfStartEntry;
+                          if (entries && entries.length) {
+                            perfStartEntry = entries[0].startTime;
+                          }
+                          var webVitals = {
+                            id: id || uniqueID,
+                            name: name,
+                            startTime: startTime || perfStartEntry,
+                            value: value == null ? duration : value,
+                            label:
+                              entryType === "mark" || entryType === "measure"
+                                ? "custom"
+                                : "web-vital"
+                          };
+                          mod.reportWebVitals(webVitals);
                         };
-                        exportedReportWebVitals === null ||
-                        exportedReportWebVitals === void 0
-                          ? void 0
-                          : exportedReportWebVitals(webVitals);
-                        (0, _vitals).trackWebVitalMetric(webVitals);
-                      };
+                      }
                       if (
                         // error, so we need to skip waiting for the entrypoint.
                         true
                       ) {
-                        _ctx.next = 15;
+                        _ctx.next = 14;
                         break;
                       }
                       _ctx.t0 = {
                         error: initialData.err
                       };
-                      _ctx.next = 18;
-                      break;
-                    case 15:
                       _ctx.next = 17;
+                      break;
+                    case 14:
+                      _ctx.next = 16;
                       return pageLoader.routeLoader.whenEntrypoint(
                         initialData.page
                       );
-                    case 17:
+                    case 16:
                       _ctx.t0 = _ctx.sent;
-                    case 18:
+                    case 17:
                       pageEntrypoint = _ctx.t0;
                       if (!("error" in pageEntrypoint)) {
-                        _ctx.next = 21;
+                        _ctx.next = 20;
                         break;
                       }
                       throw pageEntrypoint.error;
-                    case 21:
+                    case 20:
                       CachedComponent = pageEntrypoint.component;
                       isRSCPage = !!pageEntrypoint.exports.__next_rsc__;
                       if (true) {
-                        _ctx.next = 27;
+                        _ctx.next = 26;
                         break;
                       }
                       isValidElementType = Object(
@@ -952,7 +947,7 @@
                         })()
                       );
                       if (isValidElementType(CachedComponent)) {
-                        _ctx.next = 27;
+                        _ctx.next = 26;
                         break;
                       }
                       throw new Error(
@@ -961,24 +956,24 @@
                           '"'
                         )
                       );
-                    case 27:
-                      _ctx.next = 32;
+                    case 26:
+                      _ctx.next = 31;
                       break;
-                    case 29:
-                      _ctx.prev = 29;
+                    case 28:
+                      _ctx.prev = 28;
                       _ctx.t1 = _ctx["catch"](1);
                       // This catches errors like throwing in the top level of a module
                       initialErr = (0, _isError).getProperError(_ctx.t1);
-                    case 32:
+                    case 31:
                       if (false) {
                       }
                       if (!window.__NEXT_PRELOADREADY) {
-                        _ctx.next = 36;
+                        _ctx.next = 35;
                         break;
                       }
-                      _ctx.next = 36;
+                      _ctx.next = 35;
                       return window.__NEXT_PRELOADREADY(initialData.dynamicIds);
-                    case 36:
+                    case 35:
                       exports.router = router = (0, _router1).createRouter(
                         initialData.page,
                         initialData.query,
@@ -1019,21 +1014,21 @@
                           ? void 0
                           : opts.beforeRender)
                       ) {
-                        _ctx.next = 41;
+                        _ctx.next = 40;
                         break;
                       }
-                      _ctx.next = 41;
+                      _ctx.next = 40;
                       return opts.beforeRender();
-                    case 41:
+                    case 40:
                       render(renderCtx);
-                    case 42:
+                    case 41:
                     case "end":
                       return _ctx.stop();
                   }
               },
               _callee,
               null,
-              [[1, 29]]
+              [[1, 28]]
             );
           })
         );
@@ -1516,7 +1511,6 @@
         // don't cause any hydration delay:
         _react.default.useEffect(function() {
           (0, _performanceRelayer).default(onPerfEntry);
-          (0, _vitals).flushBufferedVitalsMetrics();
         }, []);
         if (false) {
         }
@@ -3330,71 +3324,6 @@
       /***/
     },
 
-    /***/ 7185: /***/ function(module, exports, __webpack_require__) {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true
-      });
-      exports.getBufferedVitalsMetrics = getBufferedVitalsMetrics;
-      exports.flushBufferedVitalsMetrics = flushBufferedVitalsMetrics;
-      exports.trackWebVitalMetric = trackWebVitalMetric;
-      exports.useWebVitalsReport = useWebVitalsReport;
-      exports.webVitalsCallbacks = void 0;
-      var _react = __webpack_require__(7294);
-      var webVitalsCallbacks = new Set();
-      exports.webVitalsCallbacks = webVitalsCallbacks;
-      var flushed = false;
-      var metrics = [];
-      function getBufferedVitalsMetrics() {
-        return metrics;
-      }
-      function flushBufferedVitalsMetrics() {
-        flushed = true;
-        metrics.length = 0;
-      }
-      function trackWebVitalMetric(metric) {
-        metrics.push(metric);
-        webVitalsCallbacks.forEach(function(callback) {
-          return callback(metric);
-        });
-      }
-      function useWebVitalsReport(callback) {
-        var metricIndexRef = (0, _react).useRef(0);
-        if (false) {
-        }
-        (0, _react).useEffect(
-          function() {
-            // Flush calculated metrics
-            var reportMetric = function(metric) {
-              callback(metric);
-              metricIndexRef.current = metrics.length;
-            };
-            for (var i = metricIndexRef.current; i < metrics.length; i++) {
-              reportMetric(metrics[i]);
-            }
-            webVitalsCallbacks.add(reportMetric);
-            return function() {
-              webVitalsCallbacks.delete(reportMetric);
-            };
-          },
-          [callback]
-        );
-      }
-      if (
-        typeof exports.default === "function" ||
-        (typeof exports.default === "object" && exports.default !== null)
-      ) {
-        Object.defineProperty(exports.default, "__esModule", {
-          value: true
-        });
-        Object.assign(exports.default, exports);
-        module.exports = exports.default;
-      } //# sourceMappingURL=vitals.js.map
-
-      /***/
-    },
-
     /***/ 5407: /***/ function(module, exports) {
       "use strict";
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-48f45c4cae8866c7.js"
+      src="/_next/static/chunks/main-6da128ecb4ea3638.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-48f45c4cae8866c7.js"
+      src="/_next/static/chunks/main-6da128ecb4ea3638.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-48f45c4cae8866c7.js"
+      src="/_next/static/chunks/main-6da128ecb4ea3638.js"
       defer=""
     ></script>
     <script
Commit: 39538eb

@kodiakhq kodiakhq bot merged commit ed4d009 into vercel:canary May 14, 2022
@huozhi huozhi deleted the drop-unstable-streaming-apis branch May 14, 2022 21:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 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.

None yet

3 participants