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 Aliyun OSS image loader #18965

Closed
wants to merge 4 commits into from

Conversation

Gerhut
Copy link

@Gerhut Gerhut commented Nov 9, 2020

I'm working on a next.js project behind Aliyun (Alibaba Cloud) OSS, and wrote an image loader based on Aliyun OSS image processing.

Contribute back to see if it is needed by others.

@ijjk
Copy link
Member

ijjk commented Nov 9, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
buildDuration 12.8s 13s ⚠️ +152ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +1.51 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
/ failed reqs 0 0
/ total time (seconds) 2.386 2.364 -0.02
/ avg req/sec 1048 1057.33 +9.33
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.194 1.236 ⚠️ +0.04
/error-in-render avg req/sec 2093.37 2021.92 ⚠️ -71.45
Client Bundles (main, webpack, commons)
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-56c34a4..e157.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 Gerhut/next.js image-loaders/aliyun-oss Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-c8c3589..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 Gerhut/next.js image-loaders/aliyun-oss Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss Change
buildDuration 14.4s 14.1s -291ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +1.51 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-56c34a4..e157.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 Gerhut/next.js image-loaders/aliyun-oss Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-c8c3589..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 Gerhut/next.js image-loaders/aliyun-oss Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 915 kB 915 kB
link.js 964 kB 964 kB
routerDirect.js 957 kB 957 kB
withRouter.js 957 kB 957 kB
Overall change 4.72 MB 4.72 MB
Commit: 3332cc2

@ijjk
Copy link
Member

ijjk commented Nov 9, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
buildDuration 13.4s 13.5s ⚠️ +48ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +1.51 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
/ failed reqs 0 0
/ total time (seconds) 2.418 2.468 ⚠️ +0.05
/ avg req/sec 1033.96 1013.07 ⚠️ -20.89
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.339 1.341 0
/error-in-render avg req/sec 1866.43 1864.59 ⚠️ -1.84
Client Bundles (main, webpack, commons)
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-56c34a4..e157.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 Gerhut/next.js image-loaders/aliyun-oss Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-c8c3589..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 Gerhut/next.js image-loaders/aliyun-oss Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss Change
buildDuration 15.4s 15.3s -93ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +1.51 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-56c34a4..e157.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 Gerhut/next.js image-loaders/aliyun-oss Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-c8c3589..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 Gerhut/next.js image-loaders/aliyun-oss Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 915 kB 915 kB
link.js 964 kB 964 kB
routerDirect.js 957 kB 957 kB
withRouter.js 957 kB 957 kB
Overall change 4.72 MB 4.72 MB
Commit: 139f0cb

packages/next/client/image.tsx Outdated Show resolved Hide resolved
@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 Gerhut/next.js image-loaders/aliyun-oss Change
buildDuration 12.4s 12.7s ⚠️ +312ms
nodeModulesSize 85 MB 85 MB ⚠️ +1.51 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss Change
/ failed reqs 0 0
/ total time (seconds) 2.392 2.345 -0.05
/ avg req/sec 1045.24 1065.91 +20.67
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.249 1.29 ⚠️ +0.04
/error-in-render avg req/sec 2002.3 1938.29 ⚠️ -64.01
Client Bundles (main, webpack, commons)
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss Change
buildDuration 15.1s 14.4s -692ms
nodeModulesSize 85 MB 85 MB ⚠️ +1.51 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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 Gerhut/next.js image-loaders/aliyun-oss 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: 1cffa51

@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
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants