next.js
next.js copied to clipboard
Provide more data in router events callbacks
This addresses #21585 by exposing additional information in the object passed to event listener functions. This changes the function signature of router event listeners from
routeChangeStart(url, { shallow })
to
routeChangeStart(url, { href, as, pathname, query, shallow })
This is a non-breaking change since the old shallow object entry is preserved.
This change makes it possible to retrieve information like pathname and query inside event listeners where it was impossible before.
Failing test suites
Commit: 1aec31d5ced6a50b8202bf8319519556b021f884
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).toBeCloseTo(expected, precision)
Expected: 63.5
Received: 63.6
Expected precision: 1
Expected difference: < 0.05
Received difference: 0.10000000000000142
105 | expect(err404FirstLoad.endsWith('kB')).toBe(true)
106 |
> 107 | expect(parseFloat(sharedByAll)).toBeCloseTo(63.5, 1)
| ^
108 | expect(sharedByAll.endsWith('kB')).toBe(true)
109 |
110 | if (_appSize.endsWith('kB')) {
at Object.<anonymous> (integration/build-output/test/index.test.js:107:39)
test/integration/basepath/test/index.test.js
- basePath development > should use urls with basepath in router events
- basePath development > should use urls with basepath in router events for hash changes
- basePath development > should use urls with basepath in router events for cancelled routes
- basePath development > should use urls with basepath in router events for failed route change
- basePath production > should use urls with basepath in router events
- basePath production > should use urls with basepath in router events for hash changes
- basePath production > should use urls with basepath in router events for cancelled routes
- basePath production > should use urls with basepath in router events for failed route change
- basePath serverless > should use urls with basepath in router events
- basePath serverless > should use urls with basepath in router events for hash changes
- basePath serverless > should use urls with basepath in router events for cancelled routes
- basePath serverless > should use urls with basepath in router events for failed route change
- multi-level basePath development > should use urls with basepath in router events
- multi-level basePath development > should use urls with basepath in router events for hash changes
- multi-level basePath development > should use urls with basepath in router events for cancelled routes
- multi-level basePath development > should use urls with basepath in router events for failed route change
- multi-level basePath production > should use urls with basepath in router events
- multi-level basePath production > should use urls with basepath in router events for hash changes
- multi-level basePath production > should use urls with basepath in router events for cancelled routes
- multi-level basePath production > should use urls with basepath in router events for failed route change
Expand output
● basePath development › should use urls with basepath in router events
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 12
Array [
Array [
"routeChangeStart",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
924 |
925 | const eventLog = await browser.eval('window._getEventLog()')
> 926 | expect(eventLog).toEqual([
| ^
927 | ['routeChangeStart', `${basePath}/other-page`, { shallow: false }],
928 | ['beforeHistoryChange', `${basePath}/other-page`, { shallow: false }],
929 | ['routeChangeComplete', `${basePath}/other-page`, { shallow: false }],
at Object.<anonymous> (integration/basepath/test/index.test.js:926:24)
at runMicrotasks (<anonymous>)
● basePath development › should use urls with basepath in router events for hash changes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"hashChangeStart",
"/docs/hello#some-hash",
Object {
+ "as": "/docs/hello#some-hash",
+ "href": "/docs/hello#some-hash",
+ "pathname": "/docs/hello",
+ "query": Object {},
"shallow": false,
},
],
Array [
"hashChangeComplete",
"/docs/hello#some-hash",
Object {
+ "as": "/docs/hello#some-hash",
+ "href": "/docs/hello#some-hash",
+ "pathname": "/docs/hello",
+ "query": Object {},
"shallow": false,
},
],
]
941 |
942 | const eventLog = await browser.eval('window._getEventLog()')
> 943 | expect(eventLog).toEqual([
| ^
944 | ['hashChangeStart', `${basePath}/hello#some-hash`, { shallow: false }],
945 | [
946 | 'hashChangeComplete',
at Object.<anonymous> (integration/basepath/test/index.test.js:943:24)
at runMicrotasks (<anonymous>)
● basePath development › should use urls with basepath in router events for cancelled routes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 20
Array [
Array [
"routeChangeStart",
"/docs/slow-route",
Object {
+ "as": "/docs/slow-route",
+ "href": "/docs/slow-route",
+ "pathname": "/docs/slow-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Route Cancelled",
true,
"/docs/slow-route",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeStart",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
966 |
967 | const eventLog = await browser.eval('window._getEventLog()')
> 968 | expect(eventLog).toEqual([
| ^
969 | ['routeChangeStart', `${basePath}/slow-route`, { shallow: false }],
970 | [
971 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:968:24)
at runMicrotasks (<anonymous>)
● basePath development › should use urls with basepath in router events for failed route change
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"routeChangeStart",
"/docs/error-route",
Object {
+ "as": "/docs/error-route",
+ "href": "/docs/error-route",
+ "pathname": "/docs/error-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Failed to load static props",
null,
"/docs/error-route",
Object {
+ "as": "/docs/error-route",
+ "href": "/docs/error-route",
+ "pathname": "/docs/error-route",
+ "query": Object {},
"shallow": false,
},
],
]
993 |
994 | const eventLog = await browser.eval('window._getEventLog()')
> 995 | expect(eventLog).toEqual([
| ^
996 | ['routeChangeStart', `${basePath}/error-route`, { shallow: false }],
997 | [
998 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:995:24)
at runMicrotasks (<anonymous>)
● basePath production › should use urls with basepath in router events
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 12
Array [
Array [
"routeChangeStart",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
924 |
925 | const eventLog = await browser.eval('window._getEventLog()')
> 926 | expect(eventLog).toEqual([
| ^
927 | ['routeChangeStart', `${basePath}/other-page`, { shallow: false }],
928 | ['beforeHistoryChange', `${basePath}/other-page`, { shallow: false }],
929 | ['routeChangeComplete', `${basePath}/other-page`, { shallow: false }],
at Object.<anonymous> (integration/basepath/test/index.test.js:926:24)
at runMicrotasks (<anonymous>)
● basePath production › should use urls with basepath in router events for hash changes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"hashChangeStart",
"/docs/hello#some-hash",
Object {
+ "as": "/docs/hello#some-hash",
+ "href": "/docs/hello#some-hash",
+ "pathname": "/docs/hello",
+ "query": Object {},
"shallow": false,
},
],
Array [
"hashChangeComplete",
"/docs/hello#some-hash",
Object {
+ "as": "/docs/hello#some-hash",
+ "href": "/docs/hello#some-hash",
+ "pathname": "/docs/hello",
+ "query": Object {},
"shallow": false,
},
],
]
941 |
942 | const eventLog = await browser.eval('window._getEventLog()')
> 943 | expect(eventLog).toEqual([
| ^
944 | ['hashChangeStart', `${basePath}/hello#some-hash`, { shallow: false }],
945 | [
946 | 'hashChangeComplete',
at Object.<anonymous> (integration/basepath/test/index.test.js:943:24)
at runMicrotasks (<anonymous>)
● basePath production › should use urls with basepath in router events for cancelled routes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 20
Array [
Array [
"routeChangeStart",
"/docs/slow-route",
Object {
+ "as": "/docs/slow-route",
+ "href": "/docs/slow-route",
+ "pathname": "/docs/slow-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Route Cancelled",
true,
"/docs/slow-route",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeStart",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
966 |
967 | const eventLog = await browser.eval('window._getEventLog()')
> 968 | expect(eventLog).toEqual([
| ^
969 | ['routeChangeStart', `${basePath}/slow-route`, { shallow: false }],
970 | [
971 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:968:24)
at runMicrotasks (<anonymous>)
● basePath production › should use urls with basepath in router events for failed route change
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"routeChangeStart",
"/docs/error-route",
Object {
+ "as": "/docs/error-route",
+ "href": "/docs/error-route",
+ "pathname": "/docs/error-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Failed to load static props",
null,
"/docs/error-route",
Object {
+ "as": "/docs/error-route",
+ "href": "/docs/error-route",
+ "pathname": "/docs/error-route",
+ "query": Object {},
"shallow": false,
},
],
]
993 |
994 | const eventLog = await browser.eval('window._getEventLog()')
> 995 | expect(eventLog).toEqual([
| ^
996 | ['routeChangeStart', `${basePath}/error-route`, { shallow: false }],
997 | [
998 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:995:24)
at runMicrotasks (<anonymous>)
● multi-level basePath development › should use urls with basepath in router events
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 12
Array [
Array [
"routeChangeStart",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
924 |
925 | const eventLog = await browser.eval('window._getEventLog()')
> 926 | expect(eventLog).toEqual([
| ^
927 | ['routeChangeStart', `${basePath}/other-page`, { shallow: false }],
928 | ['beforeHistoryChange', `${basePath}/other-page`, { shallow: false }],
929 | ['routeChangeComplete', `${basePath}/other-page`, { shallow: false }],
at Object.<anonymous> (integration/basepath/test/index.test.js:926:24)
at runMicrotasks (<anonymous>)
● multi-level basePath development › should use urls with basepath in router events for hash changes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"hashChangeStart",
"/hello/world/hello#some-hash",
Object {
+ "as": "/hello/world/hello#some-hash",
+ "href": "/hello/world/hello#some-hash",
+ "pathname": "/hello/world/hello",
+ "query": Object {},
"shallow": false,
},
],
Array [
"hashChangeComplete",
"/hello/world/hello#some-hash",
Object {
+ "as": "/hello/world/hello#some-hash",
+ "href": "/hello/world/hello#some-hash",
+ "pathname": "/hello/world/hello",
+ "query": Object {},
"shallow": false,
},
],
]
941 |
942 | const eventLog = await browser.eval('window._getEventLog()')
> 943 | expect(eventLog).toEqual([
| ^
944 | ['hashChangeStart', `${basePath}/hello#some-hash`, { shallow: false }],
945 | [
946 | 'hashChangeComplete',
at Object.<anonymous> (integration/basepath/test/index.test.js:943:24)
at runMicrotasks (<anonymous>)
● multi-level basePath development › should use urls with basepath in router events for cancelled routes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 20
Array [
Array [
"routeChangeStart",
"/hello/world/slow-route",
Object {
+ "as": "/hello/world/slow-route",
+ "href": "/hello/world/slow-route",
+ "pathname": "/hello/world/slow-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Route Cancelled",
true,
"/hello/world/slow-route",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeStart",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
966 |
967 | const eventLog = await browser.eval('window._getEventLog()')
> 968 | expect(eventLog).toEqual([
| ^
969 | ['routeChangeStart', `${basePath}/slow-route`, { shallow: false }],
970 | [
971 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:968:24)
at runMicrotasks (<anonymous>)
● multi-level basePath development › should use urls with basepath in router events for failed route change
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"routeChangeStart",
"/hello/world/error-route",
Object {
+ "as": "/hello/world/error-route",
+ "href": "/hello/world/error-route",
+ "pathname": "/hello/world/error-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Failed to load static props",
null,
"/hello/world/error-route",
Object {
+ "as": "/hello/world/error-route",
+ "href": "/hello/world/error-route",
+ "pathname": "/hello/world/error-route",
+ "query": Object {},
"shallow": false,
},
],
]
993 |
994 | const eventLog = await browser.eval('window._getEventLog()')
> 995 | expect(eventLog).toEqual([
| ^
996 | ['routeChangeStart', `${basePath}/error-route`, { shallow: false }],
997 | [
998 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:995:24)
at runMicrotasks (<anonymous>)
● multi-level basePath production › should use urls with basepath in router events
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 12
Array [
Array [
"routeChangeStart",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
924 |
925 | const eventLog = await browser.eval('window._getEventLog()')
> 926 | expect(eventLog).toEqual([
| ^
927 | ['routeChangeStart', `${basePath}/other-page`, { shallow: false }],
928 | ['beforeHistoryChange', `${basePath}/other-page`, { shallow: false }],
929 | ['routeChangeComplete', `${basePath}/other-page`, { shallow: false }],
at Object.<anonymous> (integration/basepath/test/index.test.js:926:24)
at runMicrotasks (<anonymous>)
● multi-level basePath production › should use urls with basepath in router events for hash changes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"hashChangeStart",
"/hello/world/hello#some-hash",
Object {
+ "as": "/hello/world/hello#some-hash",
+ "href": "/hello/world/hello#some-hash",
+ "pathname": "/hello/world/hello",
+ "query": Object {},
"shallow": false,
},
],
Array [
"hashChangeComplete",
"/hello/world/hello#some-hash",
Object {
+ "as": "/hello/world/hello#some-hash",
+ "href": "/hello/world/hello#some-hash",
+ "pathname": "/hello/world/hello",
+ "query": Object {},
"shallow": false,
},
],
]
941 |
942 | const eventLog = await browser.eval('window._getEventLog()')
> 943 | expect(eventLog).toEqual([
| ^
944 | ['hashChangeStart', `${basePath}/hello#some-hash`, { shallow: false }],
945 | [
946 | 'hashChangeComplete',
at Object.<anonymous> (integration/basepath/test/index.test.js:943:24)
at runMicrotasks (<anonymous>)
● multi-level basePath production › should use urls with basepath in router events for cancelled routes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 20
Array [
Array [
"routeChangeStart",
"/hello/world/slow-route",
Object {
+ "as": "/hello/world/slow-route",
+ "href": "/hello/world/slow-route",
+ "pathname": "/hello/world/slow-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Route Cancelled",
true,
"/hello/world/slow-route",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeStart",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/hello/world/other-page",
Object {
+ "as": "/hello/world/other-page",
+ "href": "/hello/world/other-page",
+ "pathname": "/hello/world/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
966 |
967 | const eventLog = await browser.eval('window._getEventLog()')
> 968 | expect(eventLog).toEqual([
| ^
969 | ['routeChangeStart', `${basePath}/slow-route`, { shallow: false }],
970 | [
971 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:968:24)
at runMicrotasks (<anonymous>)
● multi-level basePath production › should use urls with basepath in router events for failed route change
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"routeChangeStart",
"/hello/world/error-route",
Object {
+ "as": "/hello/world/error-route",
+ "href": "/hello/world/error-route",
+ "pathname": "/hello/world/error-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Failed to load static props",
null,
"/hello/world/error-route",
Object {
+ "as": "/hello/world/error-route",
+ "href": "/hello/world/error-route",
+ "pathname": "/hello/world/error-route",
+ "query": Object {},
"shallow": false,
},
],
]
993 |
994 | const eventLog = await browser.eval('window._getEventLog()')
> 995 | expect(eventLog).toEqual([
| ^
996 | ['routeChangeStart', `${basePath}/error-route`, { shallow: false }],
997 | [
998 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:995:24)
at runMicrotasks (<anonymous>)
● basePath serverless › should use urls with basepath in router events
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 12
Array [
Array [
"routeChangeStart",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
924 |
925 | const eventLog = await browser.eval('window._getEventLog()')
> 926 | expect(eventLog).toEqual([
| ^
927 | ['routeChangeStart', `${basePath}/other-page`, { shallow: false }],
928 | ['beforeHistoryChange', `${basePath}/other-page`, { shallow: false }],
929 | ['routeChangeComplete', `${basePath}/other-page`, { shallow: false }],
at Object.<anonymous> (integration/basepath/test/index.test.js:926:24)
at runMicrotasks (<anonymous>)
● basePath serverless › should use urls with basepath in router events for hash changes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"hashChangeStart",
"/docs/hello#some-hash",
Object {
+ "as": "/docs/hello#some-hash",
+ "href": "/docs/hello#some-hash",
+ "pathname": "/docs/hello",
+ "query": Object {},
"shallow": false,
},
],
Array [
"hashChangeComplete",
"/docs/hello#some-hash",
Object {
+ "as": "/docs/hello#some-hash",
+ "href": "/docs/hello#some-hash",
+ "pathname": "/docs/hello",
+ "query": Object {},
"shallow": false,
},
],
]
941 |
942 | const eventLog = await browser.eval('window._getEventLog()')
> 943 | expect(eventLog).toEqual([
| ^
944 | ['hashChangeStart', `${basePath}/hello#some-hash`, { shallow: false }],
945 | [
946 | 'hashChangeComplete',
at Object.<anonymous> (integration/basepath/test/index.test.js:943:24)
at runMicrotasks (<anonymous>)
● basePath serverless › should use urls with basepath in router events for cancelled routes
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 20
Array [
Array [
"routeChangeStart",
"/docs/slow-route",
Object {
+ "as": "/docs/slow-route",
+ "href": "/docs/slow-route",
+ "pathname": "/docs/slow-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Route Cancelled",
true,
"/docs/slow-route",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeStart",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"beforeHistoryChange",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeComplete",
"/docs/other-page",
Object {
+ "as": "/docs/other-page",
+ "href": "/docs/other-page",
+ "pathname": "/docs/other-page",
+ "query": Object {},
"shallow": false,
},
],
]
966 |
967 | const eventLog = await browser.eval('window._getEventLog()')
> 968 | expect(eventLog).toEqual([
| ^
969 | ['routeChangeStart', `${basePath}/slow-route`, { shallow: false }],
970 | [
971 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:968:24)
at runMicrotasks (<anonymous>)
● basePath serverless › should use urls with basepath in router events for failed route change
expect(received).toEqual(expected) // deep equality
- Expected - 0
+ Received + 8
Array [
Array [
"routeChangeStart",
"/docs/error-route",
Object {
+ "as": "/docs/error-route",
+ "href": "/docs/error-route",
+ "pathname": "/docs/error-route",
+ "query": Object {},
"shallow": false,
},
],
Array [
"routeChangeError",
"Failed to load static props",
null,
"/docs/error-route",
Object {
+ "as": "/docs/error-route",
+ "href": "/docs/error-route",
+ "pathname": "/docs/error-route",
+ "query": Object {},
"shallow": false,
},
],
]
993 |
994 | const eventLog = await browser.eval('window._getEventLog()')
> 995 | expect(eventLog).toEqual([
| ^
996 | ['routeChangeStart', `${basePath}/error-route`, { shallow: false }],
997 | [
998 | 'routeChangeError',
at Object.<anonymous> (integration/basepath/test/index.test.js:995:24)
at runMicrotasks (<anonymous>)
Stats from current PR
Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 10.4s | 10.7s | ⚠️ +283ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +122 B |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.118 | 2.114 | 0 |
| / avg req/sec | 1180.21 | 1182.63 | +2.42 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.47 | 1.286 | -0.18 |
| /error-in-render avg req/sec | 1701.24 | 1944.33 | +243.09 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..38ed.js gzip | 13.1 kB | 13.1 kB | ⚠️ +18 B |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| Overall change | 59.4 kB | 59.5 kB | ⚠️ +18 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 613 B | 614 B | ⚠️ +1 B |
| link.html gzip | 618 B | 620 B | ⚠️ +2 B |
| withRouter.html gzip | 606 B | 607 B | ⚠️ +1 B |
| Overall change | 1.84 kB | 1.84 kB | ⚠️ +4 B |
Diffs
Diff for 677f882d2ed8..dde534236.js
@@ -1829,12 +1829,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
asNoBasePath,
_options$shallow,
shallow,
- routeProps,
- cleanedAs,
parsed,
_parsed,
pathname,
query,
+ routeProps,
+ cleanedAs,
pages,
rewrites,
_yield,
@@ -1968,7 +1968,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_options$shallow === void 0
? false
: _options$shallow);
+ parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+ url
+ );
+ (_parsed = parsed),
+ (pathname = _parsed.pathname),
+ (query = _parsed.query);
routeProps = {
+ href: url,
+ as: as,
+ pathname: pathname,
+ query: query,
shallow: shallow
};
@@ -1999,7 +2009,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 34;
+ _context.next = 36;
break;
}
@@ -2020,16 +2030,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 34:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
- url
- );
- (_parsed = parsed),
- (pathname = _parsed.pathname),
- (query = _parsed.query); // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
+ case 36:
_context.prev = 36;
_context.next = 39;
return this.pageLoader.getPageList();
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.d59cca9b248dde534236.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f2ecfe2f5ec83c8e14a0.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.d59cca9b248dde534236.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f2ecfe2f5ec83c8e14a0.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.d59cca9b248dde534236.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f2ecfe2f5ec83c8e14a0.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.d59cca9b248dde534236.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f2ecfe2f5ec83c8e14a0.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.d59cca9b248dde534236.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f2ecfe2f5ec83c8e14a0.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.d59cca9b248dde534236.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f2ecfe2f5ec83c8e14a0.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 12.6s | 12.4s | -186ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +122 B |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..38ed.js gzip | 13.1 kB | N/A | N/A |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| 677f882d2ed8..4412.js gzip | N/A | 13.1 kB | N/A |
| Overall change | 59.4 kB | 59.5 kB | ⚠️ +18 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Serverless bundles Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _error.js | 1 MB | 1 MB | ✓ |
| 404.html | 2.67 kB | 2.67 kB | ✓ |
| hooks.html | 1.92 kB | 1.92 kB | ✓ |
| index.js | 1 MB | 1 MB | ✓ |
| link.js | 1.06 MB | 1.06 MB | ⚠️ +56 B |
| routerDirect.js | 1.05 MB | 1.06 MB | ⚠️ +56 B |
| withRouter.js | 1.05 MB | 1.06 MB | ⚠️ +56 B |
| Overall change | 5.19 MB | 5.19 MB | ⚠️ +168 B |
Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 12.5s | 12.9s | ⚠️ +384ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +122 B |
Page Load Tests Overall decrease ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.101 | 2.097 | 0 |
| / avg req/sec | 1190.06 | 1192.03 | +1.97 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.35 | 1.524 | ⚠️ +0.17 |
| /error-in-render avg req/sec | 1851.94 | 1640.33 | ⚠️ -211.61 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 597-7c719119..27b6.js gzip | 13 kB | 13.1 kB | ⚠️ +22 B |
| framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
| main-HASH.js gzip | 6.57 kB | 6.57 kB | ✓ |
| webpack-HASH.js gzip | 954 B | 954 B | ✓ |
| Overall change | 59.8 kB | 59.9 kB | ⚠️ +22 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-6e0a903..b885.js gzip | 1.26 kB | 1.26 kB | ✓ |
| _error-7a100..a392.js gzip | 3.38 kB | 3.38 kB | ✓ |
| hooks-f7e199..11b9.js gzip | 904 B | 904 B | ✓ |
| index-3dc22c..ffbb.js gzip | 232 B | 232 B | ✓ |
| link-c010d28..b60a.js gzip | 1.63 kB | 1.63 kB | ✓ |
| routerDirect..323a.js gzip | 308 B | 308 B | ✓ |
| withRouter-a..2ef8.js gzip | 304 B | 304 B | ✓ |
| Overall change | 8.02 kB | 8.02 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 299 B | 299 B | ✓ |
| Overall change | 299 B | 299 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 586 B | 586 B | ✓ |
| link.html gzip | 592 B | 594 B | ⚠️ +2 B |
| withRouter.html gzip | 579 B | 580 B | ⚠️ +1 B |
| Overall change | 1.76 kB | 1.76 kB | ⚠️ +3 B |
Diffs
Diff for 677f882d2ed8..c23f838ed.js
@@ -1050,8 +1050,8 @@
N,
U,
W,
- F,
q,
+ F,
G,
B,
H,
@@ -1067,7 +1067,8 @@
tt,
et,
rt,
- nt;
+ nt,
+ ot;
return n.wrap(
function(e) {
for (;;)
@@ -1092,11 +1093,21 @@
(i._h || (this.isSsr = !1),
h.ST && performance.mark("routeChange"),
(v = i.shallow),
- (g = { shallow: void 0 !== v && v }),
+ (g = void 0 !== v && v),
+ (w = (0, d.parseRelativeUrl)(o)),
+ (O = (x = w).pathname),
+ (C = x.query),
+ (I = {
+ href: o,
+ as: a,
+ pathname: O,
+ query: C,
+ shallow: g
+ }),
this._inFlightRoute &&
this.abortComponentLoad(
this._inFlightRoute,
- g
+ I
),
(a = S(
b(
@@ -1105,39 +1116,36 @@
this.defaultLocale
)
)),
- (w = _(P(a) ? k(a) : a, this.locale)),
+ (A = _(P(a) ? k(a) : a, this.locale)),
(this._inFlightRoute = a),
- i._h || !this.onlyAHashChange(w))
+ i._h || !this.onlyAHashChange(A))
) {
- e.next = 34;
+ e.next = 36;
break;
}
return (
- (this.asPath = w),
- t.events.emit("hashChangeStart", a, g),
+ (this.asPath = A),
+ t.events.emit("hashChangeStart", a, I),
this.changeState(r, o, a, i),
- this.scrollToHash(w),
+ this.scrollToHash(A),
this.notify(this.components[this.route], null),
- t.events.emit("hashChangeComplete", a, g),
+ t.events.emit("hashChangeComplete", a, I),
e.abrupt("return", !0)
);
- case 34:
+ case 36:
return (
- (x = (0, d.parseRelativeUrl)(o)),
- (C = (O = x).pathname),
- (I = O.query),
(e.prev = 36),
(e.next = 39),
this.pageLoader.getPageList()
);
case 39:
return (
- (A = e.sent),
+ (M = e.sent),
(e.next = 42),
(0, s.getClientBuildManifest)()
);
case 42:
- (M = e.sent), M.__rewrites, (e.next = 50);
+ (D = e.sent), D.__rewrites, (e.next = 50);
break;
case 46:
return (
@@ -1148,15 +1156,15 @@
);
case 50:
if (
- ((x = this._resolveHref(x, A)).pathname !== C &&
- ((C = x.pathname),
- (o = (0, h.formatWithValidation)(x))),
- (C = C
- ? (0, c.removePathTrailingSlash)(k(C))
- : C),
- this.urlIsNew(w) || f || (r = "replaceState"),
- (D = (0, c.removePathTrailingSlash)(C)),
- (N = a),
+ ((w = this._resolveHref(w, M)).pathname !== O &&
+ ((O = w.pathname),
+ (o = (0, h.formatWithValidation)(w))),
+ (O = O
+ ? (0, c.removePathTrailingSlash)(k(O))
+ : O),
+ this.urlIsNew(A) || f || (r = "replaceState"),
+ (N = (0, c.removePathTrailingSlash)(O)),
+ (U = a),
E(a))
) {
e.next = 62;
@@ -1171,29 +1179,29 @@
);
case 62:
if (
- ((N = _(k(N), this.locale)),
- !(0, p.isDynamicRoute)(D))
+ ((U = _(k(U), this.locale)),
+ !(0, p.isDynamicRoute)(N))
) {
e.next = 78;
break;
}
if (
- ((U = (0, d.parseRelativeUrl)(N)),
- (W = U.pathname),
- (F = (0, m.getRouteRegex)(D)),
- (q = (0, y.getRouteMatcher)(F)(W)),
- (B = (G = D === W) ? R(D, W, I) : {}),
- q && (!G || B.result))
+ ((W = (0, d.parseRelativeUrl)(U)),
+ (q = W.pathname),
+ (F = (0, m.getRouteRegex)(N)),
+ (G = (0, y.getRouteMatcher)(F)(q)),
+ (H = (B = N === q) ? R(N, q, C) : {}),
+ G && (!B || H.result))
) {
e.next = 77;
break;
}
if (
!(
- (H = Object.keys(F.groups).filter(function(
+ (V = Object.keys(F.groups).filter(function(
t
) {
- return !I[t];
+ return !C[t];
})).length > 0
)
) {
@@ -1201,24 +1209,24 @@
break;
}
throw new Error(
- (G
+ (B
? "The provided `href` ("
.concat(
o,
") value is missing query values ("
)
.concat(
- H.join(", "),
+ V.join(", "),
") to be interpolated properly. "
)
: "The provided `as` value ("
.concat(
- W,
+ q,
") is incompatible with the `href` value ("
)
- .concat(D, "). ")) +
+ .concat(N, "). ")) +
"Read more: https://err.sh/vercel/next.js/".concat(
- G
+ B
? "href-interpolation-failed"
: "incompatible-href-as"
)
@@ -1227,64 +1235,64 @@
e.next = 78;
break;
case 77:
- G
+ B
? (a = (0, h.formatWithValidation)(
- Object.assign({}, U, {
- pathname: B.result,
- query: L(I, B.params)
+ Object.assign({}, W, {
+ pathname: H.result,
+ query: L(C, H.params)
})
))
- : Object.assign(I, q);
+ : Object.assign(C, G);
case 78:
return (
- t.events.emit("routeChangeStart", a, g),
+ t.events.emit("routeChangeStart", a, I),
(e.prev = 79),
(e.next = 82),
- this.getRouteInfo(D, C, I, a, N, g)
+ this.getRouteInfo(N, O, C, a, U, I)
);
case 82:
if (
- ((V = e.sent),
- (z = (X = V).error),
- (J = X.props),
- ($ = X.__N_SSG),
- (Y = X.__N_SSP),
- (!$ && !Y) || !J)
+ ((X = e.sent),
+ (J = (z = X).error),
+ ($ = z.props),
+ (Y = z.__N_SSG),
+ (Q = z.__N_SSP),
+ (!Y && !Q) || !$)
) {
e.next = 108;
break;
}
- if (!J.pageProps || !J.pageProps.__N_REDIRECT) {
+ if (!$.pageProps || !$.pageProps.__N_REDIRECT) {
e.next = 95;
break;
}
if (
- !(Q = J.pageProps.__N_REDIRECT).startsWith("/")
+ !(Z = $.pageProps.__N_REDIRECT).startsWith("/")
) {
e.next = 93;
break;
}
if (
- ((Z = (0, d.parseRelativeUrl)(Q)),
- this._resolveHref(Z, A, !1),
- !A.includes(Z.pathname))
+ ((K = (0, d.parseRelativeUrl)(Z)),
+ this._resolveHref(K, M, !1),
+ !M.includes(K.pathname))
) {
e.next = 93;
break;
}
return (
- (K = j(this, Q, Q)),
- (tt = K.url),
- (et = K.as),
- e.abrupt("return", this.change(r, tt, et, i))
+ (tt = j(this, Z, Z)),
+ (et = tt.url),
+ (rt = tt.as),
+ e.abrupt("return", this.change(r, et, rt, i))
);
case 93:
return (
- (window.location.href = Q),
+ (window.location.href = Z),
e.abrupt("return", new Promise(function() {}))
);
case 95:
- if (J.notFound !== T) {
+ if ($.notFound !== T) {
e.next = 108;
break;
}
@@ -1294,49 +1302,49 @@
this.fetchComponent("/404")
);
case 99:
- (rt = "/404"), (e.next = 105);
+ (nt = "/404"), (e.next = 105);
break;
case 102:
(e.prev = 102),
(e.t1 = e.catch(96)),
- (rt = "/_error");
+ (nt = "/_error");
case 105:
return (
(e.next = 107),
- this.getRouteInfo(rt, rt, I, a, N, {
+ this.getRouteInfo(nt, nt, C, a, U, {
shallow: !1
})
);
case 107:
- V = e.sent;
+ X = e.sent;
case 108:
return (
- t.events.emit("beforeHistoryChange", a, g),
+ t.events.emit("beforeHistoryChange", a, I),
this.changeState(r, o, a, i),
- (nt = i.shallow && this.route === D),
+ (ot = i.shallow && this.route === N),
(e.next = 114),
this.set(
- D,
+ N,
+ O,
C,
- I,
- w,
- V,
- u || (nt || !i.scroll ? null : { x: 0, y: 0 })
+ A,
+ X,
+ u || (ot || !i.scroll ? null : { x: 0, y: 0 })
).catch(function(t) {
if (!t.cancelled) throw t;
- z = z || t;
+ J = J || t;
})
);
case 114:
- if (!z) {
+ if (!J) {
e.next = 117;
break;
}
- throw (t.events.emit("routeChangeError", z, w, g),
- z);
+ throw (t.events.emit("routeChangeError", J, A, I),
+ J);
case 117:
return (
- t.events.emit("routeChangeComplete", a, g),
+ t.events.emit("routeChangeComplete", a, I),
e.abrupt("return", !0)
);
case 122:
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c28076628b4c23f838ed.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f97de78681d9633f4412.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "QbahpXKuICU8anwDxAYTh",
+ "buildId": "e9JY4kXm99JUzaNOzOGhD",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c28076628b4c23f838ed.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f97de78681d9633f4412.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/QbahpXKuICU8anwDxAYTh/_buildManifest.js"
+ src="/_next/static/e9JY4kXm99JUzaNOzOGhD/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/QbahpXKuICU8anwDxAYTh/_ssgManifest.js"
+ src="/_next/static/e9JY4kXm99JUzaNOzOGhD/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c28076628b4c23f838ed.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f97de78681d9633f4412.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "QbahpXKuICU8anwDxAYTh",
+ "buildId": "e9JY4kXm99JUzaNOzOGhD",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c28076628b4c23f838ed.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f97de78681d9633f4412.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/QbahpXKuICU8anwDxAYTh/_buildManifest.js"
+ src="/_next/static/e9JY4kXm99JUzaNOzOGhD/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/QbahpXKuICU8anwDxAYTh/_ssgManifest.js"
+ src="/_next/static/e9JY4kXm99JUzaNOzOGhD/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c28076628b4c23f838ed.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f97de78681d9633f4412.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "QbahpXKuICU8anwDxAYTh",
+ "buildId": "e9JY4kXm99JUzaNOzOGhD",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c28076628b4c23f838ed.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f97de78681d9633f4412.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/QbahpXKuICU8anwDxAYTh/_buildManifest.js"
+ src="/_next/static/e9JY4kXm99JUzaNOzOGhD/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/QbahpXKuICU8anwDxAYTh/_ssgManifest.js"
+ src="/_next/static/e9JY4kXm99JUzaNOzOGhD/_ssgManifest.js"
async=""
></script>
</body>
Stats from current PR
Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 10s | 10s | ⚠️ +11ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 1.964 | 1.997 | ⚠️ +0.03 |
| / avg req/sec | 1272.79 | 1252.13 | ⚠️ -20.66 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.246 | 1.181 | -0.06 |
| /error-in-render avg req/sec | 2006.5 | 2116.39 | +109.89 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | 13.4 kB | ⚠️ +312 B |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +312 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Rendered Page Sizes
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 613 B | 613 B | ✓ |
| link.html gzip | 619 B | 619 B | ✓ |
| withRouter.html gzip | 607 B | 607 B | ✓ |
| Overall change | 1.84 kB | 1.84 kB | ✓ |
Diffs
Diff for 677f882d2ed8..abf803634.js
@@ -1173,6 +1173,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _regeneratorRuntime = __webpack_require__("o0o1");
+ var _defineProperty = __webpack_require__("lSNA");
+
var _asyncToGenerator = __webpack_require__("yXPU");
var _classCallCheck = __webpack_require__("lwsE");
@@ -1181,6 +1183,44 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _slicedToArray = __webpack_require__("J4zp");
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly)
+ symbols = symbols.filter(function(sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+
+ function _objectSpread(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function(key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(
+ target,
+ Object.getOwnPropertyDescriptors(source)
+ );
+ } else {
+ ownKeys(Object(source)).forEach(function(key) {
+ Object.defineProperty(
+ target,
+ key,
+ Object.getOwnPropertyDescriptor(source, key)
+ );
+ });
+ }
+ }
+ return target;
+ }
+
exports.__esModule = true;
exports.getDomainLocale = getDomainLocale;
exports.addLocale = addLocale;
@@ -1583,6 +1623,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isSsr = void 0;
this.isFallback = void 0;
this._inFlightRoute = void 0;
+ this._inFlightHref = void 0;
+ this._inFlightPathname = void 0;
this._shallow = void 0;
this.locale = void 0;
this.locales = void 0;
@@ -1820,6 +1862,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _this2 = this;
var _options$scroll,
+ _options$shallow,
localeChange,
parsedAs,
localePathResult,
@@ -1827,14 +1870,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_this$locales,
detectedDomain,
asNoBasePath,
- _options$shallow,
- shallow,
- routeProps,
- cleanedAs,
parsed,
_parsed,
pathname,
query,
+ baseRouteProps,
+ href,
+ cleanedAs,
+ _routeProps,
pages,
rewrites,
_yield,
@@ -1848,6 +1891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shouldInterpolate,
interpolatedAs,
missingParams,
+ routeProps,
routeInfo,
_routeInfo,
error,
@@ -1963,19 +2007,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
performance.mark("routeChange");
}
- (_options$shallow = options.shallow),
- (shallow =
- _options$shallow === void 0
- ? false
- : _options$shallow);
- routeProps = {
- shallow: shallow
+ parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+ url
+ );
+ (_parsed = parsed),
+ (pathname = _parsed.pathname),
+ (query = _parsed.query); // This is what we know so far
+ // We will need to fill in href, as, pathname before we pass routeProps beyond this function
+
+ baseRouteProps = {
+ query: query,
+ shallow:
+ (_options$shallow = options.shallow) != null
+ ? _options$shallow
+ : false
};
if (this._inFlightRoute) {
+ href = this._inFlightHref;
this.abortComponentLoad(
this._inFlightRoute,
- routeProps
+ _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(href)
+ ? delBasePath(href)
+ : href
+ ),
+ as: delLocale(
+ hasBasePath(this._inFlightRoute)
+ ? delBasePath(this._inFlightRoute)
+ : this._inFlightRoute
+ ),
+ pathname: this._inFlightPathname
+ }
+ )
);
}
@@ -1990,7 +2058,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ this._inFlightHref = delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ); // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -1999,15 +2070,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 34;
+ _context.next = 37;
break;
}
this.asPath = cleanedAs;
+ _routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ as: delLocale(
+ hasBasePath(as) ? delBasePath(as) : url
+ ),
+ pathname: this.pathname // old pathname still applies if we're only changing hash
+ }
+ );
Router.events.emit(
"hashChangeStart",
as,
- routeProps
+ _routeProps
); // TODO: do we need the resolved href when only a hash change?
this.changeState(method, url, as, options);
@@ -2016,44 +2100,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit(
"hashChangeComplete",
as,
- routeProps
+ _routeProps
);
return _context.abrupt("return", true);
- case 34:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
- url
- );
- (_parsed = parsed),
- (pathname = _parsed.pathname),
- (query = _parsed.query); // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
- _context.prev = 36;
- _context.next = 39;
+ case 37:
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
parsed = this._resolveHref(parsed, pages);
if (parsed.pathname !== pathname) {
@@ -2089,13 +2164,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
+ this._inFlightPathname = route;
+
if (isLocalURL(as)) {
- _context.next = 62;
+ _context.next = 64;
break;
}
if (true) {
- _context.next = 60;
+ _context.next = 62;
break;
}
@@ -2109,18 +2186,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://err.sh/next.js/invalid-relative-url-external-as"
);
- case 60:
+ case 62:
window.location.href = as;
return _context.abrupt("return", false);
- case 62:
+ case 64:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 78;
+ _context.next = 80;
break;
}
@@ -2143,7 +2220,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 77;
+ _context.next = 79;
break;
}
@@ -2154,7 +2231,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 75;
+ _context.next = 77;
break;
}
@@ -2185,11 +2262,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 75:
- _context.next = 78;
+ case 77:
+ _context.next = 80;
break;
- case 77:
+ case 79:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -2205,14 +2282,26 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 78:
+ case 80:
+ routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ // does this value already exist somewhere?
+ as: resolvedAs,
+ pathname: route
+ }
+ );
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 79;
- _context.next = 82;
+ _context.prev = 82;
+ _context.next = 85;
return this.getRouteInfo(
route,
pathname,
@@ -2222,7 +2311,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 82:
+ case 85:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -2231,14 +2320,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 95;
+ _context.next = 98;
break;
}
@@ -2247,7 +2336,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2257,7 +2346,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages, false);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2273,35 +2362,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 93:
+ case 96:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 95:
+ case 98:
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
- _context.prev = 96;
- _context.next = 99;
+ _context.prev = 99;
+ _context.next = 102;
return this.fetchComponent("/404");
- case 99:
+ case 102:
notFoundRoute = "/404";
- _context.next = 105;
+ _context.next = 108;
break;
- case 102:
- _context.prev = 102;
- _context.t1 = _context["catch"](96);
+ case 105:
+ _context.prev = 105;
+ _context.t1 = _context["catch"](99);
notFoundRoute = "/_error";
- case 105:
- _context.next = 107;
+ case 108:
+ _context.next = 110;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -2309,14 +2398,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
as,
resolvedAs,
{
+ href: notFoundRoute,
+ pathname: notFoundRoute,
+ as: resolvedAs,
+ query: query,
shallow: false
}
);
- case 107:
+ case 110:
routeInfo = _context.sent;
- case 108:
+ case 111:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -2329,7 +2422,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
isValidShallowRoute =
options.shallow && this.route === route;
- _context.next = 114;
+ _context.next = 117;
return this.set(
route,
pathname,
@@ -2348,9 +2441,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 114:
+ case 117:
if (!error) {
- _context.next = 117;
+ _context.next = 120;
break;
}
@@ -2362,7 +2455,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 117:
+ case 120:
if (false) {
}
@@ -2373,21 +2466,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 122:
- _context.prev = 122;
- _context.t2 = _context["catch"](79);
+ case 125:
+ _context.prev = 125;
+ _context.t2 = _context["catch"](82);
if (!_context.t2.cancelled) {
- _context.next = 126;
+ _context.next = 129;
break;
}
return _context.abrupt("return", false);
- case 126:
+ case 129:
throw _context.t2;
- case 127:
+ case 130:
case "end":
return _context.stop();
}
@@ -2396,9 +2489,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [79, 122],
- [96, 102]
+ [37, 47],
+ [82, 125],
+ [99, 105]
]
);
})
@@ -3484,6 +3577,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/***/
},
+ /***/ lSNA: /***/ function(module, exports) {
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ module.exports = _defineProperty;
+
+ /***/
+ },
+
/***/ ls82: /***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 11.9s | 11.7s | -109ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | N/A | N/A |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| 677f882d2ed8..00d9.js gzip | N/A | 13.4 kB | N/A |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +312 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Serverless bundles Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _error.js | 1 MB | 1 MB | ✓ |
| 404.html | 2.67 kB | 2.67 kB | ✓ |
| hooks.html | 1.92 kB | 1.92 kB | ✓ |
| index.js | 1 MB | 1 MB | ✓ |
| link.js | 1.06 MB | 1.07 MB | ⚠️ +2.46 kB |
| routerDirect.js | 1.06 MB | 1.06 MB | ⚠️ +2.46 kB |
| withRouter.js | 1.06 MB | 1.06 MB | ⚠️ +2.46 kB |
| Overall change | 5.19 MB | 5.19 MB | ⚠️ +7.38 kB |
Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 11.8s | 11.9s | ⚠️ +75ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 1.957 | 2.011 | ⚠️ +0.05 |
| / avg req/sec | 1277.17 | 1243.46 | ⚠️ -33.71 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.279 | 1.209 | -0.07 |
| /error-in-render avg req/sec | 1954.23 | 2068.38 | +114.15 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 597-6c246419..806f.js gzip | 13 kB | 13.3 kB | ⚠️ +305 B |
| framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
| main-HASH.js gzip | 6.57 kB | 6.57 kB | ✓ |
| webpack-HASH.js gzip | 954 B | 954 B | ✓ |
| Overall change | 59.8 kB | 60.2 kB | ⚠️ +305 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-6e0a903..b885.js gzip | 1.26 kB | 1.26 kB | ✓ |
| _error-7a100..a392.js gzip | 3.38 kB | 3.38 kB | ✓ |
| hooks-f7e199..11b9.js gzip | 904 B | 904 B | ✓ |
| index-3dc22c..ffbb.js gzip | 232 B | 232 B | ✓ |
| link-c010d28..b60a.js gzip | 1.63 kB | 1.63 kB | ✓ |
| routerDirect..323a.js gzip | 308 B | 308 B | ✓ |
| withRouter-a..2ef8.js gzip | 304 B | 304 B | ✓ |
| Overall change | 8.02 kB | 8.02 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 299 B | 299 B | ✓ |
| Overall change | 299 B | 299 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 584 B | 584 B | ✓ |
| link.html gzip | 592 B | 591 B | -1 B |
| withRouter.html gzip | 577 B | 579 B | ⚠️ +2 B |
| Overall change | 1.75 kB | 1.75 kB | ⚠️ +1 B |
Diffs
Diff for 677f882d2ed8..dc0f149c4.js
Diff too large to display
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "Wck8jpZGztkOQB5kE3TYr",
+ "buildId": "3BjHv8GIorJ674Tkh-HIG",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/Wck8jpZGztkOQB5kE3TYr/_buildManifest.js"
+ src="/_next/static/3BjHv8GIorJ674Tkh-HIG/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/Wck8jpZGztkOQB5kE3TYr/_ssgManifest.js"
+ src="/_next/static/3BjHv8GIorJ674Tkh-HIG/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "Wck8jpZGztkOQB5kE3TYr",
+ "buildId": "3BjHv8GIorJ674Tkh-HIG",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/Wck8jpZGztkOQB5kE3TYr/_buildManifest.js"
+ src="/_next/static/3BjHv8GIorJ674Tkh-HIG/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/Wck8jpZGztkOQB5kE3TYr/_ssgManifest.js"
+ src="/_next/static/3BjHv8GIorJ674Tkh-HIG/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "Wck8jpZGztkOQB5kE3TYr",
+ "buildId": "3BjHv8GIorJ674Tkh-HIG",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/Wck8jpZGztkOQB5kE3TYr/_buildManifest.js"
+ src="/_next/static/3BjHv8GIorJ674Tkh-HIG/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/Wck8jpZGztkOQB5kE3TYr/_ssgManifest.js"
+ src="/_next/static/3BjHv8GIorJ674Tkh-HIG/_ssgManifest.js"
async=""
></script>
</body>
Failing test suites
Commit: 685a067c0fddddd452a8402dd8e667a71e9d74ed
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).toBeCloseTo(expected, precision)
Expected: 64.1
Received: 64.2
Expected precision: 1
Expected difference: < 0.05
Received difference: 0.10000000000000853
96 |
97 | // should be no bigger than 63.8 kb
> 98 | expect(parseFloat(indexFirstLoad)).toBeCloseTo(64.1, 1)
| ^
99 | expect(indexFirstLoad.endsWith('kB')).toBe(true)
100 |
101 | expect(parseFloat(err404Size) - 3.7).toBeLessThanOrEqual(0)
at Object.<anonymous> (integration/build-output/test/index.test.js:98:42)
test/integration/size-limit/test/index.test.js
- Production response size > should not increase the overall response size of default build
Expand output
● Production response size › should not increase the overall response size of default build
expect(received).toBeCloseTo(expected, precision)
Expected: 284.1
Received: 285.626953125
Expected precision: 0
Expected difference: < 0.5
Received difference: 1.5269531249999773
82 |
83 | // Expected difference: < 0.5
> 84 | expect(delta).toBeCloseTo(284.1, 0)
| ^
85 | })
86 | })
87 |
at Object.<anonymous> (integration/size-limit/test/index.test.js:84:19)
Failing test suites
Commit: dc3f53144c3a8f99e38eef91250d2c71b1325d06
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).toBeCloseTo(expected, precision)
Expected: 67.3
Received: 67.4
Expected precision: 1
Expected difference: < 0.05
Received difference: 0.10000000000000853
102 | expect(err404Size.endsWith('kB')).toBe(true)
103 |
> 104 | expect(parseFloat(err404FirstLoad)).toBeCloseTo(67.3, 1)
| ^
105 | expect(err404FirstLoad.endsWith('kB')).toBe(true)
106 |
107 | expect(parseFloat(sharedByAll)).toBeCloseTo(63.8, 1)
at Object.<anonymous> (integration/build-output/test/index.test.js:104:43)
Stats from current PR
Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 11.6s | 11.3s | -321ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.259 | 2.375 | ⚠️ +0.12 |
| / avg req/sec | 1106.54 | 1052.82 | ⚠️ -53.72 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.691 | 1.584 | -0.11 |
| /error-in-render avg req/sec | 1478.39 | 1578.27 | +99.88 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | 13.4 kB | ⚠️ +312 B |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +312 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Rendered Page Sizes
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 613 B | 613 B | ✓ |
| link.html gzip | 619 B | 619 B | ✓ |
| withRouter.html gzip | 607 B | 607 B | ✓ |
| Overall change | 1.84 kB | 1.84 kB | ✓ |
Diffs
Diff for 677f882d2ed8..abf803634.js
@@ -1173,6 +1173,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _regeneratorRuntime = __webpack_require__("o0o1");
+ var _defineProperty = __webpack_require__("lSNA");
+
var _asyncToGenerator = __webpack_require__("yXPU");
var _classCallCheck = __webpack_require__("lwsE");
@@ -1181,6 +1183,44 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _slicedToArray = __webpack_require__("J4zp");
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly)
+ symbols = symbols.filter(function(sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+
+ function _objectSpread(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function(key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(
+ target,
+ Object.getOwnPropertyDescriptors(source)
+ );
+ } else {
+ ownKeys(Object(source)).forEach(function(key) {
+ Object.defineProperty(
+ target,
+ key,
+ Object.getOwnPropertyDescriptor(source, key)
+ );
+ });
+ }
+ }
+ return target;
+ }
+
exports.__esModule = true;
exports.getDomainLocale = getDomainLocale;
exports.addLocale = addLocale;
@@ -1583,6 +1623,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isSsr = void 0;
this.isFallback = void 0;
this._inFlightRoute = void 0;
+ this._inFlightHref = void 0;
+ this._inFlightPathname = void 0;
this._shallow = void 0;
this.locale = void 0;
this.locales = void 0;
@@ -1820,6 +1862,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _this2 = this;
var _options$scroll,
+ _options$shallow,
localeChange,
parsedAs,
localePathResult,
@@ -1827,14 +1870,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_this$locales,
detectedDomain,
asNoBasePath,
- _options$shallow,
- shallow,
- routeProps,
- cleanedAs,
parsed,
_parsed,
pathname,
query,
+ baseRouteProps,
+ href,
+ cleanedAs,
+ _routeProps,
pages,
rewrites,
_yield,
@@ -1848,6 +1891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shouldInterpolate,
interpolatedAs,
missingParams,
+ routeProps,
routeInfo,
_routeInfo,
error,
@@ -1963,19 +2007,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
performance.mark("routeChange");
}
- (_options$shallow = options.shallow),
- (shallow =
- _options$shallow === void 0
- ? false
- : _options$shallow);
- routeProps = {
- shallow: shallow
+ parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+ url
+ );
+ (_parsed = parsed),
+ (pathname = _parsed.pathname),
+ (query = _parsed.query); // This is what we know so far
+ // We will need to fill in href, as, pathname before we pass routeProps beyond this function
+
+ baseRouteProps = {
+ query: query,
+ shallow:
+ (_options$shallow = options.shallow) != null
+ ? _options$shallow
+ : false
};
if (this._inFlightRoute) {
+ href = this._inFlightHref;
this.abortComponentLoad(
this._inFlightRoute,
- routeProps
+ _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(href)
+ ? delBasePath(href)
+ : href
+ ),
+ as: delLocale(
+ hasBasePath(this._inFlightRoute)
+ ? delBasePath(this._inFlightRoute)
+ : this._inFlightRoute
+ ),
+ pathname: this._inFlightPathname
+ }
+ )
);
}
@@ -1990,7 +2058,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ this._inFlightHref = delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ); // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -1999,15 +2070,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 34;
+ _context.next = 37;
break;
}
this.asPath = cleanedAs;
+ _routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ as: delLocale(
+ hasBasePath(as) ? delBasePath(as) : url
+ ),
+ pathname: this.pathname // old pathname still applies if we're only changing hash
+ }
+ );
Router.events.emit(
"hashChangeStart",
as,
- routeProps
+ _routeProps
); // TODO: do we need the resolved href when only a hash change?
this.changeState(method, url, as, options);
@@ -2016,44 +2100,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit(
"hashChangeComplete",
as,
- routeProps
+ _routeProps
);
return _context.abrupt("return", true);
- case 34:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
- url
- );
- (_parsed = parsed),
- (pathname = _parsed.pathname),
- (query = _parsed.query); // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
- _context.prev = 36;
- _context.next = 39;
+ case 37:
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
parsed = this._resolveHref(parsed, pages);
if (parsed.pathname !== pathname) {
@@ -2089,13 +2164,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
+ this._inFlightPathname = route;
+
if (isLocalURL(as)) {
- _context.next = 62;
+ _context.next = 64;
break;
}
if (true) {
- _context.next = 60;
+ _context.next = 62;
break;
}
@@ -2109,18 +2186,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://err.sh/next.js/invalid-relative-url-external-as"
);
- case 60:
+ case 62:
window.location.href = as;
return _context.abrupt("return", false);
- case 62:
+ case 64:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 78;
+ _context.next = 80;
break;
}
@@ -2143,7 +2220,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 77;
+ _context.next = 79;
break;
}
@@ -2154,7 +2231,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 75;
+ _context.next = 77;
break;
}
@@ -2185,11 +2262,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 75:
- _context.next = 78;
+ case 77:
+ _context.next = 80;
break;
- case 77:
+ case 79:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -2205,14 +2282,26 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 78:
+ case 80:
+ routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ // does this value already exist somewhere?
+ as: resolvedAs,
+ pathname: route
+ }
+ );
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 79;
- _context.next = 82;
+ _context.prev = 82;
+ _context.next = 85;
return this.getRouteInfo(
route,
pathname,
@@ -2222,7 +2311,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 82:
+ case 85:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -2231,14 +2320,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 95;
+ _context.next = 98;
break;
}
@@ -2247,7 +2336,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2257,7 +2346,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages, false);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2273,35 +2362,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 93:
+ case 96:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 95:
+ case 98:
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
- _context.prev = 96;
- _context.next = 99;
+ _context.prev = 99;
+ _context.next = 102;
return this.fetchComponent("/404");
- case 99:
+ case 102:
notFoundRoute = "/404";
- _context.next = 105;
+ _context.next = 108;
break;
- case 102:
- _context.prev = 102;
- _context.t1 = _context["catch"](96);
+ case 105:
+ _context.prev = 105;
+ _context.t1 = _context["catch"](99);
notFoundRoute = "/_error";
- case 105:
- _context.next = 107;
+ case 108:
+ _context.next = 110;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -2309,14 +2398,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
as,
resolvedAs,
{
+ href: notFoundRoute,
+ pathname: notFoundRoute,
+ as: resolvedAs,
+ query: query,
shallow: false
}
);
- case 107:
+ case 110:
routeInfo = _context.sent;
- case 108:
+ case 111:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -2329,7 +2422,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
isValidShallowRoute =
options.shallow && this.route === route;
- _context.next = 114;
+ _context.next = 117;
return this.set(
route,
pathname,
@@ -2348,9 +2441,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 114:
+ case 117:
if (!error) {
- _context.next = 117;
+ _context.next = 120;
break;
}
@@ -2362,7 +2455,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 117:
+ case 120:
if (false) {
}
@@ -2373,21 +2466,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 122:
- _context.prev = 122;
- _context.t2 = _context["catch"](79);
+ case 125:
+ _context.prev = 125;
+ _context.t2 = _context["catch"](82);
if (!_context.t2.cancelled) {
- _context.next = 126;
+ _context.next = 129;
break;
}
return _context.abrupt("return", false);
- case 126:
+ case 129:
throw _context.t2;
- case 127:
+ case 130:
case "end":
return _context.stop();
}
@@ -2396,9 +2489,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [79, 122],
- [96, 102]
+ [37, 47],
+ [82, 125],
+ [99, 105]
]
);
})
@@ -3484,6 +3577,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/***/
},
+ /***/ lSNA: /***/ function(module, exports) {
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ module.exports = _defineProperty;
+
+ /***/
+ },
+
/***/ ls82: /***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 13.6s | 13.6s | ⚠️ +11ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | N/A | N/A |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| 677f882d2ed8..00d9.js gzip | N/A | 13.4 kB | N/A |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +312 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Serverless bundles Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _error.js | 1 MB | 1 MB | ✓ |
| 404.html | 2.67 kB | 2.67 kB | ✓ |
| hooks.html | 1.92 kB | 1.92 kB | ✓ |
| index.js | 1 MB | 1 MB | ✓ |
| link.js | 1.06 MB | 1.07 MB | ⚠️ +2.46 kB |
| routerDirect.js | 1.06 MB | 1.06 MB | ⚠️ +2.46 kB |
| withRouter.js | 1.06 MB | 1.06 MB | ⚠️ +2.46 kB |
| Overall change | 5.19 MB | 5.19 MB | ⚠️ +7.38 kB |
Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 14s | 14.1s | ⚠️ +133ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.301 | 2.352 | ⚠️ +0.05 |
| / avg req/sec | 1086.55 | 1062.83 | ⚠️ -23.72 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.724 | 1.633 | -0.09 |
| /error-in-render avg req/sec | 1450.41 | 1530.95 | +80.54 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 597-6c246419..806f.js gzip | 13 kB | 13.3 kB | ⚠️ +305 B |
| framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
| main-HASH.js gzip | 6.57 kB | 6.57 kB | ✓ |
| webpack-HASH.js gzip | 954 B | 954 B | ✓ |
| Overall change | 59.8 kB | 60.2 kB | ⚠️ +305 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-6e0a903..b885.js gzip | 1.26 kB | 1.26 kB | ✓ |
| _error-7a100..a392.js gzip | 3.38 kB | 3.38 kB | ✓ |
| hooks-f7e199..11b9.js gzip | 904 B | 904 B | ✓ |
| index-3dc22c..ffbb.js gzip | 232 B | 232 B | ✓ |
| link-c010d28..b60a.js gzip | 1.63 kB | 1.63 kB | ✓ |
| routerDirect..323a.js gzip | 308 B | 308 B | ✓ |
| withRouter-a..2ef8.js gzip | 304 B | 304 B | ✓ |
| Overall change | 8.02 kB | 8.02 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 299 B | 299 B | ✓ |
| Overall change | 299 B | 299 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 584 B | 584 B | ✓ |
| link.html gzip | 592 B | 591 B | -1 B |
| withRouter.html gzip | 577 B | 579 B | ⚠️ +2 B |
| Overall change | 1.75 kB | 1.75 kB | ⚠️ +1 B |
Diffs
Diff for 677f882d2ed8..dc0f149c4.js
Diff too large to display
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "_FtKNr3SoGS_ZN8gGCqZt",
+ "buildId": "WbJNQxGfan0mUnzKzAN1U",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/_FtKNr3SoGS_ZN8gGCqZt/_buildManifest.js"
+ src="/_next/static/WbJNQxGfan0mUnzKzAN1U/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/_FtKNr3SoGS_ZN8gGCqZt/_ssgManifest.js"
+ src="/_next/static/WbJNQxGfan0mUnzKzAN1U/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "_FtKNr3SoGS_ZN8gGCqZt",
+ "buildId": "WbJNQxGfan0mUnzKzAN1U",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/_FtKNr3SoGS_ZN8gGCqZt/_buildManifest.js"
+ src="/_next/static/WbJNQxGfan0mUnzKzAN1U/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/_FtKNr3SoGS_ZN8gGCqZt/_ssgManifest.js"
+ src="/_next/static/WbJNQxGfan0mUnzKzAN1U/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "_FtKNr3SoGS_ZN8gGCqZt",
+ "buildId": "WbJNQxGfan0mUnzKzAN1U",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/_FtKNr3SoGS_ZN8gGCqZt/_buildManifest.js"
+ src="/_next/static/WbJNQxGfan0mUnzKzAN1U/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/_FtKNr3SoGS_ZN8gGCqZt/_ssgManifest.js"
+ src="/_next/static/WbJNQxGfan0mUnzKzAN1U/_ssgManifest.js"
async=""
></script>
</body>
Failing test suites
Commit: e0d90eb211a9d434cd92eeb9cfdfb96cecb177ea
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).toBeCloseTo(expected, precision)
Expected: 64.1
Received: 64.2
Expected precision: 1
Expected difference: < 0.05
Received difference: 0.10000000000000853
96 |
97 | // should be no bigger than 64.2 kb
> 98 | expect(parseFloat(indexFirstLoad)).toBeCloseTo(64.1, 1)
| ^
99 | expect(indexFirstLoad.endsWith('kB')).toBe(true)
100 |
101 | expect(parseFloat(err404Size) - 3.7).toBeLessThanOrEqual(0)
at Object.<anonymous> (integration/build-output/test/index.test.js:98:42)
Stats from current PR
Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 12.4s | 12.4s | -61ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.541 | 2.503 | -0.04 |
| / avg req/sec | 983.75 | 998.71 | +14.96 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.877 | 1.736 | -0.14 |
| /error-in-render avg req/sec | 1332.22 | 1440.24 | +108.02 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | 13.4 kB | ⚠️ +312 B |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +312 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Rendered Page Sizes
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 613 B | 613 B | ✓ |
| link.html gzip | 619 B | 619 B | ✓ |
| withRouter.html gzip | 607 B | 607 B | ✓ |
| Overall change | 1.84 kB | 1.84 kB | ✓ |
Diffs
Diff for 677f882d2ed8..abf803634.js
@@ -1173,6 +1173,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _regeneratorRuntime = __webpack_require__("o0o1");
+ var _defineProperty = __webpack_require__("lSNA");
+
var _asyncToGenerator = __webpack_require__("yXPU");
var _classCallCheck = __webpack_require__("lwsE");
@@ -1181,6 +1183,44 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _slicedToArray = __webpack_require__("J4zp");
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly)
+ symbols = symbols.filter(function(sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+
+ function _objectSpread(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function(key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(
+ target,
+ Object.getOwnPropertyDescriptors(source)
+ );
+ } else {
+ ownKeys(Object(source)).forEach(function(key) {
+ Object.defineProperty(
+ target,
+ key,
+ Object.getOwnPropertyDescriptor(source, key)
+ );
+ });
+ }
+ }
+ return target;
+ }
+
exports.__esModule = true;
exports.getDomainLocale = getDomainLocale;
exports.addLocale = addLocale;
@@ -1583,6 +1623,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isSsr = void 0;
this.isFallback = void 0;
this._inFlightRoute = void 0;
+ this._inFlightHref = void 0;
+ this._inFlightPathname = void 0;
this._shallow = void 0;
this.locale = void 0;
this.locales = void 0;
@@ -1820,6 +1862,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _this2 = this;
var _options$scroll,
+ _options$shallow,
localeChange,
parsedAs,
localePathResult,
@@ -1827,14 +1870,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_this$locales,
detectedDomain,
asNoBasePath,
- _options$shallow,
- shallow,
- routeProps,
- cleanedAs,
parsed,
_parsed,
pathname,
query,
+ baseRouteProps,
+ href,
+ cleanedAs,
+ _routeProps,
pages,
rewrites,
_yield,
@@ -1848,6 +1891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shouldInterpolate,
interpolatedAs,
missingParams,
+ routeProps,
routeInfo,
_routeInfo,
error,
@@ -1963,19 +2007,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
performance.mark("routeChange");
}
- (_options$shallow = options.shallow),
- (shallow =
- _options$shallow === void 0
- ? false
- : _options$shallow);
- routeProps = {
- shallow: shallow
+ parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+ url
+ );
+ (_parsed = parsed),
+ (pathname = _parsed.pathname),
+ (query = _parsed.query); // This is what we know so far
+ // We will need to fill in href, as, pathname before we pass routeProps beyond this function
+
+ baseRouteProps = {
+ query: query,
+ shallow:
+ (_options$shallow = options.shallow) != null
+ ? _options$shallow
+ : false
};
if (this._inFlightRoute) {
+ href = this._inFlightHref;
this.abortComponentLoad(
this._inFlightRoute,
- routeProps
+ _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(href)
+ ? delBasePath(href)
+ : href
+ ),
+ as: delLocale(
+ hasBasePath(this._inFlightRoute)
+ ? delBasePath(this._inFlightRoute)
+ : this._inFlightRoute
+ ),
+ pathname: this._inFlightPathname
+ }
+ )
);
}
@@ -1990,7 +2058,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ this._inFlightHref = delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ); // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -1999,15 +2070,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 34;
+ _context.next = 37;
break;
}
this.asPath = cleanedAs;
+ _routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ as: delLocale(
+ hasBasePath(as) ? delBasePath(as) : url
+ ),
+ pathname: this.pathname // old pathname still applies if we're only changing hash
+ }
+ );
Router.events.emit(
"hashChangeStart",
as,
- routeProps
+ _routeProps
); // TODO: do we need the resolved href when only a hash change?
this.changeState(method, url, as, options);
@@ -2016,44 +2100,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit(
"hashChangeComplete",
as,
- routeProps
+ _routeProps
);
return _context.abrupt("return", true);
- case 34:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
- url
- );
- (_parsed = parsed),
- (pathname = _parsed.pathname),
- (query = _parsed.query); // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
- _context.prev = 36;
- _context.next = 39;
+ case 37:
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
parsed = this._resolveHref(parsed, pages);
if (parsed.pathname !== pathname) {
@@ -2089,13 +2164,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
+ this._inFlightPathname = route;
+
if (isLocalURL(as)) {
- _context.next = 62;
+ _context.next = 64;
break;
}
if (true) {
- _context.next = 60;
+ _context.next = 62;
break;
}
@@ -2109,18 +2186,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://err.sh/next.js/invalid-relative-url-external-as"
);
- case 60:
+ case 62:
window.location.href = as;
return _context.abrupt("return", false);
- case 62:
+ case 64:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 78;
+ _context.next = 80;
break;
}
@@ -2143,7 +2220,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 77;
+ _context.next = 79;
break;
}
@@ -2154,7 +2231,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 75;
+ _context.next = 77;
break;
}
@@ -2185,11 +2262,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 75:
- _context.next = 78;
+ case 77:
+ _context.next = 80;
break;
- case 77:
+ case 79:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -2205,14 +2282,26 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 78:
+ case 80:
+ routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ // does this value already exist somewhere?
+ as: resolvedAs,
+ pathname: route
+ }
+ );
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 79;
- _context.next = 82;
+ _context.prev = 82;
+ _context.next = 85;
return this.getRouteInfo(
route,
pathname,
@@ -2222,7 +2311,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 82:
+ case 85:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -2231,14 +2320,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 95;
+ _context.next = 98;
break;
}
@@ -2247,7 +2336,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2257,7 +2346,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages, false);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2273,35 +2362,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 93:
+ case 96:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 95:
+ case 98:
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
- _context.prev = 96;
- _context.next = 99;
+ _context.prev = 99;
+ _context.next = 102;
return this.fetchComponent("/404");
- case 99:
+ case 102:
notFoundRoute = "/404";
- _context.next = 105;
+ _context.next = 108;
break;
- case 102:
- _context.prev = 102;
- _context.t1 = _context["catch"](96);
+ case 105:
+ _context.prev = 105;
+ _context.t1 = _context["catch"](99);
notFoundRoute = "/_error";
- case 105:
- _context.next = 107;
+ case 108:
+ _context.next = 110;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -2309,14 +2398,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
as,
resolvedAs,
{
+ href: notFoundRoute,
+ pathname: notFoundRoute,
+ as: resolvedAs,
+ query: query,
shallow: false
}
);
- case 107:
+ case 110:
routeInfo = _context.sent;
- case 108:
+ case 111:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -2329,7 +2422,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
isValidShallowRoute =
options.shallow && this.route === route;
- _context.next = 114;
+ _context.next = 117;
return this.set(
route,
pathname,
@@ -2348,9 +2441,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 114:
+ case 117:
if (!error) {
- _context.next = 117;
+ _context.next = 120;
break;
}
@@ -2362,7 +2455,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 117:
+ case 120:
if (false) {
}
@@ -2373,21 +2466,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 122:
- _context.prev = 122;
- _context.t2 = _context["catch"](79);
+ case 125:
+ _context.prev = 125;
+ _context.t2 = _context["catch"](82);
if (!_context.t2.cancelled) {
- _context.next = 126;
+ _context.next = 129;
break;
}
return _context.abrupt("return", false);
- case 126:
+ case 129:
throw _context.t2;
- case 127:
+ case 130:
case "end":
return _context.stop();
}
@@ -2396,9 +2489,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [79, 122],
- [96, 102]
+ [37, 47],
+ [82, 125],
+ [99, 105]
]
);
})
@@ -3484,6 +3577,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/***/
},
+ /***/ lSNA: /***/ function(module, exports) {
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ module.exports = _defineProperty;
+
+ /***/
+ },
+
/***/ ls82: /***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.193396d0f03b1ed0a755.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 14.5s | 14.7s | ⚠️ +150ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | N/A | N/A |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| 677f882d2ed8..00d9.js gzip | N/A | 13.4 kB | N/A |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +312 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Serverless bundles Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _error.js | 1 MB | 1 MB | ✓ |
| 404.html | 2.67 kB | 2.67 kB | ✓ |
| hooks.html | 1.92 kB | 1.92 kB | ✓ |
| index.js | 1 MB | 1 MB | ✓ |
| link.js | 1.06 MB | 1.07 MB | ⚠️ +2.46 kB |
| routerDirect.js | 1.06 MB | 1.06 MB | ⚠️ +2.46 kB |
| withRouter.js | 1.06 MB | 1.06 MB | ⚠️ +2.46 kB |
| Overall change | 5.19 MB | 5.19 MB | ⚠️ +7.38 kB |
Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 15.4s | 15.2s | -234ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.74 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.624 | 2.469 | -0.16 |
| / avg req/sec | 952.84 | 1012.68 | +59.84 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.819 | 1.698 | -0.12 |
| /error-in-render avg req/sec | 1374.4 | 1471.9 | +97.5 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 597-6c246419..806f.js gzip | 13 kB | 13.3 kB | ⚠️ +305 B |
| framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
| main-HASH.js gzip | 6.57 kB | 6.57 kB | ✓ |
| webpack-HASH.js gzip | 954 B | 954 B | ✓ |
| Overall change | 59.8 kB | 60.2 kB | ⚠️ +305 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-6e0a903..b885.js gzip | 1.26 kB | 1.26 kB | ✓ |
| _error-7a100..a392.js gzip | 3.38 kB | 3.38 kB | ✓ |
| hooks-f7e199..11b9.js gzip | 904 B | 904 B | ✓ |
| index-3dc22c..ffbb.js gzip | 232 B | 232 B | ✓ |
| link-c010d28..b60a.js gzip | 1.63 kB | 1.63 kB | ✓ |
| routerDirect..323a.js gzip | 308 B | 308 B | ✓ |
| withRouter-a..2ef8.js gzip | 304 B | 304 B | ✓ |
| Overall change | 8.02 kB | 8.02 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 299 B | 299 B | ✓ |
| Overall change | 299 B | 299 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 584 B | 584 B | ✓ |
| link.html gzip | 592 B | 591 B | -1 B |
| withRouter.html gzip | 577 B | 579 B | ⚠️ +2 B |
| Overall change | 1.75 kB | 1.75 kB | ⚠️ +1 B |
Diffs
Diff for 677f882d2ed8..dc0f149c4.js
Diff too large to display
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "9-5ioWGn9ozBfaptKBHDX",
+ "buildId": "IedchOg-_QW2CL1F_wc8b",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/9-5ioWGn9ozBfaptKBHDX/_buildManifest.js"
+ src="/_next/static/IedchOg-_QW2CL1F_wc8b/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/9-5ioWGn9ozBfaptKBHDX/_ssgManifest.js"
+ src="/_next/static/IedchOg-_QW2CL1F_wc8b/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "9-5ioWGn9ozBfaptKBHDX",
+ "buildId": "IedchOg-_QW2CL1F_wc8b",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/9-5ioWGn9ozBfaptKBHDX/_buildManifest.js"
+ src="/_next/static/IedchOg-_QW2CL1F_wc8b/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/9-5ioWGn9ozBfaptKBHDX/_ssgManifest.js"
+ src="/_next/static/IedchOg-_QW2CL1F_wc8b/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "9-5ioWGn9ozBfaptKBHDX",
+ "buildId": "IedchOg-_QW2CL1F_wc8b",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f543e03a5bd3464600d9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/9-5ioWGn9ozBfaptKBHDX/_buildManifest.js"
+ src="/_next/static/IedchOg-_QW2CL1F_wc8b/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/9-5ioWGn9ozBfaptKBHDX/_ssgManifest.js"
+ src="/_next/static/IedchOg-_QW2CL1F_wc8b/_ssgManifest.js"
async=""
></script>
</body>
Failing test suites
Commit: c29cd4cc55ebdfd83e6f3753eac315b0e36bd244
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).toBeCloseTo(expected, precision)
Expected: 67.4
Received: 67.3
Expected precision: 1
Expected difference: < 0.05
Received difference: 0.10000000000000853
102 | expect(err404Size.endsWith('kB')).toBe(true)
103 |
> 104 | expect(parseFloat(err404FirstLoad)).toBeCloseTo(67.4, 1)
| ^
105 | expect(err404FirstLoad.endsWith('kB')).toBe(true)
106 |
107 | expect(parseFloat(sharedByAll)).toBeCloseTo(63.8, 1)
at Object.<anonymous> (integration/build-output/test/index.test.js:104:43)
Stats from current PR
Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 10.9s | 11s | ⚠️ +43ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.131 | 2.095 | -0.04 |
| / avg req/sec | 1172.98 | 1193.49 | +20.51 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.353 | 1.32 | -0.03 |
| /error-in-render avg req/sec | 1847.53 | 1893.94 | +46.41 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | 13.4 kB | ⚠️ +308 B |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +308 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Rendered Page Sizes Overall decrease ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 613 B | 613 B | ✓ |
| link.html gzip | 619 B | 618 B | -1 B |
| withRouter.html gzip | 607 B | 606 B | -1 B |
| Overall change | 1.84 kB | 1.84 kB | -2 B |
Diffs
Diff for 677f882d2ed8..abf803634.js
@@ -1173,6 +1173,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _regeneratorRuntime = __webpack_require__("o0o1");
+ var _defineProperty = __webpack_require__("lSNA");
+
var _asyncToGenerator = __webpack_require__("yXPU");
var _classCallCheck = __webpack_require__("lwsE");
@@ -1181,6 +1183,44 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _slicedToArray = __webpack_require__("J4zp");
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly)
+ symbols = symbols.filter(function(sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+
+ function _objectSpread(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function(key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(
+ target,
+ Object.getOwnPropertyDescriptors(source)
+ );
+ } else {
+ ownKeys(Object(source)).forEach(function(key) {
+ Object.defineProperty(
+ target,
+ key,
+ Object.getOwnPropertyDescriptor(source, key)
+ );
+ });
+ }
+ }
+ return target;
+ }
+
exports.__esModule = true;
exports.getDomainLocale = getDomainLocale;
exports.addLocale = addLocale;
@@ -1583,6 +1623,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isSsr = void 0;
this.isFallback = void 0;
this._inFlightRoute = void 0;
+ this._inFlightHref = void 0;
+ this._inFlightPathname = void 0;
this._shallow = void 0;
this.locale = void 0;
this.locales = void 0;
@@ -1820,6 +1862,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _this2 = this;
var _options$scroll,
+ _options$shallow,
localeChange,
parsedAs,
localePathResult,
@@ -1827,14 +1870,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_this$locales,
detectedDomain,
asNoBasePath,
- _options$shallow,
- shallow,
- routeProps,
- cleanedAs,
parsed,
_parsed,
pathname,
query,
+ baseRouteProps,
+ href,
+ cleanedAs,
+ _routeProps,
pages,
rewrites,
_yield,
@@ -1848,6 +1891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shouldInterpolate,
interpolatedAs,
missingParams,
+ routeProps,
routeInfo,
_routeInfo,
error,
@@ -1963,19 +2007,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
performance.mark("routeChange");
}
- (_options$shallow = options.shallow),
- (shallow =
- _options$shallow === void 0
- ? false
- : _options$shallow);
- routeProps = {
- shallow: shallow
+ parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+ url
+ );
+ (_parsed = parsed),
+ (pathname = _parsed.pathname),
+ (query = _parsed.query); // This is what we know so far
+ // We will need to fill in href, as, pathname before we pass routeProps beyond this function
+
+ baseRouteProps = {
+ query: query,
+ shallow:
+ (_options$shallow = options.shallow) != null
+ ? _options$shallow
+ : false
};
if (this._inFlightRoute) {
+ href = this._inFlightHref;
this.abortComponentLoad(
this._inFlightRoute,
- routeProps
+ _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(href)
+ ? delBasePath(href)
+ : href
+ ),
+ as: delLocale(
+ hasBasePath(this._inFlightRoute)
+ ? delBasePath(this._inFlightRoute)
+ : this._inFlightRoute
+ ),
+ pathname: this._inFlightPathname
+ }
+ )
);
}
@@ -1990,7 +2058,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ this._inFlightHref = url; // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -1999,15 +2068,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 34;
+ _context.next = 37;
break;
}
this.asPath = cleanedAs;
+ _routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ as: delLocale(
+ hasBasePath(as) ? delBasePath(as) : url
+ ),
+ pathname: this.pathname // old pathname still applies if we're only changing hash
+ }
+ );
Router.events.emit(
"hashChangeStart",
as,
- routeProps
+ _routeProps
); // TODO: do we need the resolved href when only a hash change?
this.changeState(method, url, as, options);
@@ -2016,44 +2098,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit(
"hashChangeComplete",
as,
- routeProps
+ _routeProps
);
return _context.abrupt("return", true);
- case 34:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
- url
- );
- (_parsed = parsed),
- (pathname = _parsed.pathname),
- (query = _parsed.query); // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
- _context.prev = 36;
- _context.next = 39;
+ case 37:
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
parsed = this._resolveHref(parsed, pages);
if (parsed.pathname !== pathname) {
@@ -2089,13 +2162,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
+ this._inFlightPathname = route;
+
if (isLocalURL(as)) {
- _context.next = 62;
+ _context.next = 64;
break;
}
if (true) {
- _context.next = 60;
+ _context.next = 62;
break;
}
@@ -2109,18 +2184,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://err.sh/next.js/invalid-relative-url-external-as"
);
- case 60:
+ case 62:
window.location.href = as;
return _context.abrupt("return", false);
- case 62:
+ case 64:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 78;
+ _context.next = 80;
break;
}
@@ -2143,7 +2218,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 77;
+ _context.next = 79;
break;
}
@@ -2154,7 +2229,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 75;
+ _context.next = 77;
break;
}
@@ -2185,11 +2260,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 75:
- _context.next = 78;
+ case 77:
+ _context.next = 80;
break;
- case 77:
+ case 79:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -2205,14 +2280,26 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 78:
+ case 80:
+ routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ // does this value already exist somewhere?
+ as: resolvedAs,
+ pathname: route
+ }
+ );
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 79;
- _context.next = 82;
+ _context.prev = 82;
+ _context.next = 85;
return this.getRouteInfo(
route,
pathname,
@@ -2222,7 +2309,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 82:
+ case 85:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -2231,14 +2318,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 95;
+ _context.next = 98;
break;
}
@@ -2247,7 +2334,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2257,7 +2344,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages, false);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2273,35 +2360,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 93:
+ case 96:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 95:
+ case 98:
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
- _context.prev = 96;
- _context.next = 99;
+ _context.prev = 99;
+ _context.next = 102;
return this.fetchComponent("/404");
- case 99:
+ case 102:
notFoundRoute = "/404";
- _context.next = 105;
+ _context.next = 108;
break;
- case 102:
- _context.prev = 102;
- _context.t1 = _context["catch"](96);
+ case 105:
+ _context.prev = 105;
+ _context.t1 = _context["catch"](99);
notFoundRoute = "/_error";
- case 105:
- _context.next = 107;
+ case 108:
+ _context.next = 110;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -2309,14 +2396,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
as,
resolvedAs,
{
+ href: notFoundRoute,
+ pathname: notFoundRoute,
+ as: resolvedAs,
+ query: query,
shallow: false
}
);
- case 107:
+ case 110:
routeInfo = _context.sent;
- case 108:
+ case 111:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -2329,7 +2420,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
isValidShallowRoute =
options.shallow && this.route === route;
- _context.next = 114;
+ _context.next = 117;
return this.set(
route,
pathname,
@@ -2348,9 +2439,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 114:
+ case 117:
if (!error) {
- _context.next = 117;
+ _context.next = 120;
break;
}
@@ -2362,7 +2453,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 117:
+ case 120:
if (false) {
}
@@ -2373,21 +2464,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 122:
- _context.prev = 122;
- _context.t2 = _context["catch"](79);
+ case 125:
+ _context.prev = 125;
+ _context.t2 = _context["catch"](82);
if (!_context.t2.cancelled) {
- _context.next = 126;
+ _context.next = 129;
break;
}
return _context.abrupt("return", false);
- case 126:
+ case 129:
throw _context.t2;
- case 127:
+ case 130:
case "end":
return _context.stop();
}
@@ -2396,9 +2487,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [79, 122],
- [96, 102]
+ [37, 47],
+ [82, 125],
+ [99, 105]
]
);
})
@@ -3484,6 +3575,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/***/
},
+ /***/ lSNA: /***/ function(module, exports) {
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ module.exports = _defineProperty;
+
+ /***/
+ },
+
/***/ ls82: /***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 11.7s | 13s | ⚠️ +1.3s |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | N/A | N/A |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| 677f882d2ed8..77e9.js gzip | N/A | 13.4 kB | N/A |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +308 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Serverless bundles Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _error.js | 1 MB | 1 MB | ✓ |
| 404.html | 2.67 kB | 2.67 kB | ✓ |
| hooks.html | 1.92 kB | 1.92 kB | ✓ |
| index.js | 1 MB | 1 MB | ✓ |
| link.js | 1.06 MB | 1.07 MB | ⚠️ +2.41 kB |
| routerDirect.js | 1.06 MB | 1.06 MB | ⚠️ +2.41 kB |
| withRouter.js | 1.06 MB | 1.06 MB | ⚠️ +2.41 kB |
| Overall change | 5.19 MB | 5.19 MB | ⚠️ +7.23 kB |
Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 13.2s | 13.3s | ⚠️ +54ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Page Load Tests Overall decrease ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.107 | 2.13 | ⚠️ +0.02 |
| / avg req/sec | 1186.7 | 1173.47 | ⚠️ -13.23 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.34 | 1.348 | ⚠️ +0.01 |
| /error-in-render avg req/sec | 1865.42 | 1854.96 | ⚠️ -10.46 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 597-6c246419..806f.js gzip | 13 kB | 13.3 kB | ⚠️ +301 B |
| framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
| main-HASH.js gzip | 6.57 kB | 6.57 kB | ✓ |
| webpack-HASH.js gzip | 954 B | 954 B | ✓ |
| Overall change | 59.8 kB | 60.1 kB | ⚠️ +301 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-6e0a903..b885.js gzip | 1.26 kB | 1.26 kB | ✓ |
| _error-7a100..a392.js gzip | 3.38 kB | 3.38 kB | ✓ |
| hooks-f7e199..11b9.js gzip | 904 B | 904 B | ✓ |
| index-3dc22c..ffbb.js gzip | 232 B | 232 B | ✓ |
| link-c010d28..b60a.js gzip | 1.63 kB | 1.63 kB | ✓ |
| routerDirect..323a.js gzip | 308 B | 308 B | ✓ |
| withRouter-a..2ef8.js gzip | 304 B | 304 B | ✓ |
| Overall change | 8.02 kB | 8.02 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 299 B | 299 B | ✓ |
| Overall change | 299 B | 299 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 584 B | 588 B | ⚠️ +4 B |
| link.html gzip | 592 B | 595 B | ⚠️ +3 B |
| withRouter.html gzip | 577 B | 581 B | ⚠️ +4 B |
| Overall change | 1.75 kB | 1.76 kB | ⚠️ +11 B |
Diffs
Diff for 677f882d2ed8..dc0f149c4.js
Diff too large to display
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "XJB8ruQCvDp5bgkZfN1it",
+ "buildId": "a4eVOnsIz8n_B27nDFZ-0",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/XJB8ruQCvDp5bgkZfN1it/_buildManifest.js"
+ src="/_next/static/a4eVOnsIz8n_B27nDFZ-0/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/XJB8ruQCvDp5bgkZfN1it/_ssgManifest.js"
+ src="/_next/static/a4eVOnsIz8n_B27nDFZ-0/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "XJB8ruQCvDp5bgkZfN1it",
+ "buildId": "a4eVOnsIz8n_B27nDFZ-0",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/XJB8ruQCvDp5bgkZfN1it/_buildManifest.js"
+ src="/_next/static/a4eVOnsIz8n_B27nDFZ-0/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/XJB8ruQCvDp5bgkZfN1it/_ssgManifest.js"
+ src="/_next/static/a4eVOnsIz8n_B27nDFZ-0/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "XJB8ruQCvDp5bgkZfN1it",
+ "buildId": "a4eVOnsIz8n_B27nDFZ-0",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/XJB8ruQCvDp5bgkZfN1it/_buildManifest.js"
+ src="/_next/static/a4eVOnsIz8n_B27nDFZ-0/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/XJB8ruQCvDp5bgkZfN1it/_ssgManifest.js"
+ src="/_next/static/a4eVOnsIz8n_B27nDFZ-0/_ssgManifest.js"
async=""
></script>
</body>
Stats from current PR
Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 8s | 8.4s | ⚠️ +371ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 1.695 | 1.595 | -0.1 |
| / avg req/sec | 1475.12 | 1567.48 | +92.36 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.078 | 1.085 | ⚠️ +0.01 |
| /error-in-render avg req/sec | 2319.27 | 2304.15 | ⚠️ -15.12 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | 13.4 kB | ⚠️ +308 B |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +308 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Rendered Page Sizes Overall decrease ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 613 B | 613 B | ✓ |
| link.html gzip | 619 B | 618 B | -1 B |
| withRouter.html gzip | 607 B | 606 B | -1 B |
| Overall change | 1.84 kB | 1.84 kB | -2 B |
Diffs
Diff for 677f882d2ed8..abf803634.js
@@ -1173,6 +1173,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _regeneratorRuntime = __webpack_require__("o0o1");
+ var _defineProperty = __webpack_require__("lSNA");
+
var _asyncToGenerator = __webpack_require__("yXPU");
var _classCallCheck = __webpack_require__("lwsE");
@@ -1181,6 +1183,44 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _slicedToArray = __webpack_require__("J4zp");
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly)
+ symbols = symbols.filter(function(sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+
+ function _objectSpread(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function(key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(
+ target,
+ Object.getOwnPropertyDescriptors(source)
+ );
+ } else {
+ ownKeys(Object(source)).forEach(function(key) {
+ Object.defineProperty(
+ target,
+ key,
+ Object.getOwnPropertyDescriptor(source, key)
+ );
+ });
+ }
+ }
+ return target;
+ }
+
exports.__esModule = true;
exports.getDomainLocale = getDomainLocale;
exports.addLocale = addLocale;
@@ -1583,6 +1623,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isSsr = void 0;
this.isFallback = void 0;
this._inFlightRoute = void 0;
+ this._inFlightHref = void 0;
+ this._inFlightPathname = void 0;
this._shallow = void 0;
this.locale = void 0;
this.locales = void 0;
@@ -1820,6 +1862,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _this2 = this;
var _options$scroll,
+ _options$shallow,
localeChange,
parsedAs,
localePathResult,
@@ -1827,14 +1870,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_this$locales,
detectedDomain,
asNoBasePath,
- _options$shallow,
- shallow,
- routeProps,
- cleanedAs,
parsed,
_parsed,
pathname,
query,
+ baseRouteProps,
+ href,
+ cleanedAs,
+ _routeProps,
pages,
rewrites,
_yield,
@@ -1848,6 +1891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shouldInterpolate,
interpolatedAs,
missingParams,
+ routeProps,
routeInfo,
_routeInfo,
error,
@@ -1963,19 +2007,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
performance.mark("routeChange");
}
- (_options$shallow = options.shallow),
- (shallow =
- _options$shallow === void 0
- ? false
- : _options$shallow);
- routeProps = {
- shallow: shallow
+ parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+ url
+ );
+ (_parsed = parsed),
+ (pathname = _parsed.pathname),
+ (query = _parsed.query); // This is what we know so far
+ // We will need to fill in href, as, pathname before we pass routeProps beyond this function
+
+ baseRouteProps = {
+ query: query,
+ shallow:
+ (_options$shallow = options.shallow) != null
+ ? _options$shallow
+ : false
};
if (this._inFlightRoute) {
+ href = this._inFlightHref;
this.abortComponentLoad(
this._inFlightRoute,
- routeProps
+ _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(href)
+ ? delBasePath(href)
+ : href
+ ),
+ as: delLocale(
+ hasBasePath(this._inFlightRoute)
+ ? delBasePath(this._inFlightRoute)
+ : this._inFlightRoute
+ ),
+ pathname: this._inFlightPathname
+ }
+ )
);
}
@@ -1990,7 +2058,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ this._inFlightHref = url; // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -1999,15 +2068,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 34;
+ _context.next = 37;
break;
}
this.asPath = cleanedAs;
+ _routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ as: delLocale(
+ hasBasePath(as) ? delBasePath(as) : url
+ ),
+ pathname: this.pathname // old pathname still applies if we're only changing hash
+ }
+ );
Router.events.emit(
"hashChangeStart",
as,
- routeProps
+ _routeProps
); // TODO: do we need the resolved href when only a hash change?
this.changeState(method, url, as, options);
@@ -2016,44 +2098,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit(
"hashChangeComplete",
as,
- routeProps
+ _routeProps
);
return _context.abrupt("return", true);
- case 34:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
- url
- );
- (_parsed = parsed),
- (pathname = _parsed.pathname),
- (query = _parsed.query); // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
- _context.prev = 36;
- _context.next = 39;
+ case 37:
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
parsed = this._resolveHref(parsed, pages);
if (parsed.pathname !== pathname) {
@@ -2089,13 +2162,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
+ this._inFlightPathname = route;
+
if (isLocalURL(as)) {
- _context.next = 62;
+ _context.next = 64;
break;
}
if (true) {
- _context.next = 60;
+ _context.next = 62;
break;
}
@@ -2109,18 +2184,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://err.sh/next.js/invalid-relative-url-external-as"
);
- case 60:
+ case 62:
window.location.href = as;
return _context.abrupt("return", false);
- case 62:
+ case 64:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 78;
+ _context.next = 80;
break;
}
@@ -2143,7 +2218,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 77;
+ _context.next = 79;
break;
}
@@ -2154,7 +2229,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 75;
+ _context.next = 77;
break;
}
@@ -2185,11 +2260,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 75:
- _context.next = 78;
+ case 77:
+ _context.next = 80;
break;
- case 77:
+ case 79:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -2205,14 +2280,26 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 78:
+ case 80:
+ routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ // does this value already exist somewhere?
+ as: resolvedAs,
+ pathname: route
+ }
+ );
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 79;
- _context.next = 82;
+ _context.prev = 82;
+ _context.next = 85;
return this.getRouteInfo(
route,
pathname,
@@ -2222,7 +2309,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 82:
+ case 85:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -2231,14 +2318,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 95;
+ _context.next = 98;
break;
}
@@ -2247,7 +2334,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2257,7 +2344,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages, false);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2273,35 +2360,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 93:
+ case 96:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 95:
+ case 98:
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
- _context.prev = 96;
- _context.next = 99;
+ _context.prev = 99;
+ _context.next = 102;
return this.fetchComponent("/404");
- case 99:
+ case 102:
notFoundRoute = "/404";
- _context.next = 105;
+ _context.next = 108;
break;
- case 102:
- _context.prev = 102;
- _context.t1 = _context["catch"](96);
+ case 105:
+ _context.prev = 105;
+ _context.t1 = _context["catch"](99);
notFoundRoute = "/_error";
- case 105:
- _context.next = 107;
+ case 108:
+ _context.next = 110;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -2309,14 +2396,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
as,
resolvedAs,
{
+ href: notFoundRoute,
+ pathname: notFoundRoute,
+ as: resolvedAs,
+ query: query,
shallow: false
}
);
- case 107:
+ case 110:
routeInfo = _context.sent;
- case 108:
+ case 111:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -2329,7 +2420,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
isValidShallowRoute =
options.shallow && this.route === route;
- _context.next = 114;
+ _context.next = 117;
return this.set(
route,
pathname,
@@ -2348,9 +2439,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 114:
+ case 117:
if (!error) {
- _context.next = 117;
+ _context.next = 120;
break;
}
@@ -2362,7 +2453,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 117:
+ case 120:
if (false) {
}
@@ -2373,21 +2464,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 122:
- _context.prev = 122;
- _context.t2 = _context["catch"](79);
+ case 125:
+ _context.prev = 125;
+ _context.t2 = _context["catch"](82);
if (!_context.t2.cancelled) {
- _context.next = 126;
+ _context.next = 129;
break;
}
return _context.abrupt("return", false);
- case 126:
+ case 129:
throw _context.t2;
- case 127:
+ case 130:
case "end":
return _context.stop();
}
@@ -2396,9 +2487,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [79, 122],
- [96, 102]
+ [37, 47],
+ [82, 125],
+ [99, 105]
]
);
})
@@ -3484,6 +3575,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/***/
},
+ /***/ lSNA: /***/ function(module, exports) {
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ module.exports = _defineProperty;
+
+ /***/
+ },
+
/***/ ls82: /***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 9.9s | 10.1s | ⚠️ +219ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | N/A | N/A |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| 677f882d2ed8..77e9.js gzip | N/A | 13.4 kB | N/A |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +308 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Serverless bundles Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _error.js | 1 MB | 1 MB | ✓ |
| 404.html | 2.67 kB | 2.67 kB | ✓ |
| hooks.html | 1.92 kB | 1.92 kB | ✓ |
| index.js | 1 MB | 1 MB | ✓ |
| link.js | 1.06 MB | 1.07 MB | ⚠️ +2.41 kB |
| routerDirect.js | 1.06 MB | 1.06 MB | ⚠️ +2.41 kB |
| withRouter.js | 1.06 MB | 1.06 MB | ⚠️ +2.41 kB |
| Overall change | 5.19 MB | 5.19 MB | ⚠️ +7.23 kB |
Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 10.1s | 10.3s | ⚠️ +251ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 1.725 | 1.687 | -0.04 |
| / avg req/sec | 1449.31 | 1481.89 | +32.58 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.089 | 1.038 | -0.05 |
| /error-in-render avg req/sec | 2296.02 | 2408.69 | +112.67 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 597-6c246419..806f.js gzip | 13 kB | 13.3 kB | ⚠️ +301 B |
| framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
| main-HASH.js gzip | 6.57 kB | 6.57 kB | ✓ |
| webpack-HASH.js gzip | 954 B | 954 B | ✓ |
| Overall change | 59.8 kB | 60.1 kB | ⚠️ +301 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-6e0a903..b885.js gzip | 1.26 kB | 1.26 kB | ✓ |
| _error-7a100..a392.js gzip | 3.38 kB | 3.38 kB | ✓ |
| hooks-f7e199..11b9.js gzip | 904 B | 904 B | ✓ |
| index-3dc22c..ffbb.js gzip | 232 B | 232 B | ✓ |
| link-c010d28..b60a.js gzip | 1.63 kB | 1.63 kB | ✓ |
| routerDirect..323a.js gzip | 308 B | 308 B | ✓ |
| withRouter-a..2ef8.js gzip | 304 B | 304 B | ✓ |
| Overall change | 8.02 kB | 8.02 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 299 B | 299 B | ✓ |
| Overall change | 299 B | 299 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 584 B | 588 B | ⚠️ +4 B |
| link.html gzip | 592 B | 595 B | ⚠️ +3 B |
| withRouter.html gzip | 577 B | 581 B | ⚠️ +4 B |
| Overall change | 1.75 kB | 1.76 kB | ⚠️ +11 B |
Diffs
Diff for 677f882d2ed8..dc0f149c4.js
Diff too large to display
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "jxub0ch6OzbwT1ox6nibK",
+ "buildId": "N5VI9pxuPqDRe1d8hyoeq",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/jxub0ch6OzbwT1ox6nibK/_buildManifest.js"
+ src="/_next/static/N5VI9pxuPqDRe1d8hyoeq/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/jxub0ch6OzbwT1ox6nibK/_ssgManifest.js"
+ src="/_next/static/N5VI9pxuPqDRe1d8hyoeq/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "jxub0ch6OzbwT1ox6nibK",
+ "buildId": "N5VI9pxuPqDRe1d8hyoeq",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/jxub0ch6OzbwT1ox6nibK/_buildManifest.js"
+ src="/_next/static/N5VI9pxuPqDRe1d8hyoeq/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/jxub0ch6OzbwT1ox6nibK/_ssgManifest.js"
+ src="/_next/static/N5VI9pxuPqDRe1d8hyoeq/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "jxub0ch6OzbwT1ox6nibK",
+ "buildId": "N5VI9pxuPqDRe1d8hyoeq",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/jxub0ch6OzbwT1ox6nibK/_buildManifest.js"
+ src="/_next/static/N5VI9pxuPqDRe1d8hyoeq/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/jxub0ch6OzbwT1ox6nibK/_ssgManifest.js"
+ src="/_next/static/N5VI9pxuPqDRe1d8hyoeq/_ssgManifest.js"
async=""
></script>
</body>
Failing test suites
Commit: c29171d45477f4b4e59bd59aaad5e4117089aa3f
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).toBeCloseTo(expected, precision)
Expected: 63.8
Received: 63.9
Expected precision: 1
Expected difference: < 0.05
Received difference: 0.10000000000000142
105 | expect(err404FirstLoad.endsWith('kB')).toBe(true)
106 |
> 107 | expect(parseFloat(sharedByAll)).toBeCloseTo(63.8, 1)
| ^
108 | expect(sharedByAll.endsWith('kB')).toBe(true)
109 |
110 | if (_appSize.endsWith('kB')) {
at Object.<anonymous> (integration/build-output/test/index.test.js:107:39)
Stats from current PR
Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 11.4s | 11.4s | -3ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.294 | 2.248 | -0.05 |
| / avg req/sec | 1090.03 | 1111.97 | +21.94 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.664 | 1.605 | -0.06 |
| /error-in-render avg req/sec | 1502 | 1557.51 | +55.51 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | 13.4 kB | ⚠️ +308 B |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +308 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Rendered Page Sizes Overall decrease ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 613 B | 613 B | ✓ |
| link.html gzip | 619 B | 618 B | -1 B |
| withRouter.html gzip | 607 B | 606 B | -1 B |
| Overall change | 1.84 kB | 1.84 kB | -2 B |
Diffs
Diff for 677f882d2ed8..abf803634.js
@@ -1173,6 +1173,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _regeneratorRuntime = __webpack_require__("o0o1");
+ var _defineProperty = __webpack_require__("lSNA");
+
var _asyncToGenerator = __webpack_require__("yXPU");
var _classCallCheck = __webpack_require__("lwsE");
@@ -1181,6 +1183,44 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _slicedToArray = __webpack_require__("J4zp");
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly)
+ symbols = symbols.filter(function(sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+
+ function _objectSpread(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function(key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(
+ target,
+ Object.getOwnPropertyDescriptors(source)
+ );
+ } else {
+ ownKeys(Object(source)).forEach(function(key) {
+ Object.defineProperty(
+ target,
+ key,
+ Object.getOwnPropertyDescriptor(source, key)
+ );
+ });
+ }
+ }
+ return target;
+ }
+
exports.__esModule = true;
exports.getDomainLocale = getDomainLocale;
exports.addLocale = addLocale;
@@ -1583,6 +1623,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isSsr = void 0;
this.isFallback = void 0;
this._inFlightRoute = void 0;
+ this._inFlightHref = void 0;
+ this._inFlightPathname = void 0;
this._shallow = void 0;
this.locale = void 0;
this.locales = void 0;
@@ -1820,6 +1862,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _this2 = this;
var _options$scroll,
+ _options$shallow,
localeChange,
parsedAs,
localePathResult,
@@ -1827,14 +1870,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_this$locales,
detectedDomain,
asNoBasePath,
- _options$shallow,
- shallow,
- routeProps,
- cleanedAs,
parsed,
_parsed,
pathname,
query,
+ baseRouteProps,
+ href,
+ cleanedAs,
+ _routeProps,
pages,
rewrites,
_yield,
@@ -1848,6 +1891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shouldInterpolate,
interpolatedAs,
missingParams,
+ routeProps,
routeInfo,
_routeInfo,
error,
@@ -1963,19 +2007,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
performance.mark("routeChange");
}
- (_options$shallow = options.shallow),
- (shallow =
- _options$shallow === void 0
- ? false
- : _options$shallow);
- routeProps = {
- shallow: shallow
+ parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+ url
+ );
+ (_parsed = parsed),
+ (pathname = _parsed.pathname),
+ (query = _parsed.query); // This is what we know so far
+ // We will need to fill in href, as, pathname before we pass routeProps beyond this function
+
+ baseRouteProps = {
+ query: query,
+ shallow:
+ (_options$shallow = options.shallow) != null
+ ? _options$shallow
+ : false
};
if (this._inFlightRoute) {
+ href = this._inFlightHref;
this.abortComponentLoad(
this._inFlightRoute,
- routeProps
+ _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(href)
+ ? delBasePath(href)
+ : href
+ ),
+ as: delLocale(
+ hasBasePath(this._inFlightRoute)
+ ? delBasePath(this._inFlightRoute)
+ : this._inFlightRoute
+ ),
+ pathname: this._inFlightPathname
+ }
+ )
);
}
@@ -1990,7 +2058,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ this._inFlightHref = url; // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -1999,15 +2068,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 34;
+ _context.next = 37;
break;
}
this.asPath = cleanedAs;
+ _routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ as: delLocale(
+ hasBasePath(as) ? delBasePath(as) : url
+ ),
+ pathname: this.pathname // old pathname still applies if we're only changing hash
+ }
+ );
Router.events.emit(
"hashChangeStart",
as,
- routeProps
+ _routeProps
); // TODO: do we need the resolved href when only a hash change?
this.changeState(method, url, as, options);
@@ -2016,44 +2098,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit(
"hashChangeComplete",
as,
- routeProps
+ _routeProps
);
return _context.abrupt("return", true);
- case 34:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
- url
- );
- (_parsed = parsed),
- (pathname = _parsed.pathname),
- (query = _parsed.query); // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
- _context.prev = 36;
- _context.next = 39;
+ case 37:
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
parsed = this._resolveHref(parsed, pages);
if (parsed.pathname !== pathname) {
@@ -2089,13 +2162,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
+ this._inFlightPathname = route;
+
if (isLocalURL(as)) {
- _context.next = 62;
+ _context.next = 64;
break;
}
if (true) {
- _context.next = 60;
+ _context.next = 62;
break;
}
@@ -2109,18 +2184,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://err.sh/next.js/invalid-relative-url-external-as"
);
- case 60:
+ case 62:
window.location.href = as;
return _context.abrupt("return", false);
- case 62:
+ case 64:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 78;
+ _context.next = 80;
break;
}
@@ -2143,7 +2218,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 77;
+ _context.next = 79;
break;
}
@@ -2154,7 +2229,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 75;
+ _context.next = 77;
break;
}
@@ -2185,11 +2260,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 75:
- _context.next = 78;
+ case 77:
+ _context.next = 80;
break;
- case 77:
+ case 79:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -2205,14 +2280,26 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 78:
+ case 80:
+ routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ // does this value already exist somewhere?
+ as: resolvedAs,
+ pathname: route
+ }
+ );
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 79;
- _context.next = 82;
+ _context.prev = 82;
+ _context.next = 85;
return this.getRouteInfo(
route,
pathname,
@@ -2222,7 +2309,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 82:
+ case 85:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -2231,14 +2318,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 95;
+ _context.next = 98;
break;
}
@@ -2247,7 +2334,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2257,7 +2344,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages, false);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2273,35 +2360,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 93:
+ case 96:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 95:
+ case 98:
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
- _context.prev = 96;
- _context.next = 99;
+ _context.prev = 99;
+ _context.next = 102;
return this.fetchComponent("/404");
- case 99:
+ case 102:
notFoundRoute = "/404";
- _context.next = 105;
+ _context.next = 108;
break;
- case 102:
- _context.prev = 102;
- _context.t1 = _context["catch"](96);
+ case 105:
+ _context.prev = 105;
+ _context.t1 = _context["catch"](99);
notFoundRoute = "/_error";
- case 105:
- _context.next = 107;
+ case 108:
+ _context.next = 110;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -2309,14 +2396,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
as,
resolvedAs,
{
+ href: notFoundRoute,
+ pathname: notFoundRoute,
+ as: resolvedAs,
+ query: query,
shallow: false
}
);
- case 107:
+ case 110:
routeInfo = _context.sent;
- case 108:
+ case 111:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -2329,7 +2420,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
isValidShallowRoute =
options.shallow && this.route === route;
- _context.next = 114;
+ _context.next = 117;
return this.set(
route,
pathname,
@@ -2348,9 +2439,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 114:
+ case 117:
if (!error) {
- _context.next = 117;
+ _context.next = 120;
break;
}
@@ -2362,7 +2453,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 117:
+ case 120:
if (false) {
}
@@ -2373,21 +2464,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 122:
- _context.prev = 122;
- _context.t2 = _context["catch"](79);
+ case 125:
+ _context.prev = 125;
+ _context.t2 = _context["catch"](82);
if (!_context.t2.cancelled) {
- _context.next = 126;
+ _context.next = 129;
break;
}
return _context.abrupt("return", false);
- case 126:
+ case 129:
throw _context.t2;
- case 127:
+ case 130:
case "end":
return _context.stop();
}
@@ -2396,9 +2487,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [79, 122],
- [96, 102]
+ [37, 47],
+ [82, 125],
+ [99, 105]
]
);
})
@@ -3484,6 +3575,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/***/
},
+ /***/ lSNA: /***/ function(module, exports) {
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ module.exports = _defineProperty;
+
+ /***/
+ },
+
/***/ ls82: /***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 13.4s | 13s | -333ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | N/A | N/A |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| 677f882d2ed8..77e9.js gzip | N/A | 13.4 kB | N/A |
| Overall change | 59.4 kB | 59.8 kB | ⚠️ +308 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Serverless bundles Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _error.js | 1 MB | 1 MB | ✓ |
| 404.html | 2.67 kB | 2.67 kB | ✓ |
| hooks.html | 1.92 kB | 1.92 kB | ✓ |
| index.js | 1 MB | 1 MB | ✓ |
| link.js | 1.06 MB | 1.07 MB | ⚠️ +2.41 kB |
| routerDirect.js | 1.06 MB | 1.06 MB | ⚠️ +2.41 kB |
| withRouter.js | 1.06 MB | 1.06 MB | ⚠️ +2.41 kB |
| Overall change | 5.19 MB | 5.19 MB | ⚠️ +7.23 kB |
Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 13.8s | 13.7s | -80ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Page Load Tests Overall decrease ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.329 | 2.177 | -0.15 |
| / avg req/sec | 1073.5 | 1148.17 | +74.67 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.529 | 1.656 | ⚠️ +0.13 |
| /error-in-render avg req/sec | 1635.18 | 1509.57 | ⚠️ -125.61 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 597-6c246419..806f.js gzip | 13 kB | 13.3 kB | ⚠️ +301 B |
| framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
| main-HASH.js gzip | 6.57 kB | 6.57 kB | ✓ |
| webpack-HASH.js gzip | 954 B | 954 B | ✓ |
| Overall change | 59.8 kB | 60.1 kB | ⚠️ +301 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-6e0a903..b885.js gzip | 1.26 kB | 1.26 kB | ✓ |
| _error-7a100..a392.js gzip | 3.38 kB | 3.38 kB | ✓ |
| hooks-f7e199..11b9.js gzip | 904 B | 904 B | ✓ |
| index-3dc22c..ffbb.js gzip | 232 B | 232 B | ✓ |
| link-c010d28..b60a.js gzip | 1.63 kB | 1.63 kB | ✓ |
| routerDirect..323a.js gzip | 308 B | 308 B | ✓ |
| withRouter-a..2ef8.js gzip | 304 B | 304 B | ✓ |
| Overall change | 8.02 kB | 8.02 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 299 B | 299 B | ✓ |
| Overall change | 299 B | 299 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 584 B | 588 B | ⚠️ +4 B |
| link.html gzip | 592 B | 595 B | ⚠️ +3 B |
| withRouter.html gzip | 577 B | 581 B | ⚠️ +4 B |
| Overall change | 1.75 kB | 1.76 kB | ⚠️ +11 B |
Diffs
Diff for 677f882d2ed8..dc0f149c4.js
Diff too large to display
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "g2LeQMl9n_H_WN0ijY7R8",
+ "buildId": "OqPLbSBre8lb4f1ivxuSF",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/g2LeQMl9n_H_WN0ijY7R8/_buildManifest.js"
+ src="/_next/static/OqPLbSBre8lb4f1ivxuSF/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/g2LeQMl9n_H_WN0ijY7R8/_ssgManifest.js"
+ src="/_next/static/OqPLbSBre8lb4f1ivxuSF/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "g2LeQMl9n_H_WN0ijY7R8",
+ "buildId": "OqPLbSBre8lb4f1ivxuSF",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/g2LeQMl9n_H_WN0ijY7R8/_buildManifest.js"
+ src="/_next/static/OqPLbSBre8lb4f1ivxuSF/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/g2LeQMl9n_H_WN0ijY7R8/_ssgManifest.js"
+ src="/_next/static/OqPLbSBre8lb4f1ivxuSF/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "g2LeQMl9n_H_WN0ijY7R8",
+ "buildId": "OqPLbSBre8lb4f1ivxuSF",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/g2LeQMl9n_H_WN0ijY7R8/_buildManifest.js"
+ src="/_next/static/OqPLbSBre8lb4f1ivxuSF/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/g2LeQMl9n_H_WN0ijY7R8/_ssgManifest.js"
+ src="/_next/static/OqPLbSBre8lb4f1ivxuSF/_ssgManifest.js"
async=""
></script>
</body>
I’ve tried a few times to make tests pass but it seems like there are some tests (with the bundle size snapshots, specifically) that are failing on some platforms and not others, and also a couple test failures like timeouts that don’t seem related to the changes in this PR. Could anyone provide any guidance on getting this the rest of the way there?
Stats from current PR
Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 10.4s | 10.3s | -84ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Page Load Tests Overall increase ✓
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.185 | 2.141 | -0.04 |
| / avg req/sec | 1144.33 | 1167.72 | +23.39 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.697 | 1.523 | -0.17 |
| /error-in-render avg req/sec | 1473.59 | 1641.75 | +168.16 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | 13.4 kB | ⚠️ +308 B |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| Overall change | 59.5 kB | 59.8 kB | ⚠️ +308 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Rendered Page Sizes
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 615 B | 615 B | ✓ |
| link.html gzip | 621 B | 621 B | ✓ |
| withRouter.html gzip | 609 B | 609 B | ✓ |
| Overall change | 1.84 kB | 1.84 kB | ✓ |
Diffs
Diff for 677f882d2ed8..abf803634.js
@@ -1173,6 +1173,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _regeneratorRuntime = __webpack_require__("o0o1");
+ var _defineProperty = __webpack_require__("lSNA");
+
var _asyncToGenerator = __webpack_require__("yXPU");
var _classCallCheck = __webpack_require__("lwsE");
@@ -1181,6 +1183,44 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _slicedToArray = __webpack_require__("J4zp");
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly)
+ symbols = symbols.filter(function(sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+
+ function _objectSpread(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function(key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(
+ target,
+ Object.getOwnPropertyDescriptors(source)
+ );
+ } else {
+ ownKeys(Object(source)).forEach(function(key) {
+ Object.defineProperty(
+ target,
+ key,
+ Object.getOwnPropertyDescriptor(source, key)
+ );
+ });
+ }
+ }
+ return target;
+ }
+
exports.__esModule = true;
exports.getDomainLocale = getDomainLocale;
exports.addLocale = addLocale;
@@ -1583,6 +1623,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isSsr = void 0;
this.isFallback = void 0;
this._inFlightRoute = void 0;
+ this._inFlightHref = void 0;
+ this._inFlightPathname = void 0;
this._shallow = void 0;
this.locale = void 0;
this.locales = void 0;
@@ -1820,6 +1862,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var _this2 = this;
var _options$scroll,
+ _options$shallow,
localeChange,
parsedAs,
localePathResult,
@@ -1827,14 +1870,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_this$locales,
detectedDomain,
asNoBasePath,
- _options$shallow,
- shallow,
- routeProps,
- cleanedAs,
parsed,
_parsed,
pathname,
query,
+ baseRouteProps,
+ href,
+ cleanedAs,
+ _routeProps,
pages,
rewrites,
_yield,
@@ -1848,6 +1891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shouldInterpolate,
interpolatedAs,
missingParams,
+ routeProps,
routeInfo,
_routeInfo,
error,
@@ -1963,19 +2007,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
performance.mark("routeChange");
}
- (_options$shallow = options.shallow),
- (shallow =
- _options$shallow === void 0
- ? false
- : _options$shallow);
- routeProps = {
- shallow: shallow
+ parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+ url
+ );
+ (_parsed = parsed),
+ (pathname = _parsed.pathname),
+ (query = _parsed.query); // This is what we know so far
+ // We will need to fill in href, as, pathname before we pass routeProps beyond this function
+
+ baseRouteProps = {
+ query: query,
+ shallow:
+ (_options$shallow = options.shallow) != null
+ ? _options$shallow
+ : false
};
if (this._inFlightRoute) {
+ href = this._inFlightHref;
this.abortComponentLoad(
this._inFlightRoute,
- routeProps
+ _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(href)
+ ? delBasePath(href)
+ : href
+ ),
+ as: delLocale(
+ hasBasePath(this._inFlightRoute)
+ ? delBasePath(this._inFlightRoute)
+ : this._inFlightRoute
+ ),
+ pathname: this._inFlightPathname
+ }
+ )
);
}
@@ -1990,7 +2058,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ this._inFlightHref = url; // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -1999,15 +2068,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 34;
+ _context.next = 37;
break;
}
this.asPath = cleanedAs;
+ _routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ as: delLocale(
+ hasBasePath(as) ? delBasePath(as) : url
+ ),
+ pathname: this.pathname // old pathname still applies if we're only changing hash
+ }
+ );
Router.events.emit(
"hashChangeStart",
as,
- routeProps
+ _routeProps
); // TODO: do we need the resolved href when only a hash change?
this.changeState(method, url, as, options);
@@ -2016,44 +2098,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit(
"hashChangeComplete",
as,
- routeProps
+ _routeProps
);
return _context.abrupt("return", true);
- case 34:
- parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
- url
- );
- (_parsed = parsed),
- (pathname = _parsed.pathname),
- (query = _parsed.query); // The build manifest needs to be loaded before auto-static dynamic pages
- // get their query parameters to allow ensuring they can be parsed properly
- // when rewritten to
-
- _context.prev = 36;
- _context.next = 39;
+ case 37:
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
parsed = this._resolveHref(parsed, pages);
if (parsed.pathname !== pathname) {
@@ -2089,13 +2162,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
+ this._inFlightPathname = route;
+
if (isLocalURL(as)) {
- _context.next = 62;
+ _context.next = 64;
break;
}
if (true) {
- _context.next = 60;
+ _context.next = 62;
break;
}
@@ -2109,18 +2184,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://err.sh/next.js/invalid-relative-url-external-as"
);
- case 60:
+ case 62:
window.location.href = as;
return _context.abrupt("return", false);
- case 62:
+ case 64:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 78;
+ _context.next = 80;
break;
}
@@ -2143,7 +2218,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 77;
+ _context.next = 79;
break;
}
@@ -2154,7 +2229,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 75;
+ _context.next = 77;
break;
}
@@ -2185,11 +2260,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 75:
- _context.next = 78;
+ case 77:
+ _context.next = 80;
break;
- case 77:
+ case 79:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -2205,14 +2280,26 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 78:
+ case 80:
+ routeProps = _objectSpread(
+ _objectSpread({}, baseRouteProps),
+ {},
+ {
+ href: delLocale(
+ hasBasePath(url) ? delBasePath(url) : url
+ ),
+ // does this value already exist somewhere?
+ as: resolvedAs,
+ pathname: route
+ }
+ );
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 79;
- _context.next = 82;
+ _context.prev = 82;
+ _context.next = 85;
return this.getRouteInfo(
route,
pathname,
@@ -2222,7 +2309,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 82:
+ case 85:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -2231,14 +2318,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 95;
+ _context.next = 98;
break;
}
@@ -2247,7 +2334,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2257,7 +2344,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages, false);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 93;
+ _context.next = 96;
break;
}
@@ -2273,35 +2360,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 93:
+ case 96:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 95:
+ case 98:
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 108;
+ _context.next = 111;
break;
}
- _context.prev = 96;
- _context.next = 99;
+ _context.prev = 99;
+ _context.next = 102;
return this.fetchComponent("/404");
- case 99:
+ case 102:
notFoundRoute = "/404";
- _context.next = 105;
+ _context.next = 108;
break;
- case 102:
- _context.prev = 102;
- _context.t1 = _context["catch"](96);
+ case 105:
+ _context.prev = 105;
+ _context.t1 = _context["catch"](99);
notFoundRoute = "/_error";
- case 105:
- _context.next = 107;
+ case 108:
+ _context.next = 110;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -2309,14 +2396,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
as,
resolvedAs,
{
+ href: notFoundRoute,
+ pathname: notFoundRoute,
+ as: resolvedAs,
+ query: query,
shallow: false
}
);
- case 107:
+ case 110:
routeInfo = _context.sent;
- case 108:
+ case 111:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -2329,7 +2420,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
isValidShallowRoute =
options.shallow && this.route === route;
- _context.next = 114;
+ _context.next = 117;
return this.set(
route,
pathname,
@@ -2348,9 +2439,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 114:
+ case 117:
if (!error) {
- _context.next = 117;
+ _context.next = 120;
break;
}
@@ -2362,7 +2453,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 117:
+ case 120:
if (false) {
}
@@ -2373,21 +2464,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 122:
- _context.prev = 122;
- _context.t2 = _context["catch"](79);
+ case 125:
+ _context.prev = 125;
+ _context.t2 = _context["catch"](82);
if (!_context.t2.cancelled) {
- _context.next = 126;
+ _context.next = 129;
break;
}
return _context.abrupt("return", false);
- case 126:
+ case 129:
throw _context.t2;
- case 127:
+ case 130:
case "end":
return _context.stop();
}
@@ -2396,9 +2487,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [79, 122],
- [96, 102]
+ [37, 47],
+ [82, 125],
+ [99, 105]
]
);
})
@@ -3484,6 +3575,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/***/
},
+ /***/ lSNA: /***/ function(module, exports) {
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ module.exports = _defineProperty;
+
+ /***/
+ },
+
/***/ ls82: /***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4c703037e67abf803634.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3ff85f23f37d61523a3d.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 12.1s | 11.6s | -468ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 677f882d2ed8..49c4.js gzip | 13.1 kB | N/A | N/A |
| framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
| main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
| webpack-HASH.js gzip | 751 B | 751 B | ✓ |
| 677f882d2ed8..77e9.js gzip | N/A | 13.4 kB | N/A |
| Overall change | 59.5 kB | 59.8 kB | ⚠️ +308 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
| _error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
| hooks-c71ae4..70cd.js gzip | 887 B | 887 B | ✓ |
| index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
| link-7faf09b..eba4.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
| withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
| Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 321 B | 321 B | ✓ |
| Overall change | 321 B | 321 B | ✓ |
Serverless bundles Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _error.js | 1 MB | 1 MB | ✓ |
| 404.html | 2.67 kB | 2.67 kB | ✓ |
| hooks.html | 1.92 kB | 1.92 kB | ✓ |
| index.js | 1 MB | 1 MB | ✓ |
| link.js | 1.06 MB | 1.07 MB | ⚠️ +2.41 kB |
| routerDirect.js | 1.06 MB | 1.06 MB | ⚠️ +2.41 kB |
| withRouter.js | 1.06 MB | 1.06 MB | ⚠️ +2.41 kB |
| Overall change | 5.19 MB | 5.19 MB | ⚠️ +7.23 kB |
Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| buildDuration | 13.3s | 12.5s | -797ms |
| nodeModulesSize | 75 MB | 75 MB | ⚠️ +3.57 kB |
Page Load Tests Overall decrease ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.195 | 2.102 | -0.09 |
| / avg req/sec | 1139.05 | 1189.11 | +50.06 |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.436 | 1.482 | ⚠️ +0.05 |
| /error-in-render avg req/sec | 1741.18 | 1687.04 | ⚠️ -54.14 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| 597-6c246419..806f.js gzip | 13 kB | 13.3 kB | ⚠️ +301 B |
| framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
| main-HASH.js gzip | 6.58 kB | 6.58 kB | ✓ |
| webpack-HASH.js gzip | 954 B | 954 B | ✓ |
| Overall change | 59.9 kB | 60.2 kB | ⚠️ +301 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _app-6e0a903..b885.js gzip | 1.26 kB | 1.26 kB | ✓ |
| _error-7a100..a392.js gzip | 3.38 kB | 3.38 kB | ✓ |
| hooks-f7e199..11b9.js gzip | 904 B | 904 B | ✓ |
| index-3dc22c..ffbb.js gzip | 232 B | 232 B | ✓ |
| link-c010d28..b60a.js gzip | 1.63 kB | 1.63 kB | ✓ |
| routerDirect..323a.js gzip | 308 B | 308 B | ✓ |
| withRouter-a..2ef8.js gzip | 304 B | 304 B | ✓ |
| Overall change | 8.02 kB | 8.02 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 299 B | 299 B | ✓ |
| Overall change | 299 B | 299 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
| vercel/next.js canary | controversial/next.js enhanced-router-events-data | Change | |
|---|---|---|---|
| index.html gzip | 586 B | 587 B | ⚠️ +1 B |
| link.html gzip | 591 B | 594 B | ⚠️ +3 B |
| withRouter.html gzip | 579 B | 581 B | ⚠️ +2 B |
| Overall change | 1.76 kB | 1.76 kB | ⚠️ +6 B |
Diffs
Diff for 677f882d2ed8..dc0f149c4.js
Diff too large to display
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "UY_BYl0T2soMtFHATIrFg",
+ "buildId": "YeBGovT_82O7v8sEeJruF",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/UY_BYl0T2soMtFHATIrFg/_buildManifest.js"
+ src="/_next/static/YeBGovT_82O7v8sEeJruF/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/UY_BYl0T2soMtFHATIrFg/_ssgManifest.js"
+ src="/_next/static/YeBGovT_82O7v8sEeJruF/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "UY_BYl0T2soMtFHATIrFg",
+ "buildId": "YeBGovT_82O7v8sEeJruF",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/UY_BYl0T2soMtFHATIrFg/_buildManifest.js"
+ src="/_next/static/YeBGovT_82O7v8sEeJruF/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/UY_BYl0T2soMtFHATIrFg/_ssgManifest.js"
+ src="/_next/static/YeBGovT_82O7v8sEeJruF/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "UY_BYl0T2soMtFHATIrFg",
+ "buildId": "YeBGovT_82O7v8sEeJruF",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4256237aee7dc0f149c4.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6230fd9caf001c2677e9.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/UY_BYl0T2soMtFHATIrFg/_buildManifest.js"
+ src="/_next/static/YeBGovT_82O7v8sEeJruF/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/UY_BYl0T2soMtFHATIrFg/_ssgManifest.js"
+ src="/_next/static/YeBGovT_82O7v8sEeJruF/_ssgManifest.js"
async=""
></script>
</body>
We need this feature. There is no way to know what is the current path name.
We need this feature.
demo:
import Router from 'next/router'
Router.events.on('beforeHistoryChange', (url, { pathname, shallow, route }) => {
const _router = Router.router
const renderComponent = _router.components[route]
const pageProps = renderComponent?.props?.pageProps
// ... Do something with pageProps
})
@controversial the PR out of date and conflicts. I look forward to this feature coming. Right now, I don't know how to get the destination pathname?
Hey! Thanks for this PR. With the stable release of App Router the router.events no longer exists. Instead you can use useEffect to observe values that are changing:
'use client';
import { usePathname, useSearchParams } from 'next/navigation';
function NavigationEventsImplementation() {
const pathname = usePathname();
const searchParams = useSearchParams();
useEffect(() => {
const url = pathname + searchParams.toString();
// You can now use the current URL
}, [pathname, searchParams]);
}
export function NavigationEvents() {
return (
<Suspense fallback={null}>
<NavigationEventsImplementation />
</Suspense>
);
}
https://nextjs.org/docs/app/api-reference/functions/use-router#router-events (code snippet above will be added to the docs there, PR is open).
Hey! Thanks for this PR. With the stable release of App Router the router.events no longer exists. Instead you can use useEffect to observe values that are changing:
'use client';
import { usePathname, useSearchParams } from 'next/navigation';
function NavigationEventsImplementation() {
const pathname = usePathname();
const searchParams = useSearchParams();
useEffect(() => {
const url = pathname + searchParams.toString();
// You can now use the current URL
}, [pathname, searchParams]);
}
export function NavigationEvents() {
return (
<Suspense fallback={null}>
<NavigationEventsImplementation />
</Suspense>
);
}
https://nextjs.org/docs/app/api-reference/functions/use-router#router-events (code snippet above will be added to the docs there, PR is open).