Skip to content
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 Uploadcare image loader #18688

Closed
wants to merge 10 commits into from
Closed

Conversation

nd0ut
Copy link

@nd0ut nd0ut commented Nov 2, 2020

Add image loader for next/image with Uploadcare.

images: {
loader: 'uploadcare',
path: 'https://cd813a35e9a71d2f5125.ucr.io', // optional
},
Copy link
Author

@nd0ut nd0ut Nov 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to be able to pass custom options directly to the image loader. I could make another PR with this feature. What do you think?

@ijjk
Copy link
Member

ijjk commented Nov 2, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 14s 14.7s ⚠️ +607ms
nodeModulesSize 90 MB 90 MB ⚠️ +6.16 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
/ failed reqs 0 0
/ total time (seconds) 2.78 2.827 ⚠️ +0.05
/ avg req/sec 899.13 884.22 ⚠️ -14.91
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.578 1.709 ⚠️ +0.13
/error-in-render avg req/sec 1584.15 1463.09 ⚠️ -121.06
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..3aa9.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-bdd7564..bfa7.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.3 kB 58.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.03 kB 7.03 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-e70a6ce..dule.js gzip 6.35 kB 6.35 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-e71be6d..3531.js gzip 1.34 kB 1.34 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.75 kB 7.75 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-6d15176..dule.js gzip 1.31 kB 1.31 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.41 kB 5.41 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 323 B 323 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 652 B 652 B
Rendered Page Sizes
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB
withRouter.html gzip 995 B 995 B
Overall change 3.01 kB 3.01 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 16.1s 15.9s -215ms
nodeModulesSize 90 MB 90 MB ⚠️ +6.16 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..3aa9.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-bdd7564..bfa7.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.3 kB 58.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.03 kB 7.03 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-e70a6ce..dule.js gzip 6.35 kB 6.35 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-e71be6d..3531.js gzip 1.34 kB 1.34 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.75 kB 7.75 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-6d15176..dule.js gzip 1.31 kB 1.31 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.41 kB 5.41 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 323 B 323 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 652 B 652 B
Serverless bundles
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_error.js 1.06 MB 1.06 MB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.06 MB 1.06 MB
link.js 1.11 MB 1.11 MB
routerDirect.js 1.1 MB 1.1 MB
withRouter.js 1.1 MB 1.1 MB
Overall change 5.43 MB 5.43 MB
Commit: b743cbf

@ijjk
Copy link
Member

ijjk commented Nov 3, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 12.2s 11.8s -400ms
nodeModulesSize 90 MB 90.1 MB ⚠️ +6.16 kB
Page Load Tests Overall increase ✓
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
/ failed reqs 0 0
/ total time (seconds) 2.315 2.287 -0.03
/ avg req/sec 1079.93 1092.96 +13.03
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.203 1.205 0
/error-in-render avg req/sec 2078.41 2074.92 ⚠️ -3.49
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..981d.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-89c13e5..d360.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.3 kB 58.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.03 kB 7.03 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-a53bbe5..dule.js gzip 6.35 kB 6.35 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-a674d88..ccde.js gzip 1.35 kB 1.35 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.75 kB 7.75 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-a4469f3..dule.js gzip 1.32 kB 1.32 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.41 kB 5.41 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Rendered Page Sizes
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB
withRouter.html gzip 995 B 995 B
Overall change 3.01 kB 3.01 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 13.4s 13.2s -206ms
nodeModulesSize 90 MB 90.1 MB ⚠️ +6.16 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..981d.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-89c13e5..d360.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.3 kB 58.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.03 kB 7.03 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-a53bbe5..dule.js gzip 6.35 kB 6.35 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-a674d88..ccde.js gzip 1.35 kB 1.35 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.75 kB 7.75 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-a4469f3..dule.js gzip 1.32 kB 1.32 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.41 kB 5.41 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Serverless bundles
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_error.js 1.07 MB 1.07 MB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.07 MB 1.07 MB
link.js 1.12 MB 1.12 MB
routerDirect.js 1.11 MB 1.11 MB
withRouter.js 1.11 MB 1.11 MB
Overall change 5.48 MB 5.48 MB
Commit: d7a0b99

@ijjk
Copy link
Member

ijjk commented Nov 3, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 13.3s 13.8s ⚠️ +506ms
nodeModulesSize 90.1 MB 90.1 MB ⚠️ +6.2 kB
Page Load Tests Overall increase ✓
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
/ failed reqs 0 0
/ total time (seconds) 2.504 2.474 -0.03
/ avg req/sec 998.35 1010.5 +12.15
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.38 1.356 -0.02
/error-in-render avg req/sec 1811.66 1843.66 +32
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..981d.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-d23595f..3966.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.3 kB 58.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.03 kB 7.03 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-65e68ba..dule.js gzip 6.35 kB 6.35 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-a674d88..ccde.js gzip 1.35 kB 1.35 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.75 kB 7.75 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-a4469f3..dule.js gzip 1.32 kB 1.32 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.41 kB 5.41 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Rendered Page Sizes
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB
withRouter.html gzip 995 B 995 B
Overall change 3.01 kB 3.01 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 15.1s 15.2s ⚠️ +108ms
nodeModulesSize 90.1 MB 90.1 MB ⚠️ +6.2 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..981d.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-d23595f..3966.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.3 kB 58.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.03 kB 7.03 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-65e68ba..dule.js gzip 6.35 kB 6.35 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-a674d88..ccde.js gzip 1.35 kB 1.35 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.75 kB 7.75 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-a4469f3..dule.js gzip 1.32 kB 1.32 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.41 kB 5.41 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Serverless bundles
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_error.js 1.07 MB 1.07 MB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.07 MB 1.07 MB
link.js 1.12 MB 1.12 MB
routerDirect.js 1.11 MB 1.11 MB
withRouter.js 1.11 MB 1.11 MB
Overall change 5.48 MB 5.48 MB
Commit: cf1cf0a

@ijjk
Copy link
Member

ijjk commented Nov 5, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 11.1s 10.8s -260ms
nodeModulesSize 90.1 MB 90.1 MB ⚠️ +6.2 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
/ failed reqs 0 0
/ total time (seconds) 2.048 2.061 ⚠️ +0.01
/ avg req/sec 1220.54 1213.15 ⚠️ -7.39
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.092 1.097 0
/error-in-render avg req/sec 2288.92 2278.92 ⚠️ -10
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..02db.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-3d433ed..98b9.js gzip 7.37 kB 7.37 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-d2e2380..dule.js gzip 6.37 kB 6.37 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-b5..1119.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-a674d88..ccde.js gzip 1.35 kB 1.35 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.75 kB 7.75 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-a4469f3..dule.js gzip 1.32 kB 1.32 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.41 kB 5.41 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Rendered Page Sizes
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB
withRouter.html gzip 995 B 995 B
Overall change 3 kB 3 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 12.6s 12.6s ⚠️ +36ms
nodeModulesSize 90.1 MB 90.1 MB ⚠️ +6.2 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..02db.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-3d433ed..98b9.js gzip 7.37 kB 7.37 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-d2e2380..dule.js gzip 6.37 kB 6.37 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-b5..1119.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-a674d88..ccde.js gzip 1.35 kB 1.35 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.75 kB 7.75 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-a4469f3..dule.js gzip 1.32 kB 1.32 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.41 kB 5.41 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Serverless bundles
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_error.js 1.07 MB 1.07 MB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 1.07 MB 1.07 MB
link.js 1.12 MB 1.12 MB
routerDirect.js 1.11 MB 1.11 MB
withRouter.js 1.11 MB 1.11 MB
Overall change 5.49 MB 5.49 MB
Commit: 50fe432

@@ -560,6 +561,68 @@ function cloudinaryLoader({ root, src, width, quality }: LoaderProps): string {
return `${root}${paramsString}${normalizeSrc(src)}`
}

function uploadcareLoader({ root, src, width, quality }: LoaderProps): string {
const isOnCdn = /^https?:\/\/ucarecdn\.com/.test(src)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if i use custom cname like images.example.com for my uploadcare images?

Copy link
Author

@nd0ut nd0ut Nov 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if i use custom cname like images.example.com for my uploadcare images?

That's why we need ability to pass custom options directly to the image loader. I prefer not to change Image Loader API without discussion with Next.js team.

So, custom cnames aren't supported now. I've added a few words about it in readme.

@nd0ut
Copy link
Author

nd0ut commented Nov 10, 2020

As for image loader options, I propose following API:

module.exports = {
  images: {
    loader: 'uploadcare',
    loaderOptions: {
      cdnBase: 'images.example.com'
    }
  },
}

where loaderOptions will be passed to image loader function directly as options

function imageLoader({ root, src, width, quality, options }: LoaderProps)

@ijjk
Copy link
Member

ijjk commented Nov 10, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 11.4s 11.5s ⚠️ +126ms
nodeModulesSize 85 MB 85 MB ⚠️ +6.22 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
/ failed reqs 0 0
/ total time (seconds) 2.13 2.14 ⚠️ +0.01
/ avg req/sec 1173.85 1168.22 ⚠️ -5.63
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.114 1.14 ⚠️ +0.03
/error-in-render avg req/sec 2244.17 2193.9 ⚠️ -50.27
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-d20d8bb..4991.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-6468b39..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Rendered Page Sizes
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
index.html gzip 1 kB 1 kB
link.html gzip 1.01 kB 1.01 kB
withRouter.html gzip 998 B 998 B
Overall change 3.01 kB 3.01 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 12.9s 12.9s ⚠️ +48ms
nodeModulesSize 85 MB 85 MB ⚠️ +6.22 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-d20d8bb..4991.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-6468b39..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Serverless bundles
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_error.js 915 kB 915 kB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 916 kB 916 kB
link.js 965 kB 965 kB
routerDirect.js 958 kB 958 kB
withRouter.js 958 kB 958 kB
Overall change 4.72 MB 4.72 MB
Commit: bbd27f2

@vercel vercel bot temporarily deployed to Preview November 30, 2020 09:19 Inactive
@ijjk
Copy link
Member

ijjk commented Nov 30, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 10.2s 10.4s ⚠️ +146ms
nodeModulesSize 85 MB 85 MB ⚠️ +6.26 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
/ failed reqs 0 0
/ total time (seconds) 2.323 2.353 ⚠️ +0.03
/ avg req/sec 1076.4 1062.4 ⚠️ -14
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.525 1.557 ⚠️ +0.03
/error-in-render avg req/sec 1639.26 1605.78 ⚠️ -33.48
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-90b3d5a..55ad.js gzip 6.54 kB 6.54 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
index.html gzip 614 B 614 B
link.html gzip 621 B 621 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 uploadcare/next.js uploadcare-loader Change
buildDuration 11.9s 12.2s ⚠️ +250ms
nodeModulesSize 85 MB 85 MB ⚠️ +6.26 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-90b3d5a..55ad.js gzip 6.54 kB 6.54 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_error.js 996 kB 996 kB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 996 kB 996 kB
link.js 1.05 MB 1.05 MB
routerDirect.js 1.04 MB 1.04 MB
withRouter.js 1.04 MB 1.04 MB
Overall change 5.13 MB 5.13 MB
Commit: a8555b2

@ijjk
Copy link
Member

ijjk commented Nov 30, 2020

Failing test suites

Commit: a8555b2

test/integration/image-optimizer/test/index.test.js

  • Image Optimizer > config checks > should error when loader contains invalid value
Expand output

● Image Optimizer › config checks › should error when loader contains invalid value

expect(received).toContain(expected) // indexOf

Expected substring: "Specified images.loader should be one of (default, imgix, cloudinary, akamai), received invalid value (notreal)"
Received string:    "Error: Specified images.loader should be one of (default, imgix, cloudinary, akamai, uploadcare), received invalid value (notreal).
See more info here: https://err.sh/next.js/invalid-images-config

  3 | if(userDistDir==='public'){throw new Error(`The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://err.sh/vercel/next.js/can-not-output-to-public`);}// make sure distDir isn't an empty string as it can result in the provided
  4 | // directory being deleted in development mode
> 5 | if(userDistDir.length===0){throw new Error(`Invalid distDir provided, distDir can not be an empty string. Please remove this config or set it to undefined`);}}if(key==='pageExtensions'){if(!Array.isArray(value)){throw new Error(`Specified pageExtensions is not an array of strings, found "${value}". Please update this config or remove it.`);}if(!value.length){throw new Error(`Specified pageExtensions is an empty array. Please update it with the relevant extensions or remove it.`);}value.forEach(ext=>{if(typeof ext!=='string'){throw new Error(`Specified pageExtensions is not an array of strings, found "${ext}" of type "${typeof ext}". Please update this config or remove it.`);}});}if(!!value&&value.constructor===Object){currentConfig[key]={...defaultConfig[key],...Object.keys(value).reduce((c,k)=>{const v=value[k];if(v!==undefined&&v!==null){c[k]=v;}return c;},{})};}else{currentConfig[key]=value;}return currentConfig;},{});const result={...defaultConfig,...config};if(typeof result.assetPrefix!=='string'){throw new Error(`Specified assetPrefix is not a string, found type "${typeof result.assetPrefix}" https://err.sh/vercel/next.js/invalid-assetprefix`);}if(typeof result.basePath!=='string'){throw new Error(`Specified basePath is not a string, found type "${typeof result.basePath}"`);}if(result.basePath!==''){if(result.basePath==='/'){throw new Error(`Specified basePath /. basePath has to be either an empty string or a path prefix"`);}if(!result.basePath.startsWith('/')){throw new Error(`Specified basePath has to start with a /, found "${result.basePath}"`);}if(result.basePath!=='/'){if(result.basePath.endsWith('/')){throw new Error(`Specified basePath should not end with /, found "${result.basePath}"`);}if(result.assetPrefix===''){result.assetPrefix=result.basePath;}if(result.amp.canonicalBase===''){result.amp.canonicalBase=result.basePath;}}}if(result==null?void 0:result.images){const images=result.images;if(typeof images!=='object'){throw new Error(`Specified images should be an object received ${typeof images}.\nSee more info here: https://err.sh/next.js/invalid-images-config`);}if(images.domains){if(!Array.isArray(images.domains)){throw new Error(`Specified images.domains should be an Array received ${typeof images.domains}.\nSee more info here: https://err.sh/next.js/invalid-images-config`);}if(images.domains.length>50){throw new Error(`Specified images.domains exceeds length of 50, received length (${images.domains.length}), please reduce the length of the array to continue.\nSee more info here: https://err.sh/next.js/invalid-images-config`);}const invalid=images.domains.filter(d=>typeof d!=='string');if(invalid.length>0){throw new Error(`Specified images.domains should be an Array of strings received invalid values (${invalid.join(', ')}).\nSee more info here: https://err.sh/next.js/invalid-images-config`);}}if(images.deviceSizes){const{deviceSizes}=images;if(!Array.isArray(deviceSizes)){throw new Error(`Specified images.deviceSizes should be an Array received ${typeof deviceSizes}.\nSee more info here: https://err.sh/next.js/invalid-images-config`);}if(deviceSizes.length>25){throw new Error(`Specified images.deviceSizes exceeds length of 25, received length (${deviceSizes.length}), please reduce the length of the array to continue.\nSee more info here: https://err.sh/next.js/invalid-images-config`);}const invalid=deviceSizes.filter(d=>{return typeof d!=='number'||d<1||d>10000;});if(invalid.length>0){throw new Error(`Specified images.deviceSizes should be an Array of numbers that are between 1 and 10000, received invalid values (${invalid.join(', ')}).\nSee more info here: https://err.sh/next.js/invalid-images-config`);}}if(images.imageSizes){const{imageSizes}=images;if(!Array.isArray(imageSizes)){throw new Error(`Specified images.imageSizes should be an Array received ${typeof imageSizes}.\nSee more info here: https://err.sh/next.js/invalid-images-config`);}if(imageSizes.length>25){throw new Error(`Specified images.imageSizes exceeds length of 25, received length (${imageSizes.length}), please reduce the length of the array to continue.\nSee more info here: https://err.sh/next.js/invalid-images-config`);}const invalid=imageSizes.filter(d=>{return typeof d!=='number'||d<1||d>10000;});if(invalid.length>0){throw new Error(`Specified images.imageSizes should be an Array of numbers that are between 1 and 10000, received invalid values (${invalid.join(', ')}).\nSee more info here: https://err.sh/next.js/invalid-images-config`);}}if(!images.loader){images.loader='default';}if(!_imageConfig.VALID_LOADERS.includes(images.loader)){throw new Error(`Specified images.loader should be one of (${_imageConfig.VALID_LOADERS.join(', ')}), received invalid value (${images.loader}).\nSee more info here: https://err.sh/next.js/invalid-images-config`);}// Append trailing slash for non-default loaders
    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
  6 | if(images.path){if(images.loader!=='default'&&images.path[images.path.length-1]!=='/'){images.path+='/';}}}if(result.i18n){const{i18n}=result;const i18nType=typeof i18n;if(i18nType!=='object'){throw new Error(`Specified i18n should be an object received ${i18nType}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config`);}if(!Array.isArray(i18n.locales)){throw new Error(`Specified i18n.locales should be an Array received ${typeof i18n.locales}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config`);}const defaultLocaleType=typeof i18n.defaultLocale;if(!i18n.defaultLocale||defaultLocaleType!=='string'){throw new Error(`Specified i18n.defaultLocale should be a string.\nSee more info here: https://err.sh/next.js/invalid-i18n-config`);}if(typeof i18n.domains!=='undefined'&&!Array.isArray(i18n.domains)){throw new Error(`Specified i18n.domains must be an array of domain objects e.g. [ { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] } ] received ${typeof i18n.domains}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config`);}if(i18n.domains){const invalidDomainItems=i18n.domains.filter(item=>{if(!item||typeof item!=='object')return true;if(!item.defaultLocale)return true;if(!item.domain||typeof item.domain!=='string')return true;let hasInvalidLocale=false;if(Array.isArray(item.locales)){for(const locale of item.locales){if(typeof locale!=='string')hasInvalidLocale=true;for(const domainItem of i18n.domains){if(domainItem===item)continue;if(domainItem.locales&&domainItem.locales.includes(locale)){console.warn(`Both ${item.domain} and ${domainItem.domain} configured the locale (${locale}) but only one can. Remove it from one i18n.domains config to continue`);hasInvalidLocale=true;break;}}}}return hasInvalidLocale;});if(invalidDomainItems.length>0){throw new Error(`Invalid i18n.domains values:\n${invalidDomainItems.map(item=>JSON.stringify(item)).join('\n')}\n\ndomains value must follow format { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] }.\nSee more info here: https://err.sh/next.js/invalid-i18n-config`);}}if(!Array.isArray(i18n.locales)){throw new Error(`Specified i18n.locales must be an array of locale strings e.g. ["en-US", "nl-NL"] received ${typeof i18n.locales}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config`);}const invalidLocales=i18n.locales.filter(locale=>typeof locale!=='string');if(invalidLocales.length>0){throw new Error(`Specified i18n.locales contains invalid values (${invalidLocales.map(String).join(', ')}), locales must be valid locale tags provided as strings e.g. "en-US".\n`+`See here for list of valid language sub-tags: http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry`);}if(!i18n.locales.includes(i18n.defaultLocale)){throw new Error(`Specified i18n.defaultLocale should be included in i18n.locales.\nSee more info here: https://err.sh/next.js/invalid-i18n-config`);}// make sure default Locale is at the front
  7 | i18n.locales=[i18n.defaultLocale,...i18n.locales.filter(locale=>locale!==i18n.defaultLocale)];const localeDetectionType=typeof i18n.localeDetection;if(localeDetectionType!=='boolean'&&localeDetectionType!=='undefined'){throw new Error(`Specified i18n.localeDetection should be undefined or a boolean received ${localeDetectionType}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config`);}}return result;}function normalizeConfig(phase,config){if(typeof config==='function'){config=config(phase,{defaultConfig});if(typeof config.then==='function'){throw new Error('> Promise returned in next config. https://err.sh/vercel/next.js/promise-in-next-config');}}return config;}function loadConfig(phase,dir,customConfig){if(customConfig){return assignDefaults({configOrigin:'server',...customConfig});}const path=_findUp.default.sync(_constants.CONFIG_FILE,{cwd:dir});// If config file was found
  8 | if(path==null?void 0:path.length){var _userConfig$amp,_userConfig$experimen;const userConfigModule=require(path);const userConfig=normalizeConfig(phase,userConfigModule.default||userConfigModule);if(Object.keys(userConfig).length===0){Log.warn('Detected next.config.js, no exported configuration found. https://err.sh/vercel/next.js/empty-configuration');}if(userConfig.target&&!targets.includes(userConfig.target)){throw new Error(`Specified target is invalid. Provided: "${userConfig.target}" should be one of ${targets.join(', ')}`);}if((_userConfig$amp=userConfig.amp)==null?void 0:_userConfig$amp.canonicalBase){const{canonicalBase}=userConfig.amp||{};userConfig.amp=userConfig.amp||{};userConfig.amp.canonicalBase=(canonicalBase.endsWith('/')?canonicalBase.slice(0,-1):canonicalBase)||'';}if(((_userConfig$experimen=userConfig.experimental)==null?void 0:_userConfig$experimen.reactMode)&&!reactModes.includes(userConfig.experimental.reactMode)){throw new Error(`Specified React Mode is invalid. Provided: ${userConfig.experimental.reactMode} should be one of ${reactModes.join(', ')}`);}return assignDefaults({configOrigin:_constants.CONFIG_FILE,configFile:path,...userConfig});}else{const configBaseName=(0,_path.basename)(_constants.CONFIG_FILE,(0,_path.extname)(_constants.CONFIG_FILE));const nonJsPath=_findUp.default.sync([`${configBaseName}.jsx`,`${configBaseName}.ts`,`${configBaseName}.tsx`,`${configBaseName}.json`],{cwd:dir});if(nonJsPath==null?void 0:nonJsPath.length){throw new Error(`Configuring Next.js via '${(0,_path.basename)(nonJsPath)}' is not supported. Please replace the file with 'next.config.js'.`);}}return defaultConfig;}function isTargetLikeServerless(target){const isServerless=target==='serverless';const isServerlessTrace=target==='experimental-serverless-trace';return isServerless||isServerlessTrace;}

  at assignDefaults (../packages/next/dist/next-server/server/config.js:5:4619)
  at loadConfig (../packages/next/dist/next-server/server/config.js:8:1101)
  at new Server (../packages/next/dist/next-server/server/next-server.js:1:4383)
  at new DevServer (../packages/next/dist/server/next-dev-server.js:1:2964)
  at createServer (../packages/next/dist/server/next.js:2:607)
  at start (../packages/next/dist/server/lib/start-server.js:1:323)
  at nextDev (../packages/next/dist/cli/next-dev.js:20:1776)
  at ../packages/next/dist/bin/next:27:115
  "
  at Object.<anonymous> (integration/image-optimizer/test/index.test.js:570:22)

@vercel vercel bot temporarily deployed to Preview November 30, 2020 09:48 Inactive
@ijjk
Copy link
Member

ijjk commented Nov 30, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 9.7s 9.6s -79ms
nodeModulesSize 85 MB 85 MB ⚠️ +6.26 kB
Page Load Tests Overall increase ✓
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
/ failed reqs 0 0
/ total time (seconds) 2.257 2.129 -0.13
/ avg req/sec 1107.66 1174.41 +66.75
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.294 1.234 -0.06
/error-in-render avg req/sec 1931.37 2025.49 +94.12
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-90b3d5a..55ad.js gzip 6.54 kB 6.54 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
index.html gzip 614 B 614 B
link.html gzip 621 B 621 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 uploadcare/next.js uploadcare-loader Change
buildDuration 12.1s 11.6s -503ms
nodeModulesSize 85 MB 85 MB ⚠️ +6.26 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-90b3d5a..55ad.js gzip 6.54 kB 6.54 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_error.js 996 kB 996 kB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 996 kB 996 kB
link.js 1.05 MB 1.05 MB
routerDirect.js 1.04 MB 1.04 MB
withRouter.js 1.04 MB 1.04 MB
Overall change 5.13 MB 5.13 MB
Commit: 08d098a

@vercel vercel bot temporarily deployed to Preview December 14, 2020 10:24 Inactive
@ijjk
Copy link
Member

ijjk commented Dec 14, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
buildDuration 10.8s 10.9s ⚠️ +94ms
nodeModulesSize 82.4 MB 82.4 MB ⚠️ +6.26 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
/ failed reqs 0 0
/ total time (seconds) 2.571 2.576 0
/ avg req/sec 972.51 970.5 ⚠️ -2.01
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.392 1.461 ⚠️ +0.07
/error-in-render avg req/sec 1796.1 1711.44 ⚠️ -84.66
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..0679.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-b992ce4..2479.js gzip 6.56 kB 6.56 kB
webpack-95c2..e870.js gzip 751 B 751 B
Overall change 59.1 kB 59.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-d3..23f6.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-0d19cb6..5497.js gzip 1.28 kB 1.28 kB
_error-2cf0e..a0a0.js gzip 3.69 kB 3.69 kB
hooks-42456f..0c06.js gzip 887 B 887 B
index-8081ce..e44f.js gzip 227 B 227 B
link-0ab9f83..fa00.js gzip 1.61 kB 1.61 kB
routerDirect..c3d8.js gzip 303 B 303 B
withRouter-0..a68e.js gzip 302 B 302 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
index.html gzip 615 B 615 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 uploadcare/next.js uploadcare-loader Change
buildDuration 12.7s 12.4s -268ms
nodeModulesSize 82.4 MB 82.4 MB ⚠️ +6.26 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
677f882d2ed8..0679.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-b992ce4..2479.js gzip 6.56 kB 6.56 kB
webpack-95c2..e870.js gzip 751 B 751 B
Overall change 59.1 kB 59.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
polyfills-d3..23f6.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_app-0d19cb6..5497.js gzip 1.28 kB 1.28 kB
_error-2cf0e..a0a0.js gzip 3.69 kB 3.69 kB
hooks-42456f..0c06.js gzip 887 B 887 B
index-8081ce..e44f.js gzip 227 B 227 B
link-0ab9f83..fa00.js gzip 1.61 kB 1.61 kB
routerDirect..c3d8.js gzip 303 B 303 B
withRouter-0..a68e.js gzip 302 B 302 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary uploadcare/next.js uploadcare-loader Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Serverless bundles
vercel/next.js canary uploadcare/next.js uploadcare-loader 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
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.16 MB 5.16 MB
Commit: bb043e9

@Timer
Copy link
Member

Timer commented Jan 5, 2021

Hi! We just added the ability to pass your own custom loader to the Image component, so we're no longer accepting new built-in providers.

See this PR to learn how to use it: #20788

Thanks!

@Timer Timer closed this Jan 5, 2021
kkomelin added a commit to uploadcare/nextjs-loader that referenced this pull request Sep 30, 2021
@kkomelin
Copy link

We've just released the Uploadcare image loader as a separate package @uploadcare/nextjs-loader for those who are interested in the integration.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants