-
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
Add some missing fields to the NextConfig type #27126
Conversation
@@ -1527,7 +1525,7 @@ export default async function build( | |||
|
|||
const images = { ...config.images } | |||
const { deviceSizes, imageSizes } = images | |||
images.sizes = [...deviceSizes, ...imageSizes] | |||
;(images as any).sizes = [...deviceSizes, ...imageSizes] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be images!.sizes
? I think we should avoid any
if we can?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sizes
isn't a config value, we're changing the shape to the manifest images
type instead here it looks like, we could create a completely separate object below instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, this was because we had a early canary that was using sizes
and then split it to imageSizes
and deviceSizes
. But since the backend already used sizes
this was kept for backwards compat 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thanks! 🥇
This comment has been minimized.
This comment has been minimized.
Stats from current PRDefault Build (Increase detected
|
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
buildDuration | 12.5s | 12.5s | |
buildDurationCached | 2.9s | 2.9s | -12ms |
nodeModulesSize | 49.3 MB | 49.3 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.016 | 2.007 | -0.01 |
/ avg req/sec | 1239.78 | 1245.74 | +5.96 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.095 | 1.078 | -0.02 |
/error-in-render avg req/sec | 2282.12 | 2319.32 | +37.2 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
359.HASH.js gzip | 3.09 kB | 3.09 kB | ✓ |
framework-HASH.js gzip | 42 kB | 42 kB | ✓ |
main-HASH.js gzip | 20.9 kB | 20.9 kB | ✓ |
webpack-HASH.js gzip | 1.49 kB | 1.49 kB | ✓ |
Overall change | 67.6 kB | 67.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | ijjk/next.js update/config-types | 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 | ijjk/next.js update/config-types | Change | |
---|---|---|---|
_app-HASH.js gzip | 803 B | 803 B | ✓ |
_error-HASH.js gzip | 3.18 kB | 3.18 kB | ✓ |
amp-HASH.js gzip | 526 B | 526 B | ✓ |
css-HASH.js gzip | 329 B | 329 B | ✓ |
hooks-HASH.js gzip | 903 B | 903 B | ✓ |
image-HASH.js gzip | 5.69 kB | 5.69 kB | ✓ |
index-HASH.js gzip | 261 B | 261 B | ✓ |
link-HASH.js gzip | 1.66 kB | 1.66 kB | ✓ |
routerDirect..HASH.js gzip | 319 B | 319 B | ✓ |
withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 14.1 kB | 14.1 kB | ✓ |
Client Build Manifests
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
_buildManifest.js gzip | 419 B | 419 B | ✓ |
Overall change | 419 B | 419 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
index.html gzip | 531 B | 531 B | ✓ |
link.html gzip | 544 B | 544 B | ✓ |
withRouter.html gzip | 524 B | 524 B | ✓ |
Overall change | 1.6 kB | 1.6 kB | ✓ |
Webpack 4 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
buildDuration | 10s | 9.9s | -73ms |
buildDurationCached | 4.1s | 3.9s | -190ms |
nodeModulesSize | 49.3 MB | 49.3 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.056 | 2.024 | -0.03 |
/ avg req/sec | 1216.2 | 1234.88 | +18.68 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.134 | 1.098 | -0.04 |
/error-in-render avg req/sec | 2204.62 | 2277.24 | +72.62 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
14.HASH.js gzip | 3.11 kB | 3.11 kB | ✓ |
677f882d2ed8..HASH.js gzip | 13.9 kB | 13.9 kB | ✓ |
framework.HASH.js gzip | 41.8 kB | 41.8 kB | ✓ |
main-HASH.js gzip | 8.17 kB | 8.17 kB | ✓ |
webpack-HASH.js gzip | 1.19 kB | 1.19 kB | ✓ |
Overall change | 68.1 kB | 68.1 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | ijjk/next.js update/config-types | 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 | ijjk/next.js update/config-types | Change | |
---|---|---|---|
_app-HASH.js gzip | 791 B | 791 B | ✓ |
_error-HASH.js gzip | 3.83 kB | 3.83 kB | ✓ |
amp-HASH.js gzip | 531 B | 531 B | ✓ |
css-HASH.js gzip | 333 B | 333 B | ✓ |
hooks-HASH.js gzip | 910 B | 910 B | ✓ |
index-HASH.js gzip | 230 B | 230 B | ✓ |
link-HASH.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..HASH.js gzip | 297 B | 297 B | ✓ |
withRouter-HASH.js gzip | 293 B | 293 B | ✓ |
e025d2764813..52f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.98 kB | 8.98 kB | ✓ |
Client Build Manifests
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
_buildManifest.js gzip | 418 B | 418 B | ✓ |
Overall change | 418 B | 418 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | ijjk/next.js update/config-types | Change | |
---|---|---|---|
index.html gzip | 575 B | 575 B | ✓ |
link.html gzip | 586 B | 586 B | ✓ |
withRouter.html gzip | 568 B | 568 B | ✓ |
Overall change | 1.73 kB | 1.73 kB | ✓ |
This adds some missing fields to the `NextConfig` type we expose under `next` and also adds a `NextConfigComplete` internal type that allows us to not treat all fields as optional like you would when using the type in `next.config.js`. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes
This is similar to #27126 , #27446 and #27974 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes
This adds some missing fields to the
NextConfig
type we expose undernext
and also adds aNextConfigComplete
internal type that allows us to not treat all fields as optional like you would when using the type innext.config.js
.Bug
fixes #number
contributing.md
Feature
fixes #number
contributing.md
Documentation / Examples