Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add string literal type for router events #15497

Closed
wants to merge 117 commits into from

Conversation

LauraBeatris
Copy link
Contributor

@LauraBeatris LauraBeatris commented Jul 26, 2020

Description

Refer to #15496

Just added a literal string type for the Router Events in order to improve the developer experience.

@ijjk
Copy link
Member

ijjk commented Jul 26, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 15.5s 15.4s -85ms
nodeModulesSize 66.5 MB 66.5 MB ⚠️ +442 B
Page Load Tests Overall increase ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.69 2.268 -0.42
/ avg req/sec 929.27 1102.21 +172.94
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.577 1.428 -0.15
/error-in-render avg req/sec 1585.59 1751.04 +165.45
Client Bundles (main, webpack, commons)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..7778.js gzip 10.2 kB 10.2 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
main-8da3811..3b61.js gzip 6.72 kB 6.72 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 87.6 kB 87.6 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.08 kB 6.08 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-43a8e8b..dule.js gzip 5.79 kB 5.79 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 82.6 kB 82.6 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-8e69b..8695.js gzip 3.41 kB 3.41 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-ddd176e..5566.js gzip 1.29 kB 1.29 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.66 kB 7.66 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-663e6..dule.js gzip 2.24 kB 2.24 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-69bc264..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.29 kB 5.29 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 275 B 275 B
_buildManife..dule.js gzip 281 B 281 B
Overall change 556 B 556 B
Rendered Page Sizes
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 946 B 946 B
link.html gzip 953 B 953 B
withRouter.html gzip 940 B 940 B
Overall change 2.84 kB 2.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 14s 14.2s ⚠️ +105ms
nodeModulesSize 66.5 MB 66.5 MB ⚠️ +442 B
Client Bundles (main, webpack, commons)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..7778.js gzip 10.2 kB 10.2 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
main-8da3811..3b61.js gzip 6.72 kB 6.72 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 87.6 kB 87.6 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.08 kB 6.08 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-43a8e8b..dule.js gzip 5.79 kB 5.79 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 82.6 kB 82.6 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-8e69b..8695.js gzip 3.41 kB 3.41 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-ddd176e..5566.js gzip 1.29 kB 1.29 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.66 kB 7.66 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-663e6..dule.js gzip 2.24 kB 2.24 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-69bc264..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.29 kB 5.29 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 275 B 275 B
_buildManife..dule.js gzip 281 B 281 B
Overall change 556 B 556 B
Serverless bundles
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 881 kB 881 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 881 kB 881 kB
link.js 922 kB 922 kB
routerDirect.js 916 kB 916 kB
withRouter.js 916 kB 916 kB
Overall change 4.52 MB 4.52 MB
Commit: 11caec5

@LauraBeatris
Copy link
Contributor Author

The yarn install --frozen-lockfile --check-files is working fine in my environment but is failing in the build job 🤔

Screen Shot 2020-07-26 at 11 51 41

@ijjk
Copy link
Member

ijjk commented Jul 26, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 13.2s 13.8s ⚠️ +615ms
nodeModulesSize 66.5 MB 66.5 MB ⚠️ +194 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.102 2.236 ⚠️ +0.13
/ avg req/sec 1189.61 1117.96 ⚠️ -71.65
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.457 1.6 ⚠️ +0.14
/error-in-render avg req/sec 1716.16 1562.56 ⚠️ -153.6
Client Bundles (main, webpack, commons)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..7778.js gzip 10.2 kB 10.2 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
main-8da3811..3b61.js gzip 6.72 kB 6.72 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 87.6 kB 87.6 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.08 kB 6.08 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-43a8e8b..dule.js gzip 5.79 kB 5.79 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 82.6 kB 82.6 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-8e69b..8695.js gzip 3.41 kB 3.41 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-ddd176e..5566.js gzip 1.29 kB 1.29 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.66 kB 7.66 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-663e6..dule.js gzip 2.24 kB 2.24 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-69bc264..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.29 kB 5.29 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 275 B 275 B
_buildManife..dule.js gzip 281 B 281 B
Overall change 556 B 556 B
Rendered Page Sizes
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 946 B 946 B
link.html gzip 953 B 953 B
withRouter.html gzip 940 B 940 B
Overall change 2.84 kB 2.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 13.4s 13.4s ⚠️ +38ms
nodeModulesSize 66.5 MB 66.5 MB ⚠️ +194 B
Client Bundles (main, webpack, commons)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..7778.js gzip 10.2 kB 10.2 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
main-8da3811..3b61.js gzip 6.72 kB 6.72 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 87.6 kB 87.6 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.08 kB 6.08 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-43a8e8b..dule.js gzip 5.79 kB 5.79 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 82.6 kB 82.6 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-8e69b..8695.js gzip 3.41 kB 3.41 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-ddd176e..5566.js gzip 1.29 kB 1.29 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.66 kB 7.66 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-663e6..dule.js gzip 2.24 kB 2.24 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-69bc264..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.29 kB 5.29 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 275 B 275 B
_buildManife..dule.js gzip 281 B 281 B
Overall change 556 B 556 B
Serverless bundles
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 881 kB 881 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 881 kB 881 kB
link.js 922 kB 922 kB
routerDirect.js 916 kB 916 kB
withRouter.js 916 kB 916 kB
Overall change 4.52 MB 4.52 MB
Commit: c93b9b1

@@ -38,7 +46,7 @@ const urlPropertyFields = [
'isFallback',
'basePath',
]
const routerEvents = [
const routerEvents: Array<RouterEvent> = [
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this automatically inferred by typescript 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be... But I don't why the auto-completion isn't working.

routerEvents.forEach((event) => {
  singletonRouter.ready(() => {
    Router.events.on(event, (...args) => {

Copy link
Member

@timneutkens timneutkens Jul 29, 2020

Choose a reason for hiding this comment

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

Had a look into this, the problem was that we use mitt without a generic type, so it would always be a set "string" type instead of the actual values.

I've pushed up a commit that adds a generic for mitt and then provides the values to it: 0476b70 (#15497) (thanks to @timsuchanek from Prisma who wrote the generic for mitt for me)

This only solves the first parameter tbh, you could take it a bit further by adding a generic for the function itself as well. E.g. the type autocomplete could be 'routeChangeComplete', (url: string) => void

Copy link
Contributor Author

@LauraBeatris LauraBeatris Jul 29, 2020

Choose a reason for hiding this comment

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

Thanks @timneutkens, really appreciate your help 😄

This only solves the first parameter tbh, you could take it a bit further by adding a generic for the function itself as well. E.g. the type autocomplete could be 'routeChangeComplete', (url: string) => void

Sure! I'll definitely send a commit for it


Btw, instead of repeating the same strings as in the routerEvents arrays just to declare a RouterEvent literal type, wouldn't be better to create a helper function to handle this?

For instance:

const asLiterals = <T extends string>(array: T[]): T[] => array
const routerEvents = asLiterals([
  'routeChangeStart',
  'beforeHistoryChange',
  'routeChangeComplete',
  'routeChangeError',
  'hashChangeStart',
  'hashChangeComplete',
])

Copy link
Member

Choose a reason for hiding this comment

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

Overall that would affect bundle size in a negative way as it introduces an extra function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@timneutkens Just added a generic for the event handler in 3483e1a and 1d76bdf

What do you think?

Co-Authored-By: Tim Suchanek <timsuchanek@users.noreply.github.com>
@ijjk
Copy link
Member

ijjk commented Jul 29, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 10.9s 11s ⚠️ +69ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +393 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 1.94 2.045 ⚠️ +0.1
/ avg req/sec 1288.48 1222.45 ⚠️ -66.03
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.289 1.258 -0.03
/error-in-render avg req/sec 1938.92 1987.61 +48.69
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..b7a9.js gzip 10.2 kB 10.2 kB -2 B
framework.HASH.js gzip 39.1 kB 39.1 kB
main-c5a676d..82de.js gzip 6.75 kB 6.75 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 87.6 kB 87.6 kB -2 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.09 kB 6.09 kB -3 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-079bffd..dule.js gzip 5.83 kB 5.83 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 82.6 kB 82.6 kB -3 B
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 947 B 946 B -1 B
link.html gzip 952 B 950 B -2 B
withRouter.html gzip 937 B 938 B ⚠️ +1 B
Overall change 2.84 kB 2.83 kB -2 B

Diffs

Diff for 677f882d2ed8..f9.module.js
@@ -674,6 +674,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         constructor(_pathname, _query, _as, _ref) {
           var {
             initialProps,
@@ -696,7 +698,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -774,10 +776,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for 677f882d2ed8..dbb170329.js
@@ -807,6 +807,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         function Router(_pathname, _query, _as, _ref) {
           var _this = this;
 
@@ -832,7 +834,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -918,10 +920,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 12.1s 12s -116ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +393 B
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..b7a9.js gzip 10.2 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
main-c5a676d..82de.js gzip 6.75 kB 6.75 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
677f882d2ed8..b2a8.js gzip N/A 10.2 kB N/A
Overall change 87.6 kB 87.6 kB -2 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.09 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-079bffd..dule.js gzip 5.83 kB 5.83 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.09 kB N/A
Overall change 82.6 kB 82.6 kB -3 B
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Serverless bundles Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.02 MB 1.02 MB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.02 MB 1.02 MB
link.js 1.06 MB 1.06 MB -27 B
routerDirect.js 1.05 MB 1.05 MB -27 B
withRouter.js 1.05 MB 1.05 MB -27 B
Overall change 5.2 MB 5.2 MB -81 B
Commit: 0476b70

@ijjk
Copy link
Member

ijjk commented Jul 29, 2020

Failing test suites

Commit: 0476b70

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@ijjk
Copy link
Member

ijjk commented Jul 30, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 12.8s 13s ⚠️ +180ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +415 B
Page Load Tests Overall increase ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.442 2.35 -0.09
/ avg req/sec 1023.78 1063.63 +39.85
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.503 1.469 -0.03
/error-in-render avg req/sec 1663.4 1701.31 +37.91
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..b7a9.js gzip 10.2 kB 10.2 kB -2 B
framework.HASH.js gzip 39.1 kB 39.1 kB
main-935e413..31c4.js gzip 6.76 kB 6.76 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 87.7 kB 87.7 kB -2 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.09 kB 6.09 kB -3 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-4b8f4a8..dule.js gzip 5.84 kB 5.84 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 82.6 kB 82.6 kB -3 B
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 945 B 944 B -1 B
link.html gzip 953 B 952 B -1 B
withRouter.html gzip 940 B 938 B -2 B
Overall change 2.84 kB 2.83 kB -4 B

Diffs

Diff for 677f882d2ed8..f9.module.js
@@ -674,6 +674,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         constructor(_pathname, _query, _as, _ref) {
           var {
             initialProps,
@@ -696,7 +698,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -774,10 +776,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for 677f882d2ed8..dbb170329.js
@@ -807,6 +807,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         function Router(_pathname, _query, _as, _ref) {
           var _this = this;
 
@@ -832,7 +834,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -918,10 +920,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 14.1s 14.2s ⚠️ +104ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +415 B
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..b7a9.js gzip 10.2 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
main-935e413..31c4.js gzip 6.76 kB 6.76 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
677f882d2ed8..b2a8.js gzip N/A 10.2 kB N/A
Overall change 87.7 kB 87.7 kB -2 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.09 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-4b8f4a8..dule.js gzip 5.84 kB 5.84 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.09 kB N/A
Overall change 82.6 kB 82.6 kB -3 B
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Serverless bundles Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.02 MB 1.02 MB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.02 MB 1.02 MB
link.js 1.06 MB 1.06 MB -27 B
routerDirect.js 1.05 MB 1.05 MB -27 B
withRouter.js 1.05 MB 1.05 MB -27 B
Overall change 5.2 MB 5.2 MB -81 B
Commit: 3483e1a

@ijjk
Copy link
Member

ijjk commented Jul 30, 2020

Failing test suites

Commit: 3483e1a

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@ijjk
Copy link
Member

ijjk commented Jul 30, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 12s 12.1s ⚠️ +84ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +426 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.184 2.285 ⚠️ +0.1
/ avg req/sec 1144.76 1094.18 ⚠️ -50.58
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.339 1.342 0
/error-in-render avg req/sec 1867.48 1862.6 ⚠️ -4.88
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..b7a9.js gzip 10.2 kB 10.2 kB -2 B
framework.HASH.js gzip 39.1 kB 39.1 kB
main-935e413..31c4.js gzip 6.76 kB 6.76 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 87.7 kB 87.7 kB -2 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.09 kB 6.09 kB -3 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-4b8f4a8..dule.js gzip 5.84 kB 5.84 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 82.6 kB 82.6 kB -3 B
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 945 B 944 B -1 B
link.html gzip 953 B 952 B -1 B
withRouter.html gzip 940 B 938 B -2 B
Overall change 2.84 kB 2.83 kB -4 B

Diffs

Diff for 677f882d2ed8..f9.module.js
@@ -674,6 +674,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         constructor(_pathname, _query, _as, _ref) {
           var {
             initialProps,
@@ -696,7 +698,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -774,10 +776,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for 677f882d2ed8..dbb170329.js
@@ -807,6 +807,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         function Router(_pathname, _query, _as, _ref) {
           var _this = this;
 
@@ -832,7 +834,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -918,10 +920,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 14.1s 13.5s -600ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +426 B
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..b7a9.js gzip 10.2 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
main-935e413..31c4.js gzip 6.76 kB 6.76 kB
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
webpack-488d..c0e7.js gzip 751 B 751 B
677f882d2ed8..b2a8.js gzip N/A 10.2 kB N/A
Overall change 87.7 kB 87.7 kB -2 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.09 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-4b8f4a8..dule.js gzip 5.84 kB 5.84 kB
polyfills-05..dule.js gzip 30.8 kB 30.8 kB
webpack-4f62..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.09 kB N/A
Overall change 82.6 kB 82.6 kB -3 B
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Serverless bundles Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.02 MB 1.02 MB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.02 MB 1.02 MB
link.js 1.06 MB 1.06 MB -27 B
routerDirect.js 1.05 MB 1.05 MB -27 B
withRouter.js 1.05 MB 1.05 MB -27 B
Overall change 5.2 MB 5.2 MB -81 B
Commit: 1d76bdf

@ijjk
Copy link
Member

ijjk commented Jul 30, 2020

Failing test suites

Commit: 1d76bdf

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@ijjk
Copy link
Member

ijjk commented Jul 30, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 11.6s 12s ⚠️ +346ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +426 B
Page Load Tests Overall increase ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.259 2.188 -0.07
/ avg req/sec 1106.69 1142.39 +35.7
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.361 1.369 ⚠️ +0.01
/error-in-render avg req/sec 1836.86 1826.05 ⚠️ -10.81
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..b7a9.js gzip 10.2 kB 10.2 kB -2 B
framework.HASH.js gzip 39.1 kB 39.1 kB
main-935e413..31c4.js gzip 6.76 kB 6.76 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 56.8 kB 56.8 kB -2 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.09 kB 6.09 kB -3 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-4b8f4a8..dule.js gzip 5.84 kB 5.84 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 51.8 kB 51.8 kB -3 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
Overall change 30.8 kB 30.8 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 945 B 944 B -1 B
link.html gzip 953 B 952 B -1 B
withRouter.html gzip 940 B 938 B -2 B
Overall change 2.84 kB 2.83 kB -4 B

Diffs

Diff for 677f882d2ed8..f9.module.js
@@ -674,6 +674,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         constructor(_pathname, _query, _as, _ref) {
           var {
             initialProps,
@@ -696,7 +698,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -774,10 +776,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for 677f882d2ed8..dbb170329.js
@@ -807,6 +807,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         function Router(_pathname, _query, _as, _ref) {
           var _this = this;
 
@@ -832,7 +834,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -918,10 +920,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.289defeb577dbb170329.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6fef26f6fcc5163ac62.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.277a28e61ddacb493af9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.52b6d685cb8986adc4b4.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 13.2s 14.1s ⚠️ +910ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +426 B
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..b7a9.js gzip 10.2 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
main-935e413..31c4.js gzip 6.76 kB 6.76 kB
webpack-488d..c0e7.js gzip 751 B 751 B
677f882d2ed8..b2a8.js gzip N/A 10.2 kB N/A
Overall change 56.8 kB 56.8 kB -2 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.09 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-4b8f4a8..dule.js gzip 5.84 kB 5.84 kB
webpack-4f62..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.09 kB N/A
Overall change 51.8 kB 51.8 kB -3 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
Overall change 30.8 kB 30.8 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Serverless bundles Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.02 MB 1.02 MB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.02 MB 1.02 MB
link.js 1.06 MB 1.06 MB -27 B
routerDirect.js 1.05 MB 1.05 MB -27 B
withRouter.js 1.05 MB 1.05 MB -27 B
Overall change 5.2 MB 5.2 MB -81 B
Commit: 037cba1

@ijjk
Copy link
Member

ijjk commented Jul 30, 2020

Failing test suites

Commit: 037cba1

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

export default function mitt(): MittEmitter {
const all: { [s: string]: Handler[] } = Object.create(null)

export default function mitt<T extends string, H extends Handler = Handler>() {
Copy link
Member

Choose a reason for hiding this comment

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

The handler changes per event type, so you'll likely want something like this: https://rjzaworski.com/2019/10/event-emitters-in-typescript

However in our case we have a handler for routeChangeError that has 2 parameters instead of one.

Copy link
Contributor Author

@LauraBeatris LauraBeatris Aug 1, 2020

Choose a reason for hiding this comment

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

Hey @timneutkens 😄

I did an event emitter for the router events, refer to https://codesandbox.io/s/nextjs-events-2in1n?file=/src/index.ts:785-1124

But I'm having some doubts in order to implement it with the current mitt

In order to type the handlers, we should pass a map type as a generic.

interface Mitt<T extends RouterEventMap> {
  on<K extends RouterEventKey<RouterEventMap>>(
    type: K,
    handler: RouterEventHandler<K>
  ): void;
  off<K extends RouterEventKey<RouterEventMap>>(
    type: K,
    handler: RouterEventHandler<K>
  ): void;
  emit<K extends RouterEventKey<RouterEventMap>>(type: K, ...evts: T[K]): void;
}

But the mitt function it's being used in two places:

Inside of the router.ts:

  static events = mitt<RouterEvent, (url: string) => void>()

Inside of the class ServerRouter:

  static events = mitt<string>()

The generic being passed to the mitt function above it's just a string, so there are two different cases.

How can we pass the RouterEventMap as a generic for the router emitter and a string as a generic for the ServerRouter events emitter?

Copy link
Member

@timneutkens timneutkens Aug 2, 2020

Choose a reason for hiding this comment

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

The one in ServerRouter could just be typed any I think, ServerRouter never uses the event emitter and it's purely there for backwards compatibility 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@timneutkens Just added the router events map, what do you think?

@ijjk
Copy link
Member

ijjk commented Aug 3, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 12.4s 13s ⚠️ +572ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +2.11 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.36 2.311 -0.05
/ avg req/sec 1059.23 1081.69 +22.46
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.209 1.369 ⚠️ +0.16
/error-in-render avg req/sec 2068.34 1825.52 ⚠️ -242.82
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..39a4.js gzip 10.2 kB 10.2 kB ⚠️ +10 B
framework.HASH.js gzip 39.1 kB 39.1 kB
main-5b25689..c07a.js gzip 6.73 kB 6.73 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 56.8 kB 56.8 kB ⚠️ +10 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.13 kB 6.14 kB ⚠️ +11 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-6ac1f4e..dule.js gzip 5.81 kB 5.81 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 51.8 kB 51.8 kB ⚠️ +11 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
Overall change 30.8 kB 30.8 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 946 B 944 B -2 B
link.html gzip 952 B 949 B -3 B
withRouter.html gzip 939 B 937 B -2 B
Overall change 2.84 kB 2.83 kB -7 B

Diffs

Diff for 677f882d2ed8..a9.module.js
@@ -504,10 +504,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           },
 
           off(type, handler) {
-            if (all[type]) {
-              // tslint:disable-next-line:no-bitwise
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
-            }
+            var _all$type; // tslint:disable-next-line:no-bitwise
+
+            (_all$type = all[type]) === null || _all$type === void 0
+              ? void 0
+              : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
           },
 
           emit(type) {
@@ -521,10 +522,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               evts[_key - 1] = arguments[_key];
             }
 
-            // eslint-disable-next-line array-callback-return
-            (all[type] || []).slice().map(handler => {
-              handler(...evts);
-            });
+            (all[type] || []).slice().map(
+              // eslint-disable-next-line array-callback-return
+              handler => {
+                handler(...evts);
+              }
+            );
           }
         };
       }
@@ -679,6 +682,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         constructor(_pathname, _query, _as, _ref) {
           var {
             initialProps,
@@ -701,7 +706,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -776,10 +781,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for 677f882d2ed8..7f15aafe7.js
@@ -626,10 +626,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             (all[type] || (all[type] = [])).push(handler);
           },
           off: function off(type, handler) {
-            if (all[type]) {
-              // tslint:disable-next-line:no-bitwise
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
-            }
+            var _all$type; // tslint:disable-next-line:no-bitwise
+
+            (_all$type = all[type]) === null || _all$type === void 0
+              ? void 0
+              : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
           },
           emit: function emit(type) {
             for (
@@ -642,10 +643,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               evts[_key - 1] = arguments[_key];
             }
 
-            // eslint-disable-next-line array-callback-return
-            (all[type] || []).slice().map(function(handler) {
-              handler.apply(void 0, evts);
-            });
+            (all[type] || []).slice().map(
+              // eslint-disable-next-line array-callback-return
+              function(handler) {
+                handler.apply(void 0, evts);
+              }
+            );
           }
         };
       }
@@ -812,6 +815,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         function Router(_pathname, _query, _as, _ref) {
           var _this = this;
 
@@ -837,7 +842,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -919,10 +924,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f620cea45847f15aafe7.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.30b4bcd24ba98e32f19f.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f620cea45847f15aafe7.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.30b4bcd24ba98e32f19f.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f620cea45847f15aafe7.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.30b4bcd24ba98e32f19f.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 13.7s 13.6s -87ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +2.11 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..39a4.js gzip 10.2 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
main-5b25689..c07a.js gzip 6.73 kB 6.73 kB
webpack-488d..c0e7.js gzip 751 B 751 B
677f882d2ed8..4ce7.js gzip N/A 10.2 kB N/A
Overall change 56.8 kB 56.8 kB ⚠️ +10 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.13 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-6ac1f4e..dule.js gzip 5.81 kB 5.81 kB
webpack-4f62..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.14 kB N/A
Overall change 51.8 kB 51.8 kB ⚠️ +11 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
Overall change 30.8 kB 30.8 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.02 MB 1.02 MB ⚠️ +59 B
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.02 MB 1.02 MB ⚠️ +59 B
link.js 1.06 MB 1.06 MB ⚠️ +32 B
routerDirect.js 1.05 MB 1.05 MB ⚠️ +32 B
withRouter.js 1.05 MB 1.05 MB ⚠️ +32 B
Overall change 5.2 MB 5.2 MB ⚠️ +214 B
Commit: dabc6dc

@ijjk
Copy link
Member

ijjk commented Aug 3, 2020

Failing test suites

Commit: dabc6dc

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@ijjk
Copy link
Member

ijjk commented Aug 3, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 10.4s 12.1s ⚠️ +1.8s
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +2.11 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 1.85 2.113 ⚠️ +0.26
/ avg req/sec 1351.48 1182.92 ⚠️ -168.56
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 0.995 1.187 ⚠️ +0.19
/error-in-render avg req/sec 2512.45 2106.96 ⚠️ -405.49
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..39a4.js gzip 10.2 kB 10.2 kB ⚠️ +10 B
framework.HASH.js gzip 39.1 kB 39.1 kB
main-5b25689..c07a.js gzip 6.73 kB 6.73 kB
webpack-488d..c0e7.js gzip 751 B 751 B
Overall change 56.8 kB 56.8 kB ⚠️ +10 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.13 kB 6.14 kB ⚠️ +11 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-6ac1f4e..dule.js gzip 5.81 kB 5.81 kB
webpack-4f62..dule.js gzip 751 B 751 B
Overall change 51.8 kB 51.8 kB ⚠️ +11 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
Overall change 30.8 kB 30.8 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 946 B 944 B -2 B
link.html gzip 952 B 949 B -3 B
withRouter.html gzip 939 B 937 B -2 B
Overall change 2.84 kB 2.83 kB -7 B

Diffs

Diff for 677f882d2ed8..a9.module.js
@@ -504,10 +504,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           },
 
           off(type, handler) {
-            if (all[type]) {
-              // tslint:disable-next-line:no-bitwise
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
-            }
+            var _all$type; // tslint:disable-next-line:no-bitwise
+
+            (_all$type = all[type]) === null || _all$type === void 0
+              ? void 0
+              : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
           },
 
           emit(type) {
@@ -521,10 +522,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               evts[_key - 1] = arguments[_key];
             }
 
-            // eslint-disable-next-line array-callback-return
-            (all[type] || []).slice().map(handler => {
-              handler(...evts);
-            });
+            (all[type] || []).slice().map(
+              // eslint-disable-next-line array-callback-return
+              handler => {
+                handler(...evts);
+              }
+            );
           }
         };
       }
@@ -679,6 +682,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         constructor(_pathname, _query, _as, _ref) {
           var {
             initialProps,
@@ -701,7 +706,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -776,10 +781,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for 677f882d2ed8..7f15aafe7.js
@@ -626,10 +626,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             (all[type] || (all[type] = [])).push(handler);
           },
           off: function off(type, handler) {
-            if (all[type]) {
-              // tslint:disable-next-line:no-bitwise
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
-            }
+            var _all$type; // tslint:disable-next-line:no-bitwise
+
+            (_all$type = all[type]) === null || _all$type === void 0
+              ? void 0
+              : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
           },
           emit: function emit(type) {
             for (
@@ -642,10 +643,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               evts[_key - 1] = arguments[_key];
             }
 
-            // eslint-disable-next-line array-callback-return
-            (all[type] || []).slice().map(function(handler) {
-              handler.apply(void 0, evts);
-            });
+            (all[type] || []).slice().map(
+              // eslint-disable-next-line array-callback-return
+              function(handler) {
+                handler.apply(void 0, evts);
+              }
+            );
           }
         };
       }
@@ -812,6 +815,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
          * Map of all components loaded in `Router`
          */
         // Static Data Cache
+        // Backwards compat for Router.router.events
+        // TODO: Should be remove the following major version as it was never documented
         function Router(_pathname, _query, _as, _ref) {
           var _this = this;
 
@@ -837,7 +842,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.clc = void 0;
           this.pageLoader = void 0;
           this._bps = void 0;
-          this.events = void 0;
+          this.events = Router.events;
           this._wrapApp = void 0;
           this.isSsr = void 0;
           this.isFallback = void 0;
@@ -919,10 +924,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           this.components["/_app"] = {
             Component: App
-          }; // Backwards compat for Router.router.events
-          // TODO: Should be remove the following major version as it was never documented
-
-          this.events = Router.events;
+          };
           this.pageLoader = pageLoader;
           this.pathname = _pathname;
           this.query = _query; // if auto prerendered and dynamic route wait to update asPath
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f620cea45847f15aafe7.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.30b4bcd24ba98e32f19f.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f620cea45847f15aafe7.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.30b4bcd24ba98e32f19f.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f620cea45847f15aafe7.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.30b4bcd24ba98e32f19f.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2ff1b0f9c6fe451560a9.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2cbe9f875432c73f1e23.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 13.5s 12.9s -582ms
nodeModulesSize 65.5 MB 65.5 MB ⚠️ +2.11 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..39a4.js gzip 10.2 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
main-5b25689..c07a.js gzip 6.73 kB 6.73 kB
webpack-488d..c0e7.js gzip 751 B 751 B
677f882d2ed8..4ce7.js gzip N/A 10.2 kB N/A
Overall change 56.8 kB 56.8 kB ⚠️ +10 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.13 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-6ac1f4e..dule.js gzip 5.81 kB 5.81 kB
webpack-4f62..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.14 kB N/A
Overall change 51.8 kB 51.8 kB ⚠️ +11 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-05..1236.js gzip 30.8 kB 30.8 kB
Overall change 30.8 kB 30.8 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-8f5f611..1f7b.js gzip 1.28 kB 1.28 kB
_error-a98d9..5cb7.js gzip 3.45 kB 3.45 kB
hooks-f7f3d0..7465.js gzip 887 B 887 B
index-08fb3f..c0e9.js gzip 227 B 227 B
link-6f8445b..99e1.js gzip 1.3 kB 1.3 kB
routerDirect..8aa1.js gzip 284 B 284 B
withRouter-f..e777.js gzip 284 B 284 B
Overall change 7.72 kB 7.72 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-669dbe5..dule.js gzip 626 B 626 B
_error-d5979..dule.js gzip 2.3 kB 2.3 kB
hooks-805c40..dule.js gzip 387 B 387 B
index-6ba5a4..dule.js gzip 226 B 226 B
link-91516ae..dule.js gzip 1.25 kB 1.25 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-d..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 274 B 274 B
_buildManife..dule.js gzip 282 B 282 B
Overall change 556 B 556 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.02 MB 1.02 MB ⚠️ +59 B
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.02 MB 1.02 MB ⚠️ +59 B
link.js 1.06 MB 1.06 MB ⚠️ +32 B
routerDirect.js 1.05 MB 1.05 MB ⚠️ +32 B
withRouter.js 1.05 MB 1.05 MB ⚠️ +32 B
Overall change 5.2 MB 5.2 MB ⚠️ +214 B
Commit: dabc6dc

@ijjk
Copy link
Member

ijjk commented Sep 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 13.2s 13.5s ⚠️ +226ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Page Load Tests Overall increase ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.558 2.457 -0.1
/ avg req/sec 977.38 1017.38 +40
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.487 1.506 ⚠️ +0.02
/error-in-render avg req/sec 1680.84 1659.56 ⚠️ -21.28
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB 10.9 kB ⚠️ +6 B
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB 6.78 kB ⚠️ +12 B
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB -1 B
withRouter.html gzip 997 B 993 B -4 B
Overall change 3.01 kB 3 kB -5 B

Diffs

Diff for 677f882d2ed8..5fa35cac6.js
@@ -652,7 +652,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           },
           off: function off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
           emit: function emit(type) {
@@ -700,12 +704,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports["default"] = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for 677f882d2ed8..aa.module.js
@@ -522,7 +522,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
 
@@ -561,12 +565,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports.default = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -126,13 +126,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 15.4s 15.5s ⚠️ +79ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..115b.js gzip N/A 10.9 kB N/A
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.78 kB N/A
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.04 MB 1.04 MB ⚠️ +75 B
404.html 4.34 kB 4.34 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.04 MB 1.04 MB ⚠️ +75 B
link.js 1.08 MB 1.08 MB ⚠️ +75 B
routerDirect.js 1.08 MB 1.08 MB ⚠️ +75 B
withRouter.js 1.08 MB 1.08 MB ⚠️ +75 B
Overall change 5.31 MB 5.31 MB ⚠️ +375 B
Commit: 1c49b4b

@ijjk
Copy link
Member

ijjk commented Sep 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 12.6s 12.7s ⚠️ +93ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.298 2.316 ⚠️ +0.02
/ avg req/sec 1087.93 1079.6 ⚠️ -8.33
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.216 1.263 ⚠️ +0.05
/error-in-render avg req/sec 2056.4 1978.91 ⚠️ -77.49
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB 10.9 kB ⚠️ +6 B
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB 6.78 kB ⚠️ +12 B
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB -1 B
withRouter.html gzip 997 B 993 B -4 B
Overall change 3.01 kB 3 kB -5 B

Diffs

Diff for 677f882d2ed8..5fa35cac6.js
@@ -652,7 +652,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           },
           off: function off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
           emit: function emit(type) {
@@ -700,12 +704,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports["default"] = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for 677f882d2ed8..aa.module.js
@@ -522,7 +522,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
 
@@ -561,12 +565,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports.default = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -126,13 +126,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 14.2s 14.2s ⚠️ +65ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..115b.js gzip N/A 10.9 kB N/A
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.78 kB N/A
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.04 MB 1.04 MB ⚠️ +75 B
404.html 4.34 kB 4.34 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.04 MB 1.04 MB ⚠️ +75 B
link.js 1.08 MB 1.08 MB ⚠️ +75 B
routerDirect.js 1.08 MB 1.08 MB ⚠️ +75 B
withRouter.js 1.08 MB 1.08 MB ⚠️ +75 B
Overall change 5.31 MB 5.31 MB ⚠️ +375 B
Commit: bdf2220

@ijjk
Copy link
Member

ijjk commented Sep 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 14.4s 14s -422ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Page Load Tests Overall increase ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.676 2.755 ⚠️ +0.08
/ avg req/sec 934.23 907.6 ⚠️ -26.63
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.626 1.591 -0.03
/error-in-render avg req/sec 1537.23 1571.71 +34.48
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB 10.9 kB ⚠️ +6 B
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB 6.78 kB ⚠️ +12 B
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB -1 B
withRouter.html gzip 997 B 993 B -4 B
Overall change 3.01 kB 3 kB -5 B

Diffs

Diff for 677f882d2ed8..5fa35cac6.js
@@ -652,7 +652,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           },
           off: function off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
           emit: function emit(type) {
@@ -700,12 +704,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports["default"] = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for 677f882d2ed8..aa.module.js
@@ -522,7 +522,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
 
@@ -561,12 +565,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports.default = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -126,13 +126,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 17s 16.1s -865ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..115b.js gzip N/A 10.9 kB N/A
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.78 kB N/A
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.04 MB 1.04 MB ⚠️ +75 B
404.html 4.34 kB 4.34 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.04 MB 1.04 MB ⚠️ +75 B
link.js 1.08 MB 1.08 MB ⚠️ +75 B
routerDirect.js 1.08 MB 1.08 MB ⚠️ +75 B
withRouter.js 1.08 MB 1.08 MB ⚠️ +75 B
Overall change 5.31 MB 5.31 MB ⚠️ +375 B
Commit: e4c531b

@ijjk
Copy link
Member

ijjk commented Sep 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 14.7s 14.9s ⚠️ +164ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Page Load Tests Overall increase ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.729 2.751 ⚠️ +0.02
/ avg req/sec 916.19 908.75 ⚠️ -7.44
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.673 1.663 -0.01
/error-in-render avg req/sec 1494.11 1503.08 +8.97
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB 10.9 kB ⚠️ +6 B
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB 6.78 kB ⚠️ +12 B
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB -1 B
withRouter.html gzip 997 B 993 B -4 B
Overall change 3.01 kB 3 kB -5 B

Diffs

Diff for 677f882d2ed8..5fa35cac6.js
@@ -652,7 +652,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           },
           off: function off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
           emit: function emit(type) {
@@ -700,12 +704,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports["default"] = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for 677f882d2ed8..aa.module.js
@@ -522,7 +522,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
 
@@ -561,12 +565,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports.default = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -126,13 +126,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 16.4s 16.3s -112ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..115b.js gzip N/A 10.9 kB N/A
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.78 kB N/A
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.04 MB 1.04 MB ⚠️ +75 B
404.html 4.34 kB 4.34 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.04 MB 1.04 MB ⚠️ +75 B
link.js 1.08 MB 1.08 MB ⚠️ +75 B
routerDirect.js 1.08 MB 1.08 MB ⚠️ +75 B
withRouter.js 1.08 MB 1.08 MB ⚠️ +75 B
Overall change 5.31 MB 5.31 MB ⚠️ +375 B
Commit: 1c3e920

@ijjk
Copy link
Member

ijjk commented Sep 20, 2020

Failing test suites

Commit: 1c49b4b

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@ijjk
Copy link
Member

ijjk commented Sep 20, 2020

Failing test suites

Commit: 1c49b4b

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@ijjk
Copy link
Member

ijjk commented Sep 20, 2020

Failing test suites

Commit: 1c3e920

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@ijjk
Copy link
Member

ijjk commented Sep 20, 2020

Failing test suites

Commit: bdf2220

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

@LauraBeatris Thank you for the all of the changes! I'll let @timneutkens do the final review 👌

@ijjk
Copy link
Member

ijjk commented Sep 21, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 12.4s 12.4s ⚠️ +35ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
/ failed reqs 0 0
/ total time (seconds) 2.26 2.303 ⚠️ +0.04
/ avg req/sec 1106.09 1085.52 ⚠️ -20.57
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.338 1.499 ⚠️ +0.16
/error-in-render avg req/sec 1868.76 1667.69 ⚠️ -201.07
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB 10.9 kB ⚠️ +6 B
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB 6.78 kB ⚠️ +12 B
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB -1 B
withRouter.html gzip 997 B 993 B -4 B
Overall change 3.01 kB 3 kB -5 B

Diffs

Diff for 677f882d2ed8..5fa35cac6.js
@@ -652,7 +652,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           },
           off: function off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
           emit: function emit(type) {
@@ -700,12 +704,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports["default"] = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for 677f882d2ed8..aa.module.js
@@ -522,7 +522,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           off(type, handler) {
             if (all[type]) {
-              all[type].splice(all[type].indexOf(handler) >>> 0, 1);
+              var _all$type;
+
+              (_all$type = all[type]) == null
+                ? void 0
+                : _all$type.splice((all[type] || []).indexOf(handler) >>> 0, 1);
             }
           },
 
@@ -561,12 +565,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports.default = void 0;
 
+      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
+
       var _normalizeTrailingSlash = __webpack_require__("X24+");
 
       var _denormalizePagePath = __webpack_require__("wkBG");
 
-      var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
-
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -126,13 +126,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2730f3273c05fa35cac6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.bd1f65de3c9385441371.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ed82f38c7a1994b728aa.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9863bcfccb4762caf01a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
buildDuration 13.6s 13.6s ⚠️ +3ms
nodeModulesSize 62.9 MB 62.9 MB ⚠️ +3 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..9339.js gzip 10.9 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-772ea11..1d22.js gzip 7.16 kB 7.16 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..115b.js gzip N/A 10.9 kB N/A
Overall change 57.8 kB 57.8 kB ⚠️ +6 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
677f882d2ed8..dule.js gzip 6.77 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-911f3f8..dule.js gzip 6.23 kB 6.23 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.78 kB N/A
Overall change 52.7 kB 52.7 kB ⚠️ +12 B
Legacy Client Bundles (polyfills)
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary LauraBeatris/next.js add-route-events-types Change
_error.js 1.04 MB 1.04 MB ⚠️ +75 B
404.html 4.34 kB 4.34 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.04 MB 1.04 MB ⚠️ +75 B
link.js 1.08 MB 1.08 MB ⚠️ +75 B
routerDirect.js 1.08 MB 1.08 MB ⚠️ +75 B
withRouter.js 1.08 MB 1.08 MB ⚠️ +75 B
Overall change 5.31 MB 5.31 MB ⚠️ +375 B
Commit: 1cc71c3

@ijjk
Copy link
Member

ijjk commented Sep 21, 2020

Failing test suites

Commit: 1cc71c3

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@LauraBeatris
Copy link
Contributor Author

@timneutkens May I get another code review? 😄

@ijjk
Copy link
Member

ijjk commented Sep 29, 2020

Failing test suites

Commit: af88d8b

test/integration/build-output/test/index.test.js

  • Build Output > Basic Application Output > should not deviate from snapshot
Expand output

● Build Output › Basic Application Output › should not deviate from snapshot

expect(received).toBeLessThanOrEqual(expected)

Expected: <= 0
Received:    0.10000000000000142

  102 |       expect(err404Size.endsWith('kB')).toBe(true)
  103 | 
> 104 |       expect(parseFloat(err404FirstLoad) - 63.8).toBeLessThanOrEqual(0)
      |                                                  ^
  105 |       expect(err404FirstLoad.endsWith('kB')).toBe(true)
  106 | 
  107 |       expect(parseFloat(sharedByAll) - 60.4).toBeLessThanOrEqual(0)

  at Object.<anonymous> (integration/build-output/test/index.test.js:104:50)

@ijjk
Copy link
Member

ijjk commented Sep 29, 2020

Failing test suites

Commit: af88d8b

test/integration/typescript/test/index.test.js

  • TypeScript Features > should build the app
  • TypeScript Features > should compile with different types > should compile async getInitialProps for _error
Expand output

● TypeScript Features › should build the app

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  92 |   it('should build the app', async () => {
  93 |     const output = await nextBuild(appDir, [], { stdout: true })
> 94 |     expect(output.stdout).toMatch(/Compiled successfully/)
     |                           ^
  95 |     expect(output.code).toBe(0)
  96 |   })
  97 | 

  at Object.<anonymous> (integration/typescript/test/index.test.js:94:27)

● TypeScript Features › should compile with different types › should compile async getInitialProps for _error

expect(received).toMatch(expected)

Expected pattern: /Compiled successfully/
Received string:  "info  - Creating an optimized production build...
"

  102 |         errorPage.replace('static ', 'static async ')
  103 |         const output = await nextBuild(appDir, [], { stdout: true })
> 104 |         expect(output.stdout).toMatch(/Compiled successfully/)
      |                               ^
  105 |       } finally {
  106 |         errorPage.restore()
  107 |       }

  at Object.<anonymous> (integration/typescript/test/index.test.js:104:31)

@lfades lfades removed examples Issue/PR related to examples type: documentation create-next-app Related to our CLI tool for quickly starting a new Next.js application. labels Nov 9, 2020
@lfades lfades mentioned this pull request Nov 24, 2020
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

// This file is based on https://github.com/developit/mitt/blob/v1.1.3/src/index.js
// It's been edited for the needs of this script
// See the LICENSE at the top of the file

type Handler = (...evts: any[]) => void
export type EventType =
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately this still looks incorrect. The lib/mitt file should not know about the implementation details of the Next.js router.

@Thisen Thisen mentioned this pull request Jun 1, 2021
2 tasks
@kodiakhq kodiakhq bot closed this in #26456 Jun 22, 2021
kodiakhq bot pushed a commit that referenced this pull request Jun 22, 2021
This strongly types `Router.events.on` and `Router.events.off`. Previously the event type was `string` but now it's `'routeChangeStart' | 'beforeHistoryChange' | 'routeChangeComplete' | 'routeChangeError' | 'hashChangeStart' | 'hashChangeComplete'`


## Bug

- ~[ ] Related issues linked using `fixes #number`~
- [x] Integration tests added

Closes #25679
Closes #23753
Closes #15497
flybayer added a commit to blitz-js/next.js that referenced this pull request Jun 24, 2021
This strongly types `Router.events.on` and `Router.events.off`. Previously the event type was `string` but now it's `'routeChangeStart' | 'beforeHistoryChange' | 'routeChangeComplete' | 'routeChangeError' | 'hashChangeStart' | 'hashChangeComplete'`


## Bug

- ~[ ] Related issues linked using `fixes #number`~
- [x] Integration tests added

Closes vercel#25679
Closes vercel#23753
Closes vercel#15497
leimonio added a commit to leimonio/next.js that referenced this pull request Jul 6, 2021
* [WIP] Add cms notion integration example - index page

* Add cover images for pages

* Add post page

* Remove preview functionality

* Add module.exports to security headers documentation (vercel#26466)

Without `module.exports`, the provided code won't work if just pasted into `next.config.js`

## Documentation / Examples

- [x] Make sure the linting passes

* fix: ignore invalid accept-language header (vercel#26476)



Fixes vercel#22329

## Bug

- [x] Related issues linked using fixes vercel#22329
- [x] 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

* chore: Add Alex to lint documentation (vercel#26354)

This Pull Request adds [Alex](https://alexjs.com/) to our documentation. It catches insensitive, inconsiderate writing. 

The original PR (vercel#25821) is too large so I have decided to break it down into smaller PRs. This PR is the first part. Then I will continue to add the rest of the documentation in smaller PRs.

## More Information on Alex:
https://alexjs.com/
https://github.com/get-alex/alex

## Documentation / Examples

- [x] Make sure the linting passes

* Fix domain locales not available on client (vercel#26083)

* bug: Fix domain locales not available on client

* Add test case

* update tests

Co-authored-by: JJ Kasper <jj@jjsweb.site>

* Update to only add image import types when enabled (vercel#26485)

* Update to only add image import types when enabled

* add type check to test

* Update i18n fields in docs (vercel#26492)



Closes: vercel#24991

## Documentation / Examples

- [x] Make sure the linting passes

* v11.0.1-canary.7

* Strongly type `Router.events.on` and `Router.events.off` (vercel#26456)

This strongly types `Router.events.on` and `Router.events.off`. Previously the event type was `string` but now it's `'routeChangeStart' | 'beforeHistoryChange' | 'routeChangeComplete' | 'routeChangeError' | 'hashChangeStart' | 'hashChangeComplete'`


## Bug

- ~[ ] Related issues linked using `fixes #number`~
- [x] Integration tests added

Closes vercel#25679
Closes vercel#23753
Closes vercel#15497

* Update next Link & Image components

* Ensure image-types file is included (vercel#26495)

* Update react & react-dom to v17

* Update tailwind to use jit

* v11.0.1-canary.8

* v11.0.1

* Don't test image domains in test env (vercel#26502)

fixes vercel#21549

Co-authored-by: JJ Kasper <jj@jjsweb.site>

* docs: updated minimum Node.js version (vercel#26528)

## Documentation / Examples

- [x] Make sure the linting passes


According to new requirements in `package.json` minimum Node.js version for now is 12.0

* Update next-env note in docs (vercel#26536)

This ensures we don't recommend editing the `next-env` file since we need to be able to tweak it to accept future types we add in Next.js


## Documentation / Examples

- [x] Make sure the linting passes

Closes: vercel#26533

* [examples] Fix ssr-caching example. (vercel#26540)

Closes vercel#12019 with a better example of proper SSR caching.

* Fix props not updating when changing the locale and keeping hash (vercel#26205)



Currently, there is only a `hashChangeStart` and subsequent `hashChangeComplete` event and no props update (which would be used to get translations, etc.).
Happy for any feedback

fixes vercel#23467

## Bug

- [x] Related issues linked using `fixes #number`
- [x] 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

* Add note about adding additional types (vercel#26545)

* Add note about adding additional types

* Update to bold edit also

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* Allow user to override next-image-loader (vercel#26548)

In PR vercel#26281, we solved one use case but broke another.

This PR will allow the user to [override the built-in loader](vercel#26281 (comment)) via custom webpack config.

* v11.0.2-canary.0

* chore: Enable Alex documentation linting for error pages (vercel#26526)

* Update SWR example to include fetcher function. (vercel#26520)

* Previous example doesn't work

* Apply suggestions from code review

* Update docs/basic-features/data-fetching.md

* lint-fix

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>

* tailwind examps upgraded to v2.2 (vercel#26549)



## Documentation / Examples

- [x] Make sure the linting passes

* doc: prettify docs for next script (vercel#26572)



x-ref: vercel#26518 (comment)

## Documentation / Examples

- [x] Make sure the linting passes

* Add logging when a custom babelrc is loaded (vercel#26570)

Partially solves vercel#26539 by adding back the log output when a config file is used



## 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

* Add comment to not edit in next-env file (vercel#26573)

This adds a comment to the generated `next-env.d.ts` to mention it should not be edited pointing to the documentation which contains an example of adding custom types separately. 

x-ref: vercel#26560

## Documentation / Examples

- [x] Make sure the linting passes

* Separate node polyfill test from basic suite (vercel#26550)

* Separate node polyfill test from basic suite

* update test

* fix with-loading example for next 11 (vercel#26569)

## Documentation / Examples

- [X] Make sure the linting passes

This PR updates the with-loading example to follow the documentation of router events for next 11

* v11.0.2-canary.1

* Add trace url on bootup (vercel#26594)

* Add trace url on bootup

* Update whitelist -> accesslist

* Add name to webpack-invalidated

* v11.0.2-canary.2

* Add check for ObjectExpression when iterating on <link> tags for font optimization (vercel#26608)

Fixes vercel#26547



## Bug

- [x] Related issues linked using `fixes #number`
- [x] 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

* Enable Alex documentation linting for docs (vercel#26598)

* Add link to live demo already hosted (vercel#25718)

* Add link to live demo already hosted

To make it easier for people to simply see the live example without having to deploy a whole new project

* update link


Co-authored-by: JJ Kasper <jj@jjsweb.site>

* Update next/image docs for relative parent with layout=fill. (vercel#26615)

vercel#18739 (reply in thread)

* Fix GSP redirect cache error (vercel#26627)

This makes sure we don't attempt flushing cache info to disk for `getStaticProps` `redirect` items with `revalidate`

Fixes: vercel#20816

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

* Correct statusCode when visiting _error directly (vercel#26610)

This fixes non-stop reloading when visiting `_error` directly in development caused by the `statusCode` being 200 unexpectedly while HMR returns the page as `invalid` which triggers `on-demand-entries` to reload the page. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

Fixes: vercel#8036
x-ref: vercel#8033

* fix: next dynamic with jest (vercel#26614)



Fixes vercel#19862

Avoid executing `webpack` property on `loadableGenerated` of loadable component compiled from `next/dynamic` when `require.resolveWeak` is unavailable due to jest runtime missing `require.resolveWeak`.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] unit tests added

* Ensure API routes are not available under the locale (vercel#26629)

This ensures API routes are not available under the locale path since API routes don't need to be localized and we don't provide the locale to the API in any way currently so the user wouldn't be aware if the localized API route was visited instead of the non-localized. 

Fixes: vercel#25790

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

* v11.0.2-canary.3

* Fix image content type octet stream 400 (vercel#26705)

Fixes vercel#23523 by adding image content type detection

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

* Update layouts example to persist state across client-side transitions. (vercel#26706)

* Update layouts example

* Update examples/layout-component/components/layout.js

Co-authored-by: JJ Kasper <jj@jjsweb.site>

* Fix typo on "occured" to "occurred" (vercel#26709)

* fix: typo occured -> occurred

* fix: typo occured -> occurred

* fix: typo occured -> occurred

* fix: typo occured -> occurred

* lint-fix


Co-authored-by: JJ Kasper <jj@jjsweb.site>

* [ESLint] Adds --max-warnings flag to `next lint` (vercel#26697)

Adds `--max-warnings` flag to `next lint` to enable setting of a maximum warning threshold.

Fixes vercel#26671

* update with-redux-toolkit-typescript (vercel#26714)



## Bug

- [X] Related issues linked using `fixes vercel#26713 `

## 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

- [X] Make sure the linting passes

## Screenshots

After this small change the warning disappears.
![image](https://user-images.githubusercontent.com/47717492/123749377-fd56fb80-d8d2-11eb-8b70-dbb7f6f16050.png)

* Simplify `next-dev-server` implementation (vercel#26230)

`next-dev-server` having its own implementations of `renderToHTML` and `renderErrorToHTML` has historically made reasoning about streaming hard, as it adds additional places where status codes are explicitly set and the full HTML is blocked on.

Instead, this PR simplifies things considerably by moving the majority of the custom logic for e.g. hot reloading and on-demand compilation to when we're resolving the page to be loaded, rather than upfront when handling the request. It also cleans up a few other details (e.g. default error page rendering) that managed to creep into the base implementation over time.

One unfortunate side effect is that this makes compilation errors slightly more difficult. Previously, we'd render them directly. Now, we have to rethrow them. But since they've already been logged (by the watch pipeline), we have to make sure they don't get logged again.

* Update PR labeler action

* Simplify stats action (vercel#26751)

* Move code shared between server/client to "shared" folder (vercel#26734)

* Move next-server directory files to server directory (vercel#26756)

* Move next-server directory files to server directory

* Update tests

* Update paths in other places

* Support new hydrate API in latest react 18 alpha release (vercel#26664)

* fix: react 18 new hydration API

* support react 18

* compat latest react only, fix resolved version

* fix tests

* Some changes based on reactwg/react-18#5

* fix test

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* Disable build-output size specific tests (vercel#26769)

* Disable build-output size specific tests

* remove size-limit test

* lint-fix

* Add upstream `max-age` to optimized image (vercel#26739)

This solves the main use case from Issue vercel#19914.

Previously, we would set the `Cache-Control` header to a constant and rely on the server cache. This would mean the browser would always request the image and the server could response with 304 Not Modified to omit the response body.

This PR changes the behavior such that the `max-age` will propagate from the upstream server to the Next.js Image Optimization Server and allow browser caching. ("upstream" meaning external server or just an internal route to an image)

This PR does not change the `max-age` for static imports which will remain `public, max-age=315360000, immutable`.

#### Pros:
- Fewer HTTP requests after initial browser visit
- User configurable `max-age` via the upstream image `Cache-Control` header

#### Cons:
- ~~Might be annoying for `next dev` when modifying a source image~~ (solved: use `max-age=0` for dev)
- Might cause browser to cache longer than expected (up to 2x longer than the server cache if requested in the last second before expiration)

## Bug

- [x] Related issues linked using `fixes #number`

* Fix blurred image position when using objectPosition (vercel#26590)



## Bug

fixes vercel#26309

## Documentation / Examples

see vercel#26309

- [ ] Make sure the linting passes

* Update azure tests (vercel#26779)

* Stabilize relay-analytics test (vercel#26782)

* Leverage blocked page for _error (vercel#26748)



## Enhance

simplify detection for visiting `_error`

x-ref: vercel#26610

* Update codeowners to add new maintainers (vercel#26770)

* examples: fix typo `lunix` → `linux` (vercel#26796)



## 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

- [x] Make sure the linting passes

* Update repo scripts to separate folder (vercel#26787)

* fix: detect loop in client error page (vercel#26567)

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>

* Update snapshot for font-optimization test (vercel#26823)

This fixes the `font-optimization` test failing from the links/content changing slightly in the snapshot. 

## 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

* Add `onLoadingComplete()` prop to Image component (vercel#26824)

This adds a new prop, `onLoadingComplete()`, to handle the most common use case of `ref`.

I also added docs and a warning when using `ref` so we recommend the new prop instead.
 
- Fixes vercel#18398 
- Fixes vercel#22482

* Add "Vary: Accept" header to /_next/image responses (vercel#26788)

This pull request adds "Vary: Accept" header to responses from the image optimizer (i.e. the /_next/image endpoint).

The image optimizer prefers re-encoding JPG files to WebP, but some browsers (such as Safari 14 on Catalina) do not yet support WebP. In such cases the optimizer uses the Accept header sent by the browser to send out a JPG response. Thus the optimizer's response may depend on the Accept header.

Potential caching proxies can be informed of this fact by adding "Vary: Accept" to the response headers. Otherwise WebP data may be served to browsers that do not support it, for example in the following scenario:
 * A browser that supports WebP requests the JPG. The optimizer re-encodes it to WebP. The proxy caches the WebP data.
 * After this another browser that doesn't support WebP requests the JPG. The proxy sends the WebP data to the browser.

- [x] Integration tests added
- [x] Make sure the linting passes

* Fix using-preact example deps (vercel#26821)

Fix after vercel#26133

* Add additional tests for image type detection (vercel#26832)

Adding additional tests. Follow up to vercel#26705

* Fix immutable header for image with static import & unoptimized (vercel#26836)

Fixes vercel#26587

* Update `publish-canary` script to include checkout (vercel#26840)

* Update `publish-canary` script to include checkout

* Update contrib with publishing section

* v11.0.2-canary.4

* Make sure 404 pages do not get cached by a CDN when using next start (vercel#24983)

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: JJ Kasper <jj@jjsweb.site>

* Update to environment-variable.md (vercel#26863)



## 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
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes

## Why the change
I lost quite a few hours figuring out why my environment variable was `undefined` in the browser.
I read about the built-in support and was like: "Oh nice" and didn't read much further. I missed the part about how you need to prefix your variables with `NEXT_PUBLIC_` in order to expose them to the browser.
I think a hint to this in the anchor link to that section will make it more discoverable as it's then mentioned near the top and will save people who are like me some time and a headache.

* Don't emit duplicate image files (vercel#26843)

fixes vercel#26607

This change makes it so the image loader plugin only emits a file while processing an image import for the client. The final generated image URL was already the same in SSR and CSR anyway, so this change doesn't have any functional impact.

I also changed the name of the static page in the image component tests, since it was causing some conflicts with the static assets folder.

* Add instructions on how to add nextjs.org/docs/messages urls (vercel#26865)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* Rename example folder to with-notion

* Update references of example

* Reorder docs manifest and rename to Script Optimization. (vercel#26874)

So there's _conformance_ between the other docs / optimizations.

* Fix typo on "occured" to "occurred" (vercel#26876)

- Fix typo on "occured" to "occurred"

* Update README

Co-authored-by: Sam Robbins <samrobbinsgb@gmail.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: Peter Mekhaeil <4616064+petermekhaeil@users.noreply.github.com>
Co-authored-by: Rob Vermeer <rob@vermeertech.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: Alex Castle <atcastle@gmail.com>
Co-authored-by: Vitaly Baev <ping@baev.dev>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: destruc7i0n <6181960+destruc7i0n@users.noreply.github.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Joshua Byrd <phocks@gmail.com>
Co-authored-by: Pranav P <pranavkp.me@outlook.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: John <john@rackles.io>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Vadorequest <ambroise.dhenain@gmail.com>
Co-authored-by: hiro <hiro0218@gmail.com>
Co-authored-by: Houssein Djirdeh <houssein@google.com>
Co-authored-by: Soham Shah <47717492+sohamsshah@users.noreply.github.com>
Co-authored-by: Gerald Monaco <gbmonaco@google.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Nils Schönwald <nils@schoen.world>
Co-authored-by: D. Kasi Pavan Kumar <44864604+kasipavankumar@users.noreply.github.com>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: Joachim Viide <jviide@iki.fi>
Co-authored-by: Artur Sedlukha <sedlukha@icloud.com>
Co-authored-by: Paul van den Dool <paulvddool@msn.com>
Co-authored-by: hiro <hiroyuki.kikuchi@zozo.com>
@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