-
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 Contentful image loader #19117
Add Contentful image loader #19117
Conversation
Needs |
Thanks @schoenwaldnils @AlexandraKlein . :) Let's see. looks like |
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
buildDuration | 13.9s | 14.2s | |
nodeModulesSize | 84.9 MB | 84.9 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.509 | 2.55 | |
/ avg req/sec | 996.45 | 980.52 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.316 | 1.361 | |
/error-in-render avg req/sec | 1899.35 | 1836.97 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..d9fb.js gzip | 12.7 kB | 12.7 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-b0b971f..64a5.js gzip | 6.5 kB | 6.5 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.9 kB | 58.9 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 8.23 kB | 8.23 kB | ✓ |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-22cb0cf..dule.js gzip | 5.61 kB | 5.61 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 53.6 kB | 53.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-3b0cf13..85f8.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-6f635..c393.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-d4ffc3..9e0f.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-d9a15a0..130a.js gzip | 1.57 kB | 1.57 kB | ✓ |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.98 kB | 7.98 kB | ✓ |
Client Pages Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-f2fcc..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-973cce3..dule.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.6 kB | 5.6 kB | ✓ |
Client Build Manifests
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_buildManifest.js gzip | 321 B | 321 B | ✓ |
_buildManife..dule.js gzip | 330 B | 330 B | ✓ |
Overall change | 651 B | 651 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
index.html gzip | 971 B | 971 B | ✓ |
link.html gzip | 978 B | 978 B | ✓ |
withRouter.html gzip | 965 B | 965 B | ✓ |
Overall change | 2.91 kB | 2.91 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
buildDuration | 15.7s | 15.1s | -583ms |
nodeModulesSize | 84.9 MB | 84.9 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..d9fb.js gzip | 12.7 kB | 12.7 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-b0b971f..64a5.js gzip | 6.5 kB | 6.5 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.9 kB | 58.9 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 8.23 kB | 8.23 kB | ✓ |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-22cb0cf..dule.js gzip | 5.61 kB | 5.61 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 53.6 kB | 53.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-3b0cf13..85f8.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-6f635..c393.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-d4ffc3..9e0f.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-d9a15a0..130a.js gzip | 1.57 kB | 1.57 kB | ✓ |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.98 kB | 7.98 kB | ✓ |
Client Pages Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-f2fcc..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-973cce3..dule.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.6 kB | 5.6 kB | ✓ |
Client Build Manifests
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_buildManifest.js gzip | 321 B | 321 B | ✓ |
_buildManife..dule.js gzip | 330 B | 330 B | ✓ |
Overall change | 651 B | 651 B | ✓ |
Serverless bundles
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_error.js | 916 kB | 916 kB | ✓ |
404.html | 4.61 kB | 4.61 kB | ✓ |
hooks.html | 3.86 kB | 3.86 kB | ✓ |
index.js | 916 kB | 916 kB | ✓ |
link.js | 974 kB | 974 kB | ✓ |
routerDirect.js | 967 kB | 967 kB | ✓ |
withRouter.js | 967 kB | 967 kB | ✓ |
Overall change | 4.75 MB | 4.75 MB | ✓ |
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
buildDuration | 14.8s | 15s | |
nodeModulesSize | 84.9 MB | 84.9 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.634 | 2.684 | |
/ avg req/sec | 949.14 | 931.59 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.463 | 1.536 | |
/error-in-render avg req/sec | 1709.18 | 1627.27 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..d9fb.js gzip | 12.7 kB | 12.7 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-b0b971f..64a5.js gzip | 6.5 kB | 6.5 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.9 kB | 58.9 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 8.23 kB | 8.23 kB | ✓ |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-22cb0cf..dule.js gzip | 5.61 kB | 5.61 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 53.6 kB | 53.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-3b0cf13..85f8.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-6f635..c393.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-d4ffc3..9e0f.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-d9a15a0..130a.js gzip | 1.57 kB | 1.57 kB | ✓ |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.98 kB | 7.98 kB | ✓ |
Client Pages Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-f2fcc..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-973cce3..dule.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.6 kB | 5.6 kB | ✓ |
Client Build Manifests
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_buildManifest.js gzip | 321 B | 321 B | ✓ |
_buildManife..dule.js gzip | 330 B | 330 B | ✓ |
Overall change | 651 B | 651 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
index.html gzip | 971 B | 971 B | ✓ |
link.html gzip | 978 B | 978 B | ✓ |
withRouter.html gzip | 965 B | 965 B | ✓ |
Overall change | 2.91 kB | 2.91 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
buildDuration | 16.5s | 16.6s | |
nodeModulesSize | 84.9 MB | 84.9 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..d9fb.js gzip | 12.7 kB | 12.7 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-b0b971f..64a5.js gzip | 6.5 kB | 6.5 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.9 kB | 58.9 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 8.23 kB | 8.23 kB | ✓ |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-22cb0cf..dule.js gzip | 5.61 kB | 5.61 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 53.6 kB | 53.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-3b0cf13..85f8.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-6f635..c393.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-d4ffc3..9e0f.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-d9a15a0..130a.js gzip | 1.57 kB | 1.57 kB | ✓ |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.98 kB | 7.98 kB | ✓ |
Client Pages Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-f2fcc..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-973cce3..dule.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.6 kB | 5.6 kB | ✓ |
Client Build Manifests
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_buildManifest.js gzip | 321 B | 321 B | ✓ |
_buildManife..dule.js gzip | 330 B | 330 B | ✓ |
Overall change | 651 B | 651 B | ✓ |
Serverless bundles
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_error.js | 916 kB | 916 kB | ✓ |
404.html | 4.61 kB | 4.61 kB | ✓ |
hooks.html | 3.86 kB | 3.86 kB | ✓ |
index.js | 916 kB | 916 kB | ✓ |
link.js | 974 kB | 974 kB | ✓ |
routerDirect.js | 967 kB | 967 kB | ✓ |
withRouter.js | 967 kB | 967 kB | ✓ |
Overall change | 4.75 MB | 4.75 MB | ✓ |
Failing test suitesCommit: 16281ad test/integration/image-optimizer/test/index.test.js
Expand output● Image Optimizer › config checks › should error when loader contains invalid value
|
@stefanjudis, are you still planning on moving forward with this PR? Really looking forward to having this available! 🥇 |
Thanks for the headsup. I do I do. 🙈 Weekend and workday came in the way. But I plan to polish and hopefully land it in the next few days. |
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
buildDuration | 15.4s | 15.3s | -103ms |
nodeModulesSize | 85 MB | 85 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.859 | 2.828 | -0.03 |
/ avg req/sec | 874.46 | 884.13 | +9.67 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.725 | 1.755 | |
/error-in-render avg req/sec | 1449.24 | 1424.84 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..776c.js gzip | 12.7 kB | 12.7 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-95c0df2..6c91.js gzip | 6.53 kB | 6.53 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.9 kB | 58.9 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 8.26 kB | 8.26 kB | ✓ |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-8ead8dd..dule.js gzip | 5.64 kB | 5.64 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 53.6 kB | 53.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-3b0cf13..85f8.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-6f635..c393.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-d4ffc3..9e0f.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-d9a15a0..130a.js gzip | 1.57 kB | 1.57 kB | ✓ |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.98 kB | 7.98 kB | ✓ |
Client Pages Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-f2fcc..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-973cce3..dule.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.6 kB | 5.6 kB | ✓ |
Client Build Manifests
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_buildManifest.js gzip | 321 B | 321 B | ✓ |
_buildManife..dule.js gzip | 330 B | 330 B | ✓ |
Overall change | 651 B | 651 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
index.html gzip | 968 B | 968 B | ✓ |
link.html gzip | 974 B | 974 B | ✓ |
withRouter.html gzip | 961 B | 961 B | ✓ |
Overall change | 2.9 kB | 2.9 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
buildDuration | 17.8s | 18.2s | |
nodeModulesSize | 85 MB | 85 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..776c.js gzip | 12.7 kB | 12.7 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-95c0df2..6c91.js gzip | 6.53 kB | 6.53 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.9 kB | 58.9 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 8.26 kB | 8.26 kB | ✓ |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-8ead8dd..dule.js gzip | 5.64 kB | 5.64 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 53.6 kB | 53.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-3b0cf13..85f8.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-6f635..c393.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-d4ffc3..9e0f.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-d9a15a0..130a.js gzip | 1.57 kB | 1.57 kB | ✓ |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.98 kB | 7.98 kB | ✓ |
Client Pages Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-f2fcc..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-973cce3..dule.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.6 kB | 5.6 kB | ✓ |
Client Build Manifests
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_buildManifest.js gzip | 321 B | 321 B | ✓ |
_buildManife..dule.js gzip | 330 B | 330 B | ✓ |
Overall change | 651 B | 651 B | ✓ |
Serverless bundles
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_error.js | 918 kB | 918 kB | ✓ |
404.html | 4.61 kB | 4.61 kB | ✓ |
hooks.html | 3.86 kB | 3.86 kB | ✓ |
index.js | 918 kB | 918 kB | ✓ |
link.js | 976 kB | 976 kB | ✓ |
routerDirect.js | 969 kB | 969 kB | ✓ |
withRouter.js | 969 kB | 969 kB | ✓ |
Overall change | 4.76 MB | 4.76 MB | ✓ |
Failing test suitesCommit: da6a936 test/integration/image-optimizer/test/index.test.js
Expand output● Image Optimizer › config checks › should error when loader contains invalid value
|
…is/next.js into add-contentful-image-component
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
buildDuration | 13.9s | 14.3s | |
nodeModulesSize | 85 MB | 85 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.607 | 2.646 | |
/ avg req/sec | 959.13 | 944.78 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.524 | 1.54 | |
/error-in-render avg req/sec | 1640.87 | 1622.87 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..776c.js gzip | 12.7 kB | 12.7 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-95c0df2..6c91.js gzip | 6.53 kB | 6.53 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.9 kB | 58.9 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 8.26 kB | 8.26 kB | ✓ |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-8ead8dd..dule.js gzip | 5.64 kB | 5.64 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 53.6 kB | 53.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-3b0cf13..85f8.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-6f635..c393.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-d4ffc3..9e0f.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-d9a15a0..130a.js gzip | 1.57 kB | 1.57 kB | ✓ |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.98 kB | 7.98 kB | ✓ |
Client Pages Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-f2fcc..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-973cce3..dule.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.6 kB | 5.6 kB | ✓ |
Client Build Manifests
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_buildManifest.js gzip | 321 B | 321 B | ✓ |
_buildManife..dule.js gzip | 330 B | 330 B | ✓ |
Overall change | 651 B | 651 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
index.html gzip | 968 B | 968 B | ✓ |
link.html gzip | 974 B | 974 B | ✓ |
withRouter.html gzip | 961 B | 961 B | ✓ |
Overall change | 2.9 kB | 2.9 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
buildDuration | 15.6s | 15.9s | |
nodeModulesSize | 85 MB | 85 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..776c.js gzip | 12.7 kB | 12.7 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-95c0df2..6c91.js gzip | 6.53 kB | 6.53 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.9 kB | 58.9 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 8.26 kB | 8.26 kB | ✓ |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-8ead8dd..dule.js gzip | 5.64 kB | 5.64 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 53.6 kB | 53.6 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-3b0cf13..85f8.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-6f635..c393.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-d4ffc3..9e0f.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-d9a15a0..130a.js gzip | 1.57 kB | 1.57 kB | ✓ |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.98 kB | 7.98 kB | ✓ |
Client Pages Modern
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-f2fcc..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-973cce3..dule.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.6 kB | 5.6 kB | ✓ |
Client Build Manifests
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_buildManifest.js gzip | 321 B | 321 B | ✓ |
_buildManife..dule.js gzip | 330 B | 330 B | ✓ |
Overall change | 651 B | 651 B | ✓ |
Serverless bundles
vercel/next.js canary | stefanjudis/next.js add-contentful-image-component | Change | |
---|---|---|---|
_error.js | 918 kB | 918 kB | ✓ |
404.html | 4.61 kB | 4.61 kB | ✓ |
hooks.html | 3.86 kB | 3.86 kB | ✓ |
index.js | 918 kB | 918 kB | ✓ |
link.js | 976 kB | 976 kB | ✓ |
routerDirect.js | 969 kB | 969 kB | ✓ |
withRouter.js | 969 kB | 969 kB | ✓ |
Overall change | 4.76 MB | 4.76 MB | ✓ |
@ijjk I don't think that the failing test is related to my changes. :) Are you up for adding Contentful support for the |
@@ -428,6 +429,16 @@ function akamaiLoader({ root, src, width }: LoaderProps): string { | |||
return `${root}${normalizeSrc(src)}?imwidth=${width}` | |||
} | |||
|
|||
function contentfulLoader({ src, quality, width }: LoaderProps): string { | |||
const params = ['w=' + width] |
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.
What about auto formatting (webp) and max width limiting? (see cloudinary/imgix below)
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.
Unfortunately, these are params the Contentful Images API doesn't offer.
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.
This could lead to upscaling source images and actually increase the size instead of the expected decrease.
What happens when you have a source image that's 500 pixels wide but you pass w=1000
?
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.
That was a great question. 👍 The Contentful Images API is not upscaling and keeps the max uploaded image dimensions even when w
is greater than the dimension.
Example:
- original image – 420k in size with 1378 × 832
- image with
w=2000
- also 420k with 1378 × 832
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.
@styfle be sure to pass a quality parameter q
when you are delivering images via Contentful's Images API; the quality is set to 100% without it, resulting in much larger images. This is true of WebP and JPG. I recommend experimenting with q
values from 30-70.
@stefanjudis thank you for putting in the work with this. I can't leverage the new Next.js image component without it as I would quickly go over my Vercel bandwidth allotment! What's the process to progress this into canary? |
Looking forward to this, thanks for the work! |
We might decide to use #19325 in favor of this PR since it will handle arbitrary CDNs. |
@styfle Makes sense. 🎉 Feel free to close if decided. |
Makes sense @styfle, thanks for linking and staying on top of it. Any word on when #19325 may be available? Thanks for your work on this @stefanjudis! |
Hey guys, first of all thanks to @stefanjudis for the great work on this. In the meantime, since there's still some precision making to do (and obviously well under way) by the Next team, I have a recommendation for all Contentful/Next.js integrators who are eagerly awaiting the merge of either this or #19325: So, for now you could just make Stefan's adjustments from this PR in your own Cheers :) |
Closing in favor of #20216 |
This can now be done by:
function normalizeSrc(src: string) {
return src[0] === '/' ? src.slice(1) : src;
}
function contentfulLoader({ src, quality, width }: ImageLoaderProps): string {
const params = ['w=' + width];
if (quality) {
params.push('q=' + quality);
}
return `${normalizeSrc(src)}?${params.join('&')}`;
} |
We took the freedom to add a contentful image loader on our stream.
There are no major changes and we only added another loader to the image config.
@ijjk Does that work for you? If so, we probably would have to adjust docs, too? Happy to continue to work on this PR. :)