-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load next.config.mjs as ESM #22153
Load next.config.mjs as ESM #22153
Conversation
Failing test suitesCommit: f487c3d test/integration/app-document-style-fragment/test/index.test.js Expand output● Test suite failed to run
|
Failing test suitesCommit: f487c3d test/integration/amphtml-fragment-style/test/index.test.js Expand output● Test suite failed to run
test/integration/app-document-import-order/test/index.test.js Expand output● Test suite failed to run
test/integration/disable-js-preload/test/index.test.js Expand output● Test suite failed to run
test/integration/future/test/index.test.js Expand output● Test suite failed to run
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Failing test suitesCommit: 9054885 test/integration/cli/test/index.test.js
Expand output● CLI Usage › dev › should exit when SIGTERM is signalled
test/integration/required-server-files/test/index.test.js
Expand output● Required Server Files › should output required-server-files manifest correctly
● Required Server Files › should render SSR page correctly
● Required Server Files › should render dynamic SSR page correctly
● Required Server Files › should render fallback page correctly
● Required Server Files › should render SSR page correctly with x-matched-path
● Required Server Files › should render dynamic SSR page correctly with x-matched-path
● Required Server Files › should render fallback page correctly with x-matched-path and routes-matches
● Required Server Files › should return data correctly with x-matched-path
● Required Server Files › should render fallback optional catch-all route correctly with x-matched-path and routes-matches
● Required Server Files › should return data correctly with x-matched-path for optional catch-all route
● Required Server Files › should not apply trailingSlash redirect
● Required Server Files › should normalize catch-all rewrite query values correctly
● Required Server Files › should bubble error correctly for gip page
● Required Server Files › should bubble error correctly for gssp page
● Required Server Files › should bubble error correctly for gsp page
|
This comment has been minimized.
This comment has been minimized.
Failing test suitesCommit: f66ec7a test/integration/required-server-files/test/index.test.js
Expand output● Required Server Files › should output required-server-files manifest correctly
● Required Server Files › should render SSR page correctly
● Required Server Files › should render dynamic SSR page correctly
● Required Server Files › should render fallback page correctly
● Required Server Files › should render SSR page correctly with x-matched-path
● Required Server Files › should render dynamic SSR page correctly with x-matched-path
● Required Server Files › should render fallback page correctly with x-matched-path and routes-matches
● Required Server Files › should return data correctly with x-matched-path
● Required Server Files › should render fallback optional catch-all route correctly with x-matched-path and routes-matches
● Required Server Files › should return data correctly with x-matched-path for optional catch-all route
● Required Server Files › should not apply trailingSlash redirect
● Required Server Files › should normalize catch-all rewrite query values correctly
● Required Server Files › should bubble error correctly for gip page
● Required Server Files › should bubble error correctly for gssp page
● Required Server Files › should bubble error correctly for gsp page
test/integration/cli/test/index.test.js
Expand output● CLI Usage › dev › should exit when SIGINT is signalled
● CLI Usage › dev › should exit when SIGTERM is signalled
|
Failing test suitesCommit: 8b63836 test/integration/production-start-no-build/test/index.test.js
Expand output● Production Usage without production build › should show error when there is no production build
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Failing test suitesCommit: 6d42d50 test/integration/cli/test/index.test.js
Expand output● CLI Usage › dev › should exit when SIGTERM is signalled
|
Failing test suitesCommit: 70ca3c5 test/isolated/config.unit.test.js
Expand output● config › Should get the configuration
● config › Should pass the phase correctly
● config › Should pass the defaultConfig correctly
● config › Should assign object defaults deeply to user config
● config › Should pass the customConfig correctly
● config › Should not pass the customConfig when it is null
● config › Should assign object defaults deeply to customConfig
● config › Should allow setting objects which do not have defaults
● config › Should override defaults for arrays from user arrays
● config › Should throw when an invalid target is provided
● config › Should pass when a valid target is provided
● config › Should throw an error when next.config.js is not present
● config › Should not throw an error when two versions of next.config.js are present
● config › Should ignore configs set to
● config › Should ignore configs set to
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Failing test suitesCommit: 2be9940 test/integration/cli/test/index.test.js
Expand output● CLI Usage › dev › should exit when SIGINT is signalled
● CLI Usage › dev › should exit when SIGTERM is signalled
|
@Janpot Rather than determining ESM support by checking the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
One more thought— Reason |
@natemoo-re I didn't really consider |
That makes sense! That can be tackled later. This is a great step in the right direction. |
This PR will likely conflict with #22323. Potentially we'll have to enable webpack 5 by default for projects using the ESM config file. Given that we're planning to have everyone adopt webpack 5 eventually (without breaking existing apps) this would be reasonable given that currently you can only use commonjs |
@timneutkens Yep, that PR is on my radar, I already reviewed it a few days ago and at first sight I didn't see anything that will be difficult to merge in this PR, it didn't seem to introduce extra sync config loading. I'll put it as a To Do (unless the team wants to do this the other way around ofcourse). Makes sense to mandate webpack 5 here. |
The main problem is that you can't delete the require cache to re-execute the import for ESM in this case. |
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
buildDuration | 11.2s | 10.8s | -437ms |
nodeModulesSize | 42.7 MB | 42.7 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.205 | 2.054 | -0.15 |
/ avg req/sec | 1133.87 | 1216.94 | +83.07 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.539 | 1.381 | -0.16 |
/error-in-render avg req/sec | 1624.93 | 1810.27 | +185.34 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | 13.4 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 59.7 kB | 59.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | Janpot/next.js async-config-loading | 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 | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
index.html gzip | 613 B | 613 B | ✓ |
link.html gzip | 620 B | 620 B | ✓ |
withRouter.html gzip | 608 B | 608 B | ✓ |
Overall change | 1.84 kB | 1.84 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
buildDuration | 12.9s | 12.8s | -77ms |
nodeModulesSize | 42.7 MB | 42.7 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | 13.4 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 59.7 kB | 59.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | Janpot/next.js async-config-loading | 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 | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Serverless bundles
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_error.js | 1.01 MB | 1.01 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
500.html | 2.65 kB | 2.65 kB | ✓ |
amp.amp.html | 10.4 kB | 10.4 kB | ✓ |
amp.html | 1.86 kB | 1.86 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1.01 MB | 1.01 MB | ✓ |
link.js | 1.06 MB | 1.06 MB | ✓ |
routerDirect.js | 1.06 MB | 1.06 MB | ✓ |
withRouter.js | 1.06 MB | 1.06 MB | ✓ |
Overall change | 5.21 MB | 5.21 MB | ✓ |
Webpack 5 Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
buildDuration | 13.2s | 13.4s | |
nodeModulesSize | 42.7 MB | 42.7 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.982 | 2.095 | |
/ avg req/sec | 1261.43 | 1193.35 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.417 | 1.494 | |
/error-in-render avg req/sec | 1764.89 | 1673.17 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
597-74632e79..1d47.js gzip | 13.3 kB | 13.3 kB | ✓ |
framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
main-HASH.js gzip | 6.59 kB | 6.59 kB | ✓ |
webpack-HASH.js gzip | 954 B | 954 B | ✓ |
Overall change | 60.1 kB | 60.1 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | Janpot/next.js async-config-loading | 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 | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_app-aedc815..1421.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error-71ec2..1a96.js gzip | 3.38 kB | 3.38 kB | ✓ |
amp-33a09cb0..6745.js gzip | 536 B | 536 B | ✓ |
hooks-4e968a..f870.js gzip | 902 B | 902 B | ✓ |
index-5c6845..f75c.js gzip | 230 B | 230 B | ✓ |
link-99f0c6c..b84a.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..bb56.js gzip | 306 B | 306 B | ✓ |
withRouter-7..2133.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.57 kB | 8.57 kB | ✓ |
Client Build Manifests
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_buildManifest.js gzip | 326 B | 326 B | ✓ |
Overall change | 326 B | 326 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
index.html gzip | 586 B | 586 B | ✓ |
link.html gzip | 593 B | 593 B | ✓ |
withRouter.html gzip | 581 B | 581 B | ✓ |
Overall change | 1.76 kB | 1.76 kB | ✓ |
Diffs
Diff for index.html
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "4kpBMiH54B-Aev2GIJHp-",
+ "buildId": "UCPF48yR0d5woA4VFaNyG",
"isFallback": false,
"gip": true
}
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/4kpBMiH54B-Aev2GIJHp-/_buildManifest.js"
+ src="/_next/static/UCPF48yR0d5woA4VFaNyG/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/4kpBMiH54B-Aev2GIJHp-/_ssgManifest.js"
+ src="/_next/static/UCPF48yR0d5woA4VFaNyG/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "4kpBMiH54B-Aev2GIJHp-",
+ "buildId": "UCPF48yR0d5woA4VFaNyG",
"isFallback": false,
"gip": true
}
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/4kpBMiH54B-Aev2GIJHp-/_buildManifest.js"
+ src="/_next/static/UCPF48yR0d5woA4VFaNyG/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/4kpBMiH54B-Aev2GIJHp-/_ssgManifest.js"
+ src="/_next/static/UCPF48yR0d5woA4VFaNyG/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "4kpBMiH54B-Aev2GIJHp-",
+ "buildId": "UCPF48yR0d5woA4VFaNyG",
"isFallback": false,
"gip": true
}
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/4kpBMiH54B-Aev2GIJHp-/_buildManifest.js"
+ src="/_next/static/UCPF48yR0d5woA4VFaNyG/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/4kpBMiH54B-Aev2GIJHp-/_ssgManifest.js"
+ src="/_next/static/UCPF48yR0d5woA4VFaNyG/_ssgManifest.js"
async=""
></script>
</body>
I think a similar Or rather, that helpers should probably move to Also https://github.com/vercel/next.js/blob/canary/packages/next/telemetry/events/version.ts#L65-L78 which is a bit trickier, since that is currently all synchronous... Very excited to see more ESM support |
This logic is now totally unblocked right? Because webpack 5 is enabled by default? |
Converted back to draft as all I did was merge canary to see the tests run, none of the open todos were solved |
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
buildDuration | 14.2s | 14.4s | |
buildDurationCached | 3.4s | 3.3s | -121ms |
nodeModulesSize | 49.2 MB | 49.2 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.626 | 2.676 | |
/ avg req/sec | 952.12 | 934.23 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.629 | 1.615 | -0.01 |
/error-in-render avg req/sec | 1534.57 | 1548.06 | +13.49 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
framework-HASH.js gzip | 42 kB | 42 kB | ✓ |
main-HASH.js gzip | 20.2 kB | 20.2 kB | ✓ |
webpack-HASH.js gzip | 804 B | 804 B | ✓ |
Overall change | 63 kB | 63 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | Janpot/next.js async-config-loading | 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 | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_app-HASH.js gzip | 801 B | 801 B | ✓ |
_error-HASH.js gzip | 3.17 kB | 3.17 kB | ✓ |
amp-HASH.js gzip | 527 B | 527 B | ✓ |
css-HASH.js gzip | 330 B | 330 B | ✓ |
hooks-HASH.js gzip | 903 B | 903 B | ✓ |
index-HASH.js gzip | 263 B | 263 B | ✓ |
link-HASH.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..HASH.js gzip | 322 B | 322 B | ✓ |
withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.41 kB | 8.41 kB | ✓ |
Client Build Manifests
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_buildManifest.js gzip | 392 B | 392 B | ✓ |
Overall change | 392 B | 392 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
index.html gzip | 522 B | 522 B | ✓ |
link.html gzip | 535 B | 535 B | ✓ |
withRouter.html gzip | 516 B | 516 B | ✓ |
Overall change | 1.57 kB | 1.57 kB | ✓ |
Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
buildDuration | 16.3s | 15.8s | -446ms |
buildDurationCached | 4.5s | 4.6s | |
nodeModulesSize | 49.2 MB | 49.2 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
framework-HASH.js gzip | 42 kB | 42 kB | ✓ |
main-HASH.js gzip | 20.2 kB | 20.2 kB | ✓ |
webpack-HASH.js gzip | 804 B | 804 B | ✓ |
Overall change | 63 kB | 63 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | Janpot/next.js async-config-loading | 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 | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_app-HASH.js gzip | 801 B | 801 B | ✓ |
_error-HASH.js gzip | 3.17 kB | 3.17 kB | ✓ |
amp-HASH.js gzip | 527 B | 527 B | ✓ |
css-HASH.js gzip | 330 B | 330 B | ✓ |
hooks-HASH.js gzip | 903 B | 903 B | ✓ |
index-HASH.js gzip | 263 B | 263 B | ✓ |
link-HASH.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..HASH.js gzip | 322 B | 322 B | ✓ |
withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.41 kB | 8.41 kB | ✓ |
Client Build Manifests
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_buildManifest.js gzip | 392 B | 392 B | ✓ |
Overall change | 392 B | 392 B | ✓ |
Serverless bundles Overall decrease ✓
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_error.js | 16.9 kB | 16.9 kB | |
404.html | 1.98 kB | 1.98 kB | ✓ |
500.html | 1.96 kB | 1.96 kB | ✓ |
amp.amp.html | 10.8 kB | 10.8 kB | ✓ |
amp.html | 1.17 kB | 1.17 kB | ✓ |
css.html | 1.35 kB | 1.35 kB | ✓ |
hooks.html | 1.23 kB | 1.23 kB | ✓ |
index.js | 17.2 kB | 17.2 kB | ✓ |
link.js | 17.5 kB | 17.5 kB | -2 B |
routerDirect.js | 17.3 kB | 17.3 kB | ✓ |
withRouter.js | 17.3 kB | 17.3 kB | -4 B |
Overall change | 105 kB | 105 kB | -4 B |
Webpack 4 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
buildDuration | 12.4s | 12.5s | |
buildDurationCached | 5s | 5s | -5ms |
nodeModulesSize | 49.2 MB | 49.2 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.599 | 2.615 | |
/ avg req/sec | 961.75 | 956.02 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.68 | 1.664 | -0.02 |
/error-in-render avg req/sec | 1487.98 | 1502.49 | +14.51 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
677f882d2ed8..HASH.js gzip | 13.3 kB | 13.3 kB | ✓ |
framework.HASH.js gzip | 41.8 kB | 41.8 kB | ✓ |
main-HASH.js gzip | 7.99 kB | 7.99 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 63.8 kB | 63.8 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | Janpot/next.js async-config-loading | 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 | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_app-HASH.js gzip | 1.07 kB | 1.07 kB | ✓ |
_error-HASH.js gzip | 3.84 kB | 3.84 kB | ✓ |
amp-HASH.js gzip | 536 B | 536 B | ✓ |
css-HASH.js gzip | 333 B | 333 B | ✓ |
hooks-HASH.js gzip | 910 B | 910 B | ✓ |
index-HASH.js gzip | 227 B | 227 B | ✓ |
link-HASH.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..HASH.js gzip | 295 B | 295 B | ✓ |
withRouter-HASH.js gzip | 292 B | 292 B | ✓ |
e025d2764813..52f.css gzip | 125 B | 125 B | ✓ |
Overall change | 9.28 kB | 9.28 kB | ✓ |
Client Build Manifests
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
_buildManifest.js gzip | 420 B | 420 B | ✓ |
Overall change | 420 B | 420 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | Janpot/next.js async-config-loading | Change | |
---|---|---|---|
index.html gzip | 566 B | 566 B | ✓ |
link.html gzip | 579 B | 579 B | ✓ |
withRouter.html gzip | 558 B | 558 B | ✓ |
Overall change | 1.7 kB | 1.7 kB | ✓ |
An Implementation of #22381
The async config loading (for now) is implemented as a wrapper around Server/DevServer. This is done for two reasons. First, it is as non-invasive to existing code as possible, so it's easier to keep the PR up to date while the code base evolves. Secondly, it makes sure all properties of
Server
can be initialized in the constructor, making the implementation easier to handle and typecheck than if all properties had to be asynchronously initialized. In my opinion, this is an elegant solution to solve the problem of loading config asynchronously, but it can be done differently, and certainly can be iterated on to make it a bit more DRY.To Do:
webpack