Skip to content

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

@LauraBeatris LauraBeatris force-pushed the add-route-events-types branch from 11caec5 to c93b9b1 Compare July 26, 2020 14:57
@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

'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 <[email protected]>
@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)

@LauraBeatris LauraBeatris force-pushed the add-route-events-types branch from efeb3ee to dabc6dc Compare August 3, 2020 12:48
@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 was opened via the examples template. 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
// 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
@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.