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

Remove deprecated features #25446

Merged
merged 11 commits into from Jun 2, 2021

Conversation

timneutkens
Copy link
Member

In the next major version we'll want to merge this PR that removes some of the long-time deprecated features, it'll have a positive effect on bundle size.

Bug

  • Related issues linked using fixes #number
  • Integration tests added

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.

Documentation / Examples

  • Make sure the linting passes

In the next major version we'll want to merge this PR that removes some of the long-time deprecated features, it'll have a positive effect on bundle size.
leerob
leerob previously approved these changes May 25, 2021
Copy link
Member

@leerob leerob left a comment

Choose a reason for hiding this comment

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

Docs LGTM

@timneutkens timneutkens marked this pull request as draft May 25, 2021 13:02
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@timneutkens timneutkens marked this pull request as ready for review June 1, 2021 12:00
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Jun 2, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
buildDuration 11.7s 12s ⚠️ +341ms
buildDurationCached 3.2s 3.2s ⚠️ +1ms
nodeModulesSize 46.7 MB 46.7 MB -16.9 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
/ failed reqs 0 0
/ total time (seconds) 2.084 2.076 -0.01
/ avg req/sec 1199.37 1204.48 +5.11
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.074 1.101 ⚠️ +0.03
/error-in-render avg req/sec 2326.87 2271.63 ⚠️ -55.24
Client Bundles (main, webpack, commons)
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 19.5 kB 19.5 kB
webpack-HASH.js gzip 804 B 804 B
Overall change 59.5 kB 59.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages Overall decrease ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
_app-HASH.js gzip 1.02 kB 801 B -219 B
_error-HASH.js gzip 3.07 kB 3.07 kB
amp-HASH.js gzip 527 B 527 B
css-HASH.js gzip 334 B 334 B
hooks-HASH.js gzip 890 B 890 B
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 333 B 333 B
withRouter-HASH.js gzip 330 B 330 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 8.53 kB 8.31 kB -219 B
Client Build Manifests
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
_buildManifest.js gzip 392 B 392 B
Overall change 392 B 392 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
index.html gzip 560 B 559 B -1 B
link.html gzip 570 B 567 B -3 B
withRouter.html gzip 557 B 556 B -1 B
Overall change 1.69 kB 1.68 kB -5 B

Diffs

Diff for _app-HASH.js
@@ -54,8 +54,6 @@
       var _interopRequireDefault = __webpack_require__(5318);
 
       exports.__esModule = true;
-      exports.Container = Container;
-      exports.createUrl = createUrl;
       exports.default = void 0;
 
       var _react = _interopRequireDefault(__webpack_require__(7294));
@@ -114,36 +112,15 @@
         }
 
         _createClass(App, [
-          {
-            key: "componentDidCatch",
-            // Kept here for backwards compatibility.
-            // When someone ended App they could call `super.componentDidCatch`.
-            // @deprecated This method is no longer needed. Errors are caught at the top level
-            value: function componentDidCatch(error, _errorInfo) {
-              throw error;
-            }
-          },
           {
             key: "render",
             value: function render() {
               var _this$props = this.props,
-                router = _this$props.router,
                 Component = _this$props.Component,
-                pageProps = _this$props.pageProps,
-                __N_SSG = _this$props.__N_SSG,
-                __N_SSP = _this$props.__N_SSP;
+                pageProps = _this$props.pageProps;
               return /*#__PURE__*/ _react["default"].createElement(
                 Component,
-                Object.assign(
-                  {},
-                  pageProps, // we don't add the legacy URL prop if it's using non-legacy
-                  // methods like getStaticProps and getServerSideProps
-                  !(__N_SSG || __N_SSP)
-                    ? {
-                        url: createUrl(router)
-                      }
-                    : {}
-                )
+                pageProps
               );
             }
           }
@@ -155,73 +132,6 @@
       exports.default = App;
       App.origGetInitialProps = appGetInitialProps;
       App.getInitialProps = appGetInitialProps;
-      var warnContainer;
-      var warnUrl;
-
-      if (false) {
-      } // @deprecated noop for now until removal
-
-      function Container(p) {
-        if (false) {
-        }
-        return p.children;
-      }
-
-      function createUrl(router) {
-        // This is to make sure we don't references the router object at call time
-        var pathname = router.pathname,
-          asPath = router.asPath,
-          query = router.query;
-        return {
-          get query() {
-            if (false) {
-            }
-            return query;
-          },
-
-          get pathname() {
-            if (false) {
-            }
-            return pathname;
-          },
-
-          get asPath() {
-            if (false) {
-            }
-            return asPath;
-          },
-
-          back: function back() {
-            if (false) {
-            }
-            router.back();
-          },
-          push: function push(url, as) {
-            if (false) {
-            }
-            return router.push(url, as);
-          },
-          pushTo: function pushTo(href, as) {
-            if (false) {
-            }
-            var pushRoute = as ? href : "";
-            var pushUrl = as || href;
-            return router.push(pushRoute, pushUrl);
-          },
-          replace: function replace(url, as) {
-            if (false) {
-            }
-            return router.replace(url, as);
-          },
-          replaceTo: function replaceTo(href, as) {
-            if (false) {
-            }
-            var replaceRoute = as ? href : "";
-            var replaceUrl = as || href;
-            return router.replace(replaceRoute, replaceUrl);
-          }
-        };
-      }
 
       /***/
     },
Diff for index.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/pages/_app-4c8c52e081f8bceed063.js"
+      href="/_next/static/chunks/pages/_app-28769756f9a0c21b149b.js"
       as="script"
     />
     <link
@@ -60,7 +60,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-4c8c52e081f8bceed063.js"
+      src="/_next/static/chunks/pages/_app-28769756f9a0c21b149b.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/pages/_app-4c8c52e081f8bceed063.js"
+      href="/_next/static/chunks/pages/_app-28769756f9a0c21b149b.js"
       as="script"
     />
     <link
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-4c8c52e081f8bceed063.js"
+      src="/_next/static/chunks/pages/_app-28769756f9a0c21b149b.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/pages/_app-4c8c52e081f8bceed063.js"
+      href="/_next/static/chunks/pages/_app-28769756f9a0c21b149b.js"
       as="script"
     />
     <link
@@ -60,7 +60,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-4c8c52e081f8bceed063.js"
+      src="/_next/static/chunks/pages/_app-28769756f9a0c21b149b.js"
       async=""
     ></script>
     <script

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
buildDuration 12.9s 12.5s -392ms
buildDurationCached 3.9s 4.1s ⚠️ +216ms
nodeModulesSize 46.7 MB 46.7 MB -16.9 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
framework-HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 19.5 kB 19.5 kB
webpack-HASH.js gzip 804 B 804 B
Overall change 59.5 kB 59.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages Overall decrease ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
_app-HASH.js gzip 1.02 kB 801 B -219 B
_error-HASH.js gzip 3.07 kB 3.07 kB
amp-HASH.js gzip 527 B 527 B
css-HASH.js gzip 334 B 334 B
hooks-HASH.js gzip 890 B 890 B
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 333 B 333 B
withRouter-HASH.js gzip 330 B 330 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 8.53 kB 8.31 kB -219 B
Client Build Manifests
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
_buildManifest.js gzip 392 B 392 B
Overall change 392 B 392 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
_error.js 16.9 kB 16.9 kB ⚠️ +2 B
404.html 2.42 kB 2.42 kB
500.html 2.41 kB 2.41 kB
amp.amp.html 10.8 kB 10.8 kB
amp.html 1.61 kB 1.61 kB
css.html 1.79 kB 1.79 kB
hooks.html 1.67 kB 1.67 kB
index.js 17.2 kB 17.2 kB
link.js 17.4 kB 17.4 kB
routerDirect.js 17.4 kB 17.4 kB ⚠️ +2 B
withRouter.js 17.4 kB 17.4 kB
Overall change 107 kB 107 kB ⚠️ +4 B

Webpack 4 Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
buildDuration 11.2s 10.7s -518ms
buildDurationCached 4.7s 4.6s -97ms
nodeModulesSize 46.7 MB 46.7 MB -16.9 kB
Page Load Tests Overall increase ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
/ failed reqs 0 0
/ total time (seconds) 2.152 2.15 0
/ avg req/sec 1161.61 1162.64 +1.03
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.197 1.089 -0.11
/error-in-render avg req/sec 2089.18 2294.81 +205.63
Client Bundles (main, webpack, commons)
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
677f882d2ed8..HASH.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 7.26 kB 7.26 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 60.3 kB 60.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages Overall decrease ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
_app-HASH.js gzip 1.28 kB 1.07 kB -210 B
_error-HASH.js gzip 3.74 kB 3.74 kB
amp-HASH.js gzip 536 B 536 B
css-HASH.js gzip 339 B 339 B
hooks-HASH.js gzip 887 B 887 B
index-HASH.js gzip 227 B 227 B
link-HASH.js gzip 1.63 kB 1.63 kB
routerDirect..HASH.js gzip 303 B 303 B
withRouter-HASH.js gzip 302 B 302 B
e025d2764813..52f.css gzip 125 B 125 B
Overall change 9.37 kB 9.16 kB -210 B
Client Build Manifests
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
_buildManifest.js gzip 420 B 420 B
Overall change 420 B 420 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary timneutkens/next.js add/remove-deprecated-features Change
index.html gzip 614 B 614 B
link.html gzip 620 B 620 B
withRouter.html gzip 608 B 607 B -1 B
Overall change 1.84 kB 1.84 kB -1 B

Diffs

Diff for _app-HASH.js
@@ -82,8 +82,6 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
       var _interopRequireDefault = __webpack_require__("TqRt");
 
       exports.__esModule = true;
-      exports.Container = Container;
-      exports.createUrl = createUrl;
       exports["default"] = void 0;
 
       var _react = _interopRequireDefault(__webpack_require__("q1tI"));
@@ -142,36 +140,15 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         }
 
         _createClass(App, [
-          {
-            key: "componentDidCatch",
-            // Kept here for backwards compatibility.
-            // When someone ended App they could call `super.componentDidCatch`.
-            // @deprecated This method is no longer needed. Errors are caught at the top level
-            value: function componentDidCatch(error, _errorInfo) {
-              throw error;
-            }
-          },
           {
             key: "render",
             value: function render() {
               var _this$props = this.props,
-                router = _this$props.router,
                 Component = _this$props.Component,
-                pageProps = _this$props.pageProps,
-                __N_SSG = _this$props.__N_SSG,
-                __N_SSP = _this$props.__N_SSP;
+                pageProps = _this$props.pageProps;
               return /*#__PURE__*/ _react["default"].createElement(
                 Component,
-                Object.assign(
-                  {},
-                  pageProps, // we don't add the legacy URL prop if it's using non-legacy
-                  // methods like getStaticProps and getServerSideProps
-                  !(__N_SSG || __N_SSP)
-                    ? {
-                        url: createUrl(router)
-                      }
-                    : {}
-                )
+                pageProps
               );
             }
           }
@@ -183,73 +160,6 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
       exports["default"] = App;
       App.origGetInitialProps = appGetInitialProps;
       App.getInitialProps = appGetInitialProps;
-      var warnContainer;
-      var warnUrl;
-
-      if (false) {
-      } // @deprecated noop for now until removal
-
-      function Container(p) {
-        if (false) {
-        }
-        return p.children;
-      }
-
-      function createUrl(router) {
-        // This is to make sure we don't references the router object at call time
-        var pathname = router.pathname,
-          asPath = router.asPath,
-          query = router.query;
-        return {
-          get query() {
-            if (false) {
-            }
-            return query;
-          },
-
-          get pathname() {
-            if (false) {
-            }
-            return pathname;
-          },
-
-          get asPath() {
-            if (false) {
-            }
-            return asPath;
-          },
-
-          back: function back() {
-            if (false) {
-            }
-            router.back();
-          },
-          push: function push(url, as) {
-            if (false) {
-            }
-            return router.push(url, as);
-          },
-          pushTo: function pushTo(href, as) {
-            if (false) {
-            }
-            var pushRoute = as ? href : "";
-            var pushUrl = as || href;
-            return router.push(pushRoute, pushUrl);
-          },
-          replace: function replace(url, as) {
-            if (false) {
-            }
-            return router.replace(url, as);
-          },
-          replaceTo: function replaceTo(href, as) {
-            if (false) {
-            }
-            var replaceRoute = as ? href : "";
-            var replaceUrl = as || href;
-            return router.replace(replaceRoute, replaceUrl);
-          }
-        };
-      }
 
       /***/
     },
Diff for index.html
@@ -27,7 +27,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/pages/_app-b27d78b0671a2f452859.js"
+      href="/_next/static/chunks/pages/_app-14e4eac7b0cda2ea09bf.js"
       as="script"
     />
     <link
@@ -69,7 +69,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-b27d78b0671a2f452859.js"
+      src="/_next/static/chunks/pages/_app-14e4eac7b0cda2ea09bf.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -27,7 +27,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/pages/_app-b27d78b0671a2f452859.js"
+      href="/_next/static/chunks/pages/_app-14e4eac7b0cda2ea09bf.js"
       as="script"
     />
     <link
@@ -74,7 +74,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-b27d78b0671a2f452859.js"
+      src="/_next/static/chunks/pages/_app-14e4eac7b0cda2ea09bf.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -27,7 +27,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/pages/_app-b27d78b0671a2f452859.js"
+      href="/_next/static/chunks/pages/_app-14e4eac7b0cda2ea09bf.js"
       as="script"
     />
     <link
@@ -69,7 +69,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-b27d78b0671a2f452859.js"
+      src="/_next/static/chunks/pages/_app-14e4eac7b0cda2ea09bf.js"
       async=""
     ></script>
     <script
Commit: e4ebeb8

@ijjk ijjk merged commit ed3e8f7 into vercel:canary Jun 2, 2021
@timneutkens timneutkens deleted the add/remove-deprecated-features branch June 2, 2021 15:24
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Jun 16, 2021
* Remove deprecated features

In the next major version we'll want to merge this PR that removes some of the long-time deprecated features, it'll have a positive effect on bundle size.

* Update tests

* Update tests

* Change unsized to layout=fill in test

* Update sizes

* Update rotation test

* Update size limit test

* Update test

* Update test

* Update test
@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.

None yet

3 participants