Skip to content

Commit

Permalink
v12.1.5-canary.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Apr 5, 2022
1 parent cec388c commit e146168
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "12.1.5-canary.1"
"version": "12.1.5-canary.2"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "12.1.5-canary.1",
"@next/eslint-plugin-next": "12.1.5-canary.2",
"@rushstack/eslint-patch": "1.0.8",
"@typescript-eslint/parser": "5.10.1",
"eslint-import-resolver-node": "0.3.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"private": true,
"scripts": {
"build-native": "napi build --platform --cargo-name next_swc_napi native",
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -69,7 +69,7 @@
]
},
"dependencies": {
"@next/env": "12.1.5-canary.1",
"@next/env": "12.1.5-canary.2",
"caniuse-lite": "^1.0.30001283",
"postcss": "8.4.5",
"styled-jsx": "5.0.1"
Expand Down Expand Up @@ -117,11 +117,11 @@
"@hapi/accept": "5.0.2",
"@napi-rs/cli": "2.4.4",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "12.1.5-canary.1",
"@next/polyfill-nomodule": "12.1.5-canary.1",
"@next/react-dev-overlay": "12.1.5-canary.1",
"@next/react-refresh-utils": "12.1.5-canary.1",
"@next/swc": "12.1.5-canary.1",
"@next/polyfill-module": "12.1.5-canary.2",
"@next/polyfill-nomodule": "12.1.5-canary.2",
"@next/react-dev-overlay": "12.1.5-canary.2",
"@next/react-refresh-utils": "12.1.5-canary.2",
"@next/swc": "12.1.5-canary.2",
"@peculiar/webcrypto": "1.3.1",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"description": "A development-only overlay for developing React applications.",
"repository": {
"url": "vercel/next.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "12.1.5-canary.1",
"version": "12.1.5-canary.2",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down

1 comment on commit e146168

@ijjk
Copy link
Member Author

@ijjk ijjk commented on e146168 Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stats from current release

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
buildDuration 14.5s 14.6s ⚠️ +138ms
buildDurationCached 6.1s 6s -125ms
nodeModulesSize 85.4 MB 85.5 MB ⚠️ +23.7 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
/ failed reqs 0 0
/ total time (seconds) 2.981 2.973 -0.01
/ avg req/sec 838.53 841.01 +2.48
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.196 1.234 ⚠️ +0.04
/error-in-render avg req/sec 2089.78 2026.38 ⚠️ -63.4
Client Bundles (main, webpack) Overall increase ⚠️
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
925.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 28.4 kB 28.5 kB ⚠️ +55 B
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 72.1 kB 72.1 kB ⚠️ +55 B
Legacy Client Bundles (polyfills)
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages Overall increase ⚠️
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
_app-HASH.js gzip 1.36 kB 1.36 kB
_error-HASH.js gzip 192 B 192 B
amp-HASH.js gzip 309 B 309 B
css-HASH.js gzip 327 B 327 B
dynamic-HASH.js gzip 3.05 kB 3.05 kB
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 920 B 920 B
image-HASH.js gzip 5.48 kB 5.64 kB ⚠️ +158 B
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.26 kB 2.32 kB ⚠️ +58 B
routerDirect..HASH.js gzip 320 B 320 B
script-HASH.js gzip 387 B 387 B
withRouter-HASH.js gzip 319 B 319 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 15.7 kB 15.9 kB ⚠️ +216 B
Client Build Manifests Overall decrease ✓
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
_buildManifest.js gzip 460 B 459 B -1 B
Overall change 460 B 459 B -1 B
Rendered Page Sizes
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
index.html gzip 531 B 531 B
link.html gzip 545 B 545 B
withRouter.html gzip 525 B 525 B
Overall change 1.6 kB 1.6 kB

Diffs

Diff for _buildManifest.js
@@ -12,8 +12,8 @@ self.__BUILD_MANIFEST = {
   ],
   "/head": ["static\u002Fchunks\u002Fpages\u002Fhead-96a5d6ed07cf5a83.js"],
   "/hooks": ["static\u002Fchunks\u002Fpages\u002Fhooks-9dfe734f583d4926.js"],
-  "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-fceff8aa5864bcb2.js"],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-a96e4060bca1ccfe.js"],
+  "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-f39504b2095f9b7d.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-a72b8ab130103a8f.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-cb15c8ac2322bf32.js"
   ],
Diff for image-HASH.js
@@ -154,6 +154,7 @@
           objectFit = _param.objectFit,
           objectPosition = _param.objectPosition,
           onLoadingComplete = _param.onLoadingComplete,
+          onError = _param.onError,
           _loader = _param.loader,
           loader = _loader === void 0 ? defaultImageLoader : _loader,
           _placeholder = _param.placeholder,
@@ -175,6 +176,7 @@
             "objectFit",
             "objectPosition",
             "onLoadingComplete",
+            "onError",
             "loader",
             "placeholder",
             "blurDataURL"
@@ -247,16 +249,20 @@
         if (true && loadedImageURLs.has(src)) {
           isLazy = false;
         }
+        var ref2 = _slicedToArray((0, _react).useState(false), 2),
+          blurComplete = ref2[0],
+          setBlurComplete = ref2[1];
         var ref1 = _slicedToArray(
             (0, _useIntersection).useIntersection({
               rootRef: lazyRoot,
               rootMargin: lazyBoundary,
               disabled: !isLazy
             }),
-            2
+            3
           ),
           setIntersection = ref1[0],
-          isIntersected = ref1[1];
+          isIntersected = ref1[1],
+          resetIntersected = ref1[2];
         var isVisible = !isLazy || isIntersected;
         var wrapperStyle = {
           boxSizing: "border-box",
@@ -318,7 +324,7 @@
             : layoutStyle
         );
         var blurStyle =
-          placeholder === "blur"
+          placeholder === "blur" && !blurComplete
             ? {
                 filter: "blur(20px)",
                 backgroundSize: objectFit || "cover",
@@ -404,7 +410,7 @@
           _obj);
         var useLayoutEffect = false ? 0 : _react.default.useLayoutEffect;
         var onLoadingCompleteRef = (0, _react).useRef(onLoadingComplete);
-        var imgRef = (0, _react).useRef(null);
+        var previousImageSrc = (0, _react).useRef(src);
         (0, _react).useEffect(
           function() {
             onLoadingCompleteRef.current = onLoadingComplete;
@@ -413,21 +419,12 @@
         );
         useLayoutEffect(
           function() {
-            setIntersection(imgRef.current);
-          },
-          [setIntersection]
-        );
-        (0, _react).useEffect(
-          function() {
-            handleLoading(
-              imgRef,
-              srcString,
-              layout,
-              placeholder,
-              onLoadingCompleteRef
-            );
+            if (previousImageSrc.current !== src) {
+              resetIntersected();
+              previousImageSrc.current = src;
+            }
           },
-          [srcString, layout, placeholder, isVisible]
+          [resetIntersected, src]
         );
         var imgElementArgs = _objectSpread(
           {
@@ -440,13 +437,16 @@
             className: className,
             imgStyle: imgStyle,
             blurStyle: blurStyle,
-            imgRef: imgRef,
             loading: loading,
             config: config,
             unoptimized: unoptimized,
             placeholder: placeholder,
             loader: loader,
-            srcString: srcString
+            srcString: srcString,
+            onLoadingCompleteRef: onLoadingCompleteRef,
+            setBlurComplete: setBlurComplete,
+            setIntersection: setIntersection,
+            isVisible: isVisible
           },
           rest
         );
@@ -752,9 +752,9 @@
             sizes: undefined
           };
         }
-        var ref2 = getWidths(config, width, layout, sizes),
-          widths = ref2.widths,
-          kind = ref2.kind;
+        var ref3 = getWidths(config, width, layout, sizes),
+          widths = ref3.widths,
+          kind = ref3.kind;
         var last = widths.length - 1;
         return {
           sizes: !sizes && kind === "w" ? "100vw" : sizes,
@@ -816,56 +816,53 @@
       // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
       // handler instead of the img's onLoad attribute.
       function handleLoading(
-        imgRef,
+        img,
         src,
         layout,
         placeholder,
-        onLoadingCompleteRef
+        onLoadingCompleteRef,
+        setBlurComplete
       ) {
-        var handleLoad = function() {
-          var img = imgRef.current;
-          if (!img) {
+        if (
+          !img ||
+          img.src === emptyDataURL ||
+          img["data-loaded-src"] === src
+        ) {
+          return;
+        }
+        img["data-loaded-src"] = src;
+        var p = "decode" in img ? img.decode() : Promise.resolve();
+        p.catch(function() {}).then(function() {
+          if (!img.parentNode) {
+            // Exit early in case of race condition:
+            // - onload() is called
+            // - decode() is called but incomplete
+            // - unmount is called
+            // - decode() completes
             return;
           }
-          if (img.src !== emptyDataURL) {
-            var p = "decode" in img ? img.decode() : Promise.resolve();
-            p.catch(function() {}).then(function() {
-              if (!imgRef.current) {
-                return;
-              }
-              loadedImageURLs.add(src);
-              if (placeholder === "blur") {
-                img.style.filter = "";
-                img.style.backgroundSize = "";
-                img.style.backgroundImage = "";
-                img.style.backgroundPosition = "";
-              }
-              if (onLoadingCompleteRef.current) {
-                var naturalWidth = img.naturalWidth,
-                  naturalHeight = img.naturalHeight;
-                // Pass back read-only primitive values but not the
-                // underlying DOM element because it could be misused.
-                onLoadingCompleteRef.current({
-                  naturalWidth: naturalWidth,
-                  naturalHeight: naturalHeight
-                });
-              }
-              if (false) {
-                var parent, ref3;
-              }
+          loadedImageURLs.add(src);
+          if (placeholder === "blur") {
+            setBlurComplete(true);
+          }
+          if (
+            onLoadingCompleteRef === null || onLoadingCompleteRef === void 0
+              ? void 0
+              : onLoadingCompleteRef.current
+          ) {
+            var naturalWidth = img.naturalWidth,
+              naturalHeight = img.naturalHeight;
+            // Pass back read-only primitive values but not the
+            // underlying DOM element because it could be misused.
+            onLoadingCompleteRef.current({
+              naturalWidth: naturalWidth,
+              naturalHeight: naturalHeight
             });
           }
-        };
-        if (imgRef.current) {
-          if (imgRef.current.complete) {
-            // If the real image fails to load, this will still remove the placeholder.
-            // This is the desired behavior for now, and will be revisited when error
-            // handling is worked on for the image component itself.
-            handleLoad();
-          } else {
-            imgRef.current.onload = handleLoad;
+          if (false) {
+            var parent, ref3;
           }
-        }
+        });
       }
       var ImageElement = function(_param) {
         var imgAttributes = _param.imgAttributes,
@@ -877,14 +874,17 @@
           imgStyle = _param.imgStyle,
           blurStyle = _param.blurStyle,
           isLazy = _param.isLazy,
-          imgRef = _param.imgRef,
           placeholder = _param.placeholder,
           loading = _param.loading,
-          sizes = _param.sizes,
           srcString = _param.srcString,
           config = _param.config,
           unoptimized = _param.unoptimized,
           loader = _param.loader,
+          onLoadingCompleteRef = _param.onLoadingCompleteRef,
+          setBlurComplete = _param.setBlurComplete,
+          setIntersection = _param.setIntersection,
+          onError = _param.onError,
+          isVisible = _param.isVisible,
           rest = _objectWithoutProperties(_param, [
             "imgAttributes",
             "heightInt",
@@ -895,14 +895,17 @@
             "imgStyle",
             "blurStyle",
             "isLazy",
-            "imgRef",
             "placeholder",
             "loading",
-            "sizes",
             "srcString",
             "config",
             "unoptimized",
-            "loader"
+            "loader",
+            "onLoadingCompleteRef",
+            "setBlurComplete",
+            "setIntersection",
+            "onError",
+            "isVisible"
           ]);
         return /*#__PURE__*/ _react.default.createElement(
           _react.default.Fragment,
@@ -913,7 +916,7 @@
               {},
               rest,
               imgAttributes,
-              layout === "raw" && !sizes
+              layout === "raw" && !imgAttributes.sizes
                 ? {
                     height: heightInt,
                     width: widthInt
@@ -923,8 +926,52 @@
                 decoding: "async",
                 "data-nimg": layout,
                 className: className,
-                ref: imgRef,
-                style: _objectSpread({}, imgStyle, blurStyle)
+                style: _objectSpread({}, imgStyle, blurStyle),
+                ref: (0, _react).useCallback(
+                  function(img) {
+                    setIntersection(img);
+                    if (
+                      img === null || img === void 0 ? void 0 : img.complete
+                    ) {
+                      handleLoading(
+                        img,
+                        srcString,
+                        layout,
+                        placeholder,
+                        onLoadingCompleteRef,
+                        setBlurComplete
+                      );
+                    }
+                  },
+                  [
+                    setIntersection,
+                    srcString,
+                    layout,
+                    placeholder,
+                    onLoadingCompleteRef,
+                    setBlurComplete
+                  ]
+                ),
+                onLoad: function(event) {
+                  var img = event.currentTarget;
+                  handleLoading(
+                    img,
+                    srcString,
+                    layout,
+                    placeholder,
+                    onLoadingCompleteRef,
+                    setBlurComplete
+                  );
+                },
+                onError: function(event) {
+                  if (placeholder === "blur") {
+                    // If the real image fails to load, this will still remove the placeholder.
+                    setBlurComplete(true);
+                  }
+                  if (onError) {
+                    onError(event);
+                  }
+                }
               }
             )
           ),
@@ -944,10 +991,10 @@
                     layout: layout,
                     width: widthInt,
                     quality: qualityInt,
-                    sizes: sizes,
+                    sizes: imgAttributes.sizes,
                     loader: loader
                   }),
-                  layout === "raw" && !sizes
+                  layout === "raw" && !imgAttributes.sizes
                     ? {
                         height: heightInt,
                         width: widthInt
@@ -1159,6 +1206,9 @@
           },
           [isDisabled, root, rootMargin, visible]
         );
+        var resetVisible = (0, _react).useCallback(function() {
+          setVisible(false);
+        }, []);
         (0, _react).useEffect(
           function() {
             if (!hasIntersectionObserver) {
@@ -1183,7 +1233,7 @@
           },
           [rootRef]
         );
-        return [setRef, visible];
+        return [setRef, visible, resetVisible];
       }
       function observe(element, callback, options) {
         var ref = createObserver(options),
Diff for link-HASH.js
@@ -198,6 +198,8 @@
           ),
           href = ref2.href,
           as = ref2.as;
+        var previousHref = _react.default.useRef(href);
+        var previousAs = _react.default.useRef(as);
         var children = props.children,
           replace = props.replace,
           shallow = props.shallow,
@@ -221,12 +223,19 @@
             (0, _useIntersection).useIntersection({
               rootMargin: "200px"
             }),
-            2
+            3
           ),
           setIntersectionRef = ref1[0],
-          isVisible = ref1[1];
+          isVisible = ref1[1],
+          resetVisible = ref1[2];
         var setRef = _react.default.useCallback(
           function(el) {
+            // Before the link getting observed, check if visible state need to be reset
+            if (previousAs.current !== as || previousHref.current !== href) {
+              resetVisible();
+              previousAs.current = as;
+              previousHref.current = href;
+            }
             setIntersectionRef(el);
             if (childRef) {
               if (typeof childRef === "function") childRef(el);
@@ -235,7 +244,7 @@
               }
             }
           },
-          [childRef, setIntersectionRef]
+          [as, childRef, href, resetVisible, setIntersectionRef]
         );
         _react.default.useEffect(
           function() {
@@ -434,6 +443,9 @@
           },
           [isDisabled, root, rootMargin, visible]
         );
+        var resetVisible = (0, _react).useCallback(function() {
+          setVisible(false);
+        }, []);
         (0, _react).useEffect(
           function() {
             if (!hasIntersectionObserver) {
@@ -458,7 +470,7 @@
           },
           [rootRef]
         );
-        return [setRef, visible];
+        return [setRef, visible, resetVisible];
       }
       function observe(element, callback, options) {
         var ref = createObserver(options),
Diff for main-HASH.js
@@ -624,7 +624,7 @@
         }
         return target;
       }
-      var version = "12.1.4";
+      var version = "12.1.5-canary.2";
       exports.version = version;
       var router;
       exports.router = router;
@@ -643,7 +643,7 @@
       var webpackHMR;
       var CachedApp, onPerfEntry;
       var CachedComponent;
-      var isAppRSC;
+      var isRSCPage;
       var Container = /*#__PURE__*/ (function(_Component) {
         _inherits(Container, _Component);
         var _super = _createSuper(Container);
@@ -868,7 +868,6 @@
                       (app = appEntrypoint.component),
                         (mod = appEntrypoint.exports);
                       CachedApp = app;
-                      isAppRSC = !!mod.__next_rsc__;
                       exportedReportWebVitals = mod && mod.reportWebVitals;
                       onPerfEntry = function(param) {
                         var id = param.id,
@@ -909,30 +908,31 @@
                         // error, so we need to skip waiting for the entrypoint.
                         true
                       ) {
-                        _ctx.next = 16;
+                        _ctx.next = 15;
                         break;
                       }
                       _ctx.t0 = {
                         error: initialData.err
                       };
-                      _ctx.next = 19;
-                      break;
-                    case 16:
                       _ctx.next = 18;
+                      break;
+                    case 15:
+                      _ctx.next = 17;
                       return pageLoader.routeLoader.whenEntrypoint(
                         initialData.page
                       );
-                    case 18:
+                    case 17:
                       _ctx.t0 = _ctx.sent;
-                    case 19:
+                    case 18:
                       pageEntrypoint = _ctx.t0;
                       if (!("error" in pageEntrypoint)) {
-                        _ctx.next = 22;
+                        _ctx.next = 21;
                         break;
                       }
                       throw pageEntrypoint.error;
-                    case 22:
+                    case 21:
                       CachedComponent = pageEntrypoint.component;
+                      isRSCPage = !!pageEntrypoint.exports.__next_rsc__;
                       if (true) {
                         _ctx.next = 27;
                         break;
@@ -1177,7 +1177,7 @@
           shouldHydrate ? markHydrateComplete : markRenderComplete
         );
         if (false) {
-          var ReactDOMClient;
+          var startTransition, ReactDOMClient;
         } else {
           // The check for `.hydrate` is there to support React alternatives like preact
           if (shouldHydrate) {
@@ -1318,7 +1318,9 @@
           initialServerDataWriter,
           initialServerDataBuffer,
           encoder,
+          ref1,
           createFromFetch,
+          createFromReadableStream,
           getCacheKey,
           useServerResponse,
           fetchFlight,
@@ -1505,14 +1507,14 @@
           },
           [callbacks]
         );
-        if (false) {
-        }
         // We should ask to measure the Web Vitals after rendering completes so we
         // don't cause any hydration delay:
         _react.default.useEffect(function() {
           (0, _performanceRelayer).default(onPerfEntry);
           (0, _vitals).flushBufferedVitalsMetrics();
         }, []);
+        if (false) {
+        }
         return children;
       }
       // Dummy component that we render as a child of Root so that we can
@@ -1679,7 +1681,7 @@
               var href = param.href,
                 asPath = param.asPath,
                 ssg = param.ssg,
-                rsc = param.rsc,
+                flight = param.flight,
                 locale = param.locale;
               var _this = this;
               var ref = (0, _parseRelativeUrl).parseRelativeUrl(href),
@@ -1690,7 +1692,7 @@
                 asPathname = ref1.pathname;
               var route = normalizeRoute(hrefPathname);
               var getHrefForSlug = function(path) {
-                if (rsc) {
+                if (flight) {
                   return path + search + (search ? "&" : "?") + "__flight__=1";
                 }
                 var dataRoute = (0, _getAssetPathFromRoute).default(
@@ -5869,10 +5871,10 @@
                     __N_RSC,
                     isValidElementType,
                     dataHref,
+                    useStreamedFlightData,
                     props,
-                    ref,
-                    fresh,
-                    data;
+                    data,
+                    __flight__;
                   return _runtimeJs.default.wrap(
                     function _callee$(_ctx) {
                       while (1)
@@ -5951,6 +5953,8 @@
                               )
                             );
                           case 17:
+                            useStreamedFlightData =
+                              (false || __N_SSP) && __N_RSC;
                             if (__N_SSG || __N_SSP || __N_RSC) {
                               dataHref = _this.pageLoader.getDataHref({
                                 href: (0, _formatUrl).formatWithValidation({
@@ -5959,13 +5963,14 @@
                                 }),
                                 asPath: resolvedAs,
                                 ssg: __N_SSG,
-                                rsc: __N_RSC,
+                                flight: useStreamedFlightData,
                                 locale: locale
                               });
                             }
-                            _ctx.next = 21;
+                            _ctx.next = 22;
                             return _this._getData(function() {
-                              return __N_SSG || __N_SSP
+                              return (__N_SSG || __N_SSP || __N_RSC) &&
+                                !useStreamedFlightData
                                 ? fetchNextData(
                                     dataHref,
                                     _this.isSsr,
@@ -5982,30 +5987,43 @@
                                     defaultLocale: _this.defaultLocale
                                   });
                             });
-                          case 21:
+                          case 22:
                             props = _ctx.sent;
                             if (!__N_RSC) {
-                              _ctx.next = 29;
+                              _ctx.next = 32;
                               break;
                             }
-                            _ctx.next = 25;
+                            if (!useStreamedFlightData) {
+                              _ctx.next = 31;
+                              break;
+                            }
+                            _ctx.next = 27;
                             return _this._getData(function() {
                               return _this._getFlightData(dataHref);
                             });
-                          case 25:
-                            ref = _ctx.sent;
-                            fresh = ref.fresh;
-                            data = ref.data;
+                          case 27:
+                            data = _ctx.sent.data;
                             props.pageProps = Object.assign(props.pageProps, {
-                              __flight_serialized__: data,
-                              __flight_fresh__: fresh
+                              __flight__: data
                             });
-                          case 29:
+                            _ctx.next = 32;
+                            break;
+                          case 31: {
+                            __flight__ = props.__flight__;
+                            props.pageProps = Object.assign(
+                              {},
+                              props.pageProps,
+                              {
+                                __flight__: __flight__
+                              }
+                            );
+                          }
+                          case 32:
                             routeInfo.props = props;
                             _this.components[route] = routeInfo;
                             return _ctx.abrupt("return", routeInfo);
-                          case 34:
-                            _ctx.prev = 34;
+                          case 37:
+                            _ctx.prev = 37;
                             _ctx.t1 = _ctx["catch"](0);
                             return _ctx.abrupt(
                               "return",
@@ -6017,14 +6035,14 @@
                                 routeProps
                               )
                             );
-                          case 37:
+                          case 40:
                           case "end":
                             return _ctx.stop();
                         }
                     },
                     _callee,
                     null,
-                    [[0, 34]]
+                    [[0, 37]]
                   );
                 })
               )();
@@ -6363,7 +6381,6 @@
               return fetchNextData(dataHref, true, true, this.sdc, false).then(
                 function(serialized) {
                   return {
-                    fresh: true,
                     data: serialized
                   };
                 }
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-444bd3ddf1f35edc.js"
+      src="/_next/static/chunks/main-46a1f19b7b7698c4.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-444bd3ddf1f35edc.js"
+      src="/_next/static/chunks/main-46a1f19b7b7698c4.js"
       defer=""
     ></script>
     <script
@@ -27,7 +27,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-a96e4060bca1ccfe.js"
+      src="/_next/static/chunks/pages/link-a72b8ab130103a8f.js"
       defer=""
     ></script>
     <script src="/_next/static/BUILD_ID/_buildManifest.js" defer=""></script>
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-444bd3ddf1f35edc.js"
+      src="/_next/static/chunks/main-46a1f19b7b7698c4.js"
       defer=""
     ></script>
     <script

Default Build with SWC (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
buildDuration 11.8s 11.6s -273ms
buildDurationCached 6s 6s ⚠️ +9ms
nodeModulesSize 85.4 MB 85.5 MB ⚠️ +23.7 kB
Page Load Tests Overall increase ✓
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
/ failed reqs 0 0
/ total time (seconds) 2.979 2.997 ⚠️ +0.02
/ avg req/sec 839.15 834.1 ⚠️ -5.05
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.24 1.196 -0.04
/error-in-render avg req/sec 2015.95 2090.44 +74.49
Client Bundles (main, webpack) Overall increase ⚠️
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
925.HASH.js gzip 178 B 178 B
framework-HASH.js gzip 42.3 kB 42.3 kB
main-HASH.js gzip 28.8 kB 28.8 kB ⚠️ +22 B
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 72.7 kB 72.7 kB ⚠️ +22 B
Legacy Client Bundles (polyfills)
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages Overall increase ⚠️
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 179 B 179 B
amp-HASH.js gzip 313 B 313 B
css-HASH.js gzip 325 B 325 B
dynamic-HASH.js gzip 3.03 kB 3.03 kB
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 921 B 921 B
image-HASH.js gzip 5.59 kB 5.7 kB ⚠️ +114 B
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 2.33 kB 2.38 kB ⚠️ +53 B
routerDirect..HASH.js gzip 322 B 322 B
script-HASH.js gzip 388 B 388 B
withRouter-HASH.js gzip 317 B 317 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 15.8 kB 15.9 kB ⚠️ +167 B
Client Build Manifests
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary v12.1.4 vercel/next.js refs/heads/canary Change
index.html gzip 532 B 531 B -1 B
link.html gzip 546 B 544 B -2 B
withRouter.html gzip 527 B 526 B -1 B
Overall change 1.6 kB 1.6 kB -4 B

Diffs

Diff for _buildManifest.js
@@ -12,8 +12,8 @@ self.__BUILD_MANIFEST = {
   ],
   "/head": ["static\u002Fchunks\u002Fpages\u002Fhead-96a5d6ed07cf5a83.js"],
   "/hooks": ["static\u002Fchunks\u002Fpages\u002Fhooks-9dfe734f583d4926.js"],
-  "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-fceff8aa5864bcb2.js"],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-a96e4060bca1ccfe.js"],
+  "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-f39504b2095f9b7d.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-a72b8ab130103a8f.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-cb15c8ac2322bf32.js"
   ],
Diff for image-HASH.js
@@ -154,6 +154,7 @@
           objectFit = _param.objectFit,
           objectPosition = _param.objectPosition,
           onLoadingComplete = _param.onLoadingComplete,
+          onError = _param.onError,
           _loader = _param.loader,
           loader = _loader === void 0 ? defaultImageLoader : _loader,
           _placeholder = _param.placeholder,
@@ -175,6 +176,7 @@
             "objectFit",
             "objectPosition",
             "onLoadingComplete",
+            "onError",
             "loader",
             "placeholder",
             "blurDataURL"
@@ -247,16 +249,20 @@
         if (true && loadedImageURLs.has(src)) {
           isLazy = false;
         }
+        var ref2 = _slicedToArray((0, _react).useState(false), 2),
+          blurComplete = ref2[0],
+          setBlurComplete = ref2[1];
         var ref1 = _slicedToArray(
             (0, _useIntersection).useIntersection({
               rootRef: lazyRoot,
               rootMargin: lazyBoundary,
               disabled: !isLazy
             }),
-            2
+            3
           ),
           setIntersection = ref1[0],
-          isIntersected = ref1[1];
+          isIntersected = ref1[1],
+          resetIntersected = ref1[2];
         var isVisible = !isLazy || isIntersected;
         var wrapperStyle = {
           boxSizing: "border-box",
@@ -318,7 +324,7 @@
             : layoutStyle
         );
         var blurStyle =
-          placeholder === "blur"
+          placeholder === "blur" && !blurComplete
             ? {
                 filter: "blur(20px)",
                 backgroundSize: objectFit || "cover",
@@ -404,7 +410,7 @@
           _obj);
         var useLayoutEffect = false ? 0 : _react.default.useLayoutEffect;
         var onLoadingCompleteRef = (0, _react).useRef(onLoadingComplete);
-        var imgRef = (0, _react).useRef(null);
+        var previousImageSrc = (0, _react).useRef(src);
         (0, _react).useEffect(
           function() {
             onLoadingCompleteRef.current = onLoadingComplete;
@@ -413,21 +419,12 @@
         );
         useLayoutEffect(
           function() {
-            setIntersection(imgRef.current);
-          },
-          [setIntersection]
-        );
-        (0, _react).useEffect(
-          function() {
-            handleLoading(
-              imgRef,
-              srcString,
-              layout,
-              placeholder,
-              onLoadingCompleteRef
-            );
+            if (previousImageSrc.current !== src) {
+              resetIntersected();
+              previousImageSrc.current = src;
+            }
           },
-          [srcString, layout, placeholder, isVisible]
+          [resetIntersected, src]
         );
         var imgElementArgs = _objectSpread(
           {
@@ -440,13 +437,16 @@
             className: className,
             imgStyle: imgStyle,
             blurStyle: blurStyle,
-            imgRef: imgRef,
             loading: loading,
             config: config,
             unoptimized: unoptimized,
             placeholder: placeholder,
             loader: loader,
-            srcString: srcString
+            srcString: srcString,
+            onLoadingCompleteRef: onLoadingCompleteRef,
+            setBlurComplete: setBlurComplete,
+            setIntersection: setIntersection,
+            isVisible: isVisible
           },
           rest
         );
@@ -752,9 +752,9 @@
             sizes: undefined
           };
         }
-        var ref2 = getWidths(config, width, layout, sizes),
-          widths = ref2.widths,
-          kind = ref2.kind;
+        var ref3 = getWidths(config, width, layout, sizes),
+          widths = ref3.widths,
+          kind = ref3.kind;
         var last = widths.length - 1;
         return {
           sizes: !sizes && kind === "w" ? "100vw" : sizes,
@@ -816,56 +816,53 @@
       // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
       // handler instead of the img's onLoad attribute.
       function handleLoading(
-        imgRef,
+        img,
         src,
         layout,
         placeholder,
-        onLoadingCompleteRef
+        onLoadingCompleteRef,
+        setBlurComplete
       ) {
-        var handleLoad = function() {
-          var img = imgRef.current;
-          if (!img) {
+        if (
+          !img ||
+          img.src === emptyDataURL ||
+          img["data-loaded-src"] === src
+        ) {
+          return;
+        }
+        img["data-loaded-src"] = src;
+        var p = "decode" in img ? img.decode() : Promise.resolve();
+        p.catch(function() {}).then(function() {
+          if (!img.parentNode) {
+            // Exit early in case of race condition:
+            // - onload() is called
+            // - decode() is called but incomplete
+            // - unmount is called
+            // - decode() completes
             return;
           }
-          if (img.src !== emptyDataURL) {
-            var p = "decode" in img ? img.decode() : Promise.resolve();
-            p.catch(function() {}).then(function() {
-              if (!imgRef.current) {
-                return;
-              }
-              loadedImageURLs.add(src);
-              if (placeholder === "blur") {
-                img.style.filter = "";
-                img.style.backgroundSize = "";
-                img.style.backgroundImage = "";
-                img.style.backgroundPosition = "";
-              }
-              if (onLoadingCompleteRef.current) {
-                var naturalWidth = img.naturalWidth,
-                  naturalHeight = img.naturalHeight;
-                // Pass back read-only primitive values but not the
-                // underlying DOM element because it could be misused.
-                onLoadingCompleteRef.current({
-                  naturalWidth: naturalWidth,
-                  naturalHeight: naturalHeight
-                });
-              }
-              if (false) {
-                var parent, ref3;
-              }
+          loadedImageURLs.add(src);
+          if (placeholder === "blur") {
+            setBlurComplete(true);
+          }
+          if (
+            onLoadingCompleteRef === null || onLoadingCompleteRef === void 0
+              ? void 0
+              : onLoadingCompleteRef.current
+          ) {
+            var naturalWidth = img.naturalWidth,
+              naturalHeight = img.naturalHeight;
+            // Pass back read-only primitive values but not the
+            // underlying DOM element because it could be misused.
+            onLoadingCompleteRef.current({
+              naturalWidth: naturalWidth,
+              naturalHeight: naturalHeight
             });
           }
-        };
-        if (imgRef.current) {
-          if (imgRef.current.complete) {
-            // If the real image fails to load, this will still remove the placeholder.
-            // This is the desired behavior for now, and will be revisited when error
-            // handling is worked on for the image component itself.
-            handleLoad();
-          } else {
-            imgRef.current.onload = handleLoad;
+          if (false) {
+            var parent, ref3;
           }
-        }
+        });
       }
       var ImageElement = function(_param) {
         var imgAttributes = _param.imgAttributes,
@@ -877,14 +874,17 @@
           imgStyle = _param.imgStyle,
           blurStyle = _param.blurStyle,
           isLazy = _param.isLazy,
-          imgRef = _param.imgRef,
           placeholder = _param.placeholder,
           loading = _param.loading,
-          sizes = _param.sizes,
           srcString = _param.srcString,
           config = _param.config,
           unoptimized = _param.unoptimized,
           loader = _param.loader,
+          onLoadingCompleteRef = _param.onLoadingCompleteRef,
+          setBlurComplete = _param.setBlurComplete,
+          setIntersection = _param.setIntersection,
+          onError = _param.onError,
+          isVisible = _param.isVisible,
           rest = _objectWithoutProperties(_param, [
             "imgAttributes",
             "heightInt",
@@ -895,14 +895,17 @@
             "imgStyle",
             "blurStyle",
             "isLazy",
-            "imgRef",
             "placeholder",
             "loading",
-            "sizes",
             "srcString",
             "config",
             "unoptimized",
-            "loader"
+            "loader",
+            "onLoadingCompleteRef",
+            "setBlurComplete",
+            "setIntersection",
+            "onError",
+            "isVisible"
           ]);
         return /*#__PURE__*/ _react.default.createElement(
           _react.default.Fragment,
@@ -913,7 +916,7 @@
               {},
               rest,
               imgAttributes,
-              layout === "raw" && !sizes
+              layout === "raw" && !imgAttributes.sizes
                 ? {
                     height: heightInt,
                     width: widthInt
@@ -923,8 +926,52 @@
                 decoding: "async",
                 "data-nimg": layout,
                 className: className,
-                ref: imgRef,
-                style: _objectSpread({}, imgStyle, blurStyle)
+                style: _objectSpread({}, imgStyle, blurStyle),
+                ref: (0, _react).useCallback(
+                  function(img) {
+                    setIntersection(img);
+                    if (
+                      img === null || img === void 0 ? void 0 : img.complete
+                    ) {
+                      handleLoading(
+                        img,
+                        srcString,
+                        layout,
+                        placeholder,
+                        onLoadingCompleteRef,
+                        setBlurComplete
+                      );
+                    }
+                  },
+                  [
+                    setIntersection,
+                    srcString,
+                    layout,
+                    placeholder,
+                    onLoadingCompleteRef,
+                    setBlurComplete
+                  ]
+                ),
+                onLoad: function(event) {
+                  var img = event.currentTarget;
+                  handleLoading(
+                    img,
+                    srcString,
+                    layout,
+                    placeholder,
+                    onLoadingCompleteRef,
+                    setBlurComplete
+                  );
+                },
+                onError: function(event) {
+                  if (placeholder === "blur") {
+                    // If the real image fails to load, this will still remove the placeholder.
+                    setBlurComplete(true);
+                  }
+                  if (onError) {
+                    onError(event);
+                  }
+                }
               }
             )
           ),
@@ -944,10 +991,10 @@
                     layout: layout,
                     width: widthInt,
                     quality: qualityInt,
-                    sizes: sizes,
+                    sizes: imgAttributes.sizes,
                     loader: loader
                   }),
-                  layout === "raw" && !sizes
+                  layout === "raw" && !imgAttributes.sizes
                     ? {
                         height: heightInt,
                         width: widthInt
@@ -1159,6 +1206,9 @@
           },
           [isDisabled, root, rootMargin, visible]
         );
+        var resetVisible = (0, _react).useCallback(function() {
+          setVisible(false);
+        }, []);
         (0, _react).useEffect(
           function() {
             if (!hasIntersectionObserver) {
@@ -1183,7 +1233,7 @@
           },
           [rootRef]
         );
-        return [setRef, visible];
+        return [setRef, visible, resetVisible];
       }
       function observe(element, callback, options) {
         var ref = createObserver(options),
Diff for link-HASH.js
@@ -198,6 +198,8 @@
           ),
           href = ref2.href,
           as = ref2.as;
+        var previousHref = _react.default.useRef(href);
+        var previousAs = _react.default.useRef(as);
         var children = props.children,
           replace = props.replace,
           shallow = props.shallow,
@@ -221,12 +223,19 @@
             (0, _useIntersection).useIntersection({
               rootMargin: "200px"
             }),
-            2
+            3
           ),
           setIntersectionRef = ref1[0],
-          isVisible = ref1[1];
+          isVisible = ref1[1],
+          resetVisible = ref1[2];
         var setRef = _react.default.useCallback(
           function(el) {
+            // Before the link getting observed, check if visible state need to be reset
+            if (previousAs.current !== as || previousHref.current !== href) {
+              resetVisible();
+              previousAs.current = as;
+              previousHref.current = href;
+            }
             setIntersectionRef(el);
             if (childRef) {
               if (typeof childRef === "function") childRef(el);
@@ -235,7 +244,7 @@
               }
             }
           },
-          [childRef, setIntersectionRef]
+          [as, childRef, href, resetVisible, setIntersectionRef]
         );
         _react.default.useEffect(
           function() {
@@ -434,6 +443,9 @@
           },
           [isDisabled, root, rootMargin, visible]
         );
+        var resetVisible = (0, _react).useCallback(function() {
+          setVisible(false);
+        }, []);
         (0, _react).useEffect(
           function() {
             if (!hasIntersectionObserver) {
@@ -458,7 +470,7 @@
           },
           [rootRef]
         );
-        return [setRef, visible];
+        return [setRef, visible, resetVisible];
       }
       function observe(element, callback, options) {
         var ref = createObserver(options),
Diff for main-HASH.js
@@ -624,7 +624,7 @@
         }
         return target;
       }
-      var version = "12.1.4";
+      var version = "12.1.5-canary.2";
       exports.version = version;
       var router;
       exports.router = router;
@@ -643,7 +643,7 @@
       var webpackHMR;
       var CachedApp, onPerfEntry;
       var CachedComponent;
-      var isAppRSC;
+      var isRSCPage;
       var Container = /*#__PURE__*/ (function(_Component) {
         _inherits(Container, _Component);
         var _super = _createSuper(Container);
@@ -868,7 +868,6 @@
                       (app = appEntrypoint.component),
                         (mod = appEntrypoint.exports);
                       CachedApp = app;
-                      isAppRSC = !!mod.__next_rsc__;
                       exportedReportWebVitals = mod && mod.reportWebVitals;
                       onPerfEntry = function(param) {
                         var id = param.id,
@@ -909,30 +908,31 @@
                         // error, so we need to skip waiting for the entrypoint.
                         true
                       ) {
-                        _ctx.next = 16;
+                        _ctx.next = 15;
                         break;
                       }
                       _ctx.t0 = {
                         error: initialData.err
                       };
-                      _ctx.next = 19;
-                      break;
-                    case 16:
                       _ctx.next = 18;
+                      break;
+                    case 15:
+                      _ctx.next = 17;
                       return pageLoader.routeLoader.whenEntrypoint(
                         initialData.page
                       );
-                    case 18:
+                    case 17:
                       _ctx.t0 = _ctx.sent;
-                    case 19:
+                    case 18:
                       pageEntrypoint = _ctx.t0;
                       if (!("error" in pageEntrypoint)) {
-                        _ctx.next = 22;
+                        _ctx.next = 21;
                         break;
                       }
                       throw pageEntrypoint.error;
-                    case 22:
+                    case 21:
                       CachedComponent = pageEntrypoint.component;
+                      isRSCPage = !!pageEntrypoint.exports.__next_rsc__;
                       if (true) {
                         _ctx.next = 27;
                         break;
@@ -1177,7 +1177,7 @@
           shouldHydrate ? markHydrateComplete : markRenderComplete
         );
         if (false) {
-          var ReactDOMClient;
+          var startTransition, ReactDOMClient;
         } else {
           // The check for `.hydrate` is there to support React alternatives like preact
           if (shouldHydrate) {
@@ -1318,7 +1318,9 @@
           initialServerDataWriter,
           initialServerDataBuffer,
           encoder,
+          ref1,
           createFromFetch,
+          createFromReadableStream,
           getCacheKey,
           useServerResponse,
           fetchFlight,
@@ -1505,14 +1507,14 @@
           },
           [callbacks]
         );
-        if (false) {
-        }
         // We should ask to measure the Web Vitals after rendering completes so we
         // don't cause any hydration delay:
         _react.default.useEffect(function() {
           (0, _performanceRelayer).default(onPerfEntry);
           (0, _vitals).flushBufferedVitalsMetrics();
         }, []);
+        if (false) {
+        }
         return children;
       }
       // Dummy component that we render as a child of Root so that we can
@@ -1679,7 +1681,7 @@
               var href = param.href,
                 asPath = param.asPath,
                 ssg = param.ssg,
-                rsc = param.rsc,
+                flight = param.flight,
                 locale = param.locale;
               var _this = this;
               var ref = (0, _parseRelativeUrl).parseRelativeUrl(href),
@@ -1690,7 +1692,7 @@
                 asPathname = ref1.pathname;
               var route = normalizeRoute(hrefPathname);
               var getHrefForSlug = function(path) {
-                if (rsc) {
+                if (flight) {
                   return path + search + (search ? "&" : "?") + "__flight__=1";
                 }
                 var dataRoute = (0, _getAssetPathFromRoute).default(
@@ -5869,10 +5871,10 @@
                     __N_RSC,
                     isValidElementType,
                     dataHref,
+                    useStreamedFlightData,
                     props,
-                    ref,
-                    fresh,
-                    data;
+                    data,
+                    __flight__;
                   return _runtimeJs.default.wrap(
                     function _callee$(_ctx) {
                       while (1)
@@ -5951,6 +5953,8 @@
                               )
                             );
                           case 17:
+                            useStreamedFlightData =
+                              (false || __N_SSP) && __N_RSC;
                             if (__N_SSG || __N_SSP || __N_RSC) {
                               dataHref = _this.pageLoader.getDataHref({
                                 href: (0, _formatUrl).formatWithValidation({
@@ -5959,13 +5963,14 @@
                                 }),
                                 asPath: resolvedAs,
                                 ssg: __N_SSG,
-                                rsc: __N_RSC,
+                                flight: useStreamedFlightData,
                                 locale: locale
                               });
                             }
-                            _ctx.next = 21;
+                            _ctx.next = 22;
                             return _this._getData(function() {
-                              return __N_SSG || __N_SSP
+                              return (__N_SSG || __N_SSP || __N_RSC) &&
+                                !useStreamedFlightData
                                 ? fetchNextData(
                                     dataHref,
                                     _this.isSsr,
@@ -5982,30 +5987,43 @@
                                     defaultLocale: _this.defaultLocale
                                   });
                             });
-                          case 21:
+                          case 22:
                             props = _ctx.sent;
                             if (!__N_RSC) {
-                              _ctx.next = 29;
+                              _ctx.next = 32;
                               break;
                             }
-                            _ctx.next = 25;
+                            if (!useStreamedFlightData) {
+                              _ctx.next = 31;
+                              break;
+                            }
+                            _ctx.next = 27;
                             return _this._getData(function() {
                               return _this._getFlightData(dataHref);
                             });
-                          case 25:
-                            ref = _ctx.sent;
-                            fresh = ref.fresh;
-                            data = ref.data;
+                          case 27:
+                            data = _ctx.sent.data;
                             props.pageProps = Object.assign(props.pageProps, {
-                              __flight_serialized__: data,
-                              __flight_fresh__: fresh
+                              __flight__: data
                             });
-                          case 29:
+                            _ctx.next = 32;
+                            break;
+                          case 31: {
+                            __flight__ = props.__flight__;
+                            props.pageProps = Object.assign(
+                              {},
+                              props.pageProps,
+                              {
+                                __flight__: __flight__
+                              }
+                            );
+                          }
+                          case 32:
                             routeInfo.props = props;
                             _this.components[route] = routeInfo;
                             return _ctx.abrupt("return", routeInfo);
-                          case 34:
-                            _ctx.prev = 34;
+                          case 37:
+                            _ctx.prev = 37;
                             _ctx.t1 = _ctx["catch"](0);
                             return _ctx.abrupt(
                               "return",
@@ -6017,14 +6035,14 @@
                                 routeProps
                               )
                             );
-                          case 37:
+                          case 40:
                           case "end":
                             return _ctx.stop();
                         }
                     },
                     _callee,
                     null,
-                    [[0, 34]]
+                    [[0, 37]]
                   );
                 })
               )();
@@ -6363,7 +6381,6 @@
               return fetchNextData(dataHref, true, true, this.sdc, false).then(
                 function(serialized) {
                   return {
-                    fresh: true,
                     data: serialized
                   };
                 }
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-444bd3ddf1f35edc.js"
+      src="/_next/static/chunks/main-46a1f19b7b7698c4.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-444bd3ddf1f35edc.js"
+      src="/_next/static/chunks/main-46a1f19b7b7698c4.js"
       defer=""
     ></script>
     <script
@@ -27,7 +27,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-a96e4060bca1ccfe.js"
+      src="/_next/static/chunks/pages/link-a72b8ab130103a8f.js"
       defer=""
     ></script>
     <script src="/_next/static/BUILD_ID/_buildManifest.js" defer=""></script>
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-444bd3ddf1f35edc.js"
+      src="/_next/static/chunks/main-46a1f19b7b7698c4.js"
       defer=""
     ></script>
     <script

Please sign in to comment.