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 example for proxying upstream with custom routes #14374

Merged
merged 9 commits into from
Jun 22, 2020

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Jun 19, 2020

As discussed this adds an example to demonstrate how you can achieve proxying upstream requests that didn't match any pages/assets in Next.js which can be helpful in achieving incremental migration

@ijjk ijjk added the examples Issue was opened via the examples template. label Jun 19, 2020
@ijjk
Copy link
Member Author

ijjk commented Jun 19, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 11.2s 11.1s -163ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
/ failed reqs 0 0
/ total time (seconds) 1.864 1.892 ⚠️ +0.03
/ avg req/sec 1341.3 1321.06 -20.24
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.185 1.123 -0.06
/error-in-render avg req/sec 2109.35 2226.16 ⚠️ +116.81
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..4dd5.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.html gzip 953 B 953 B
link.html gzip 960 B 960 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 12.3s 12.1s -130ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..4dd5.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: 118194e

@@ -0,0 +1,11 @@
const http = require('http')
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this file, it should show proxying to an external website, potentially you can host a "legacy frontend" as an example

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to use an existing site as the upstream proxy instead 👍

ijjk added 3 commits June 20, 2020 14:42
….js into example/custom-routes-proxying

# Conflicts:
#	examples/custom-routes-proxying/package.json
@ijjk
Copy link
Member Author

ijjk commented Jun 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 12.1s 12s -107ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
/ failed reqs 0 0
/ total time (seconds) 2.026 2.017 -0.01
/ avg req/sec 1234.06 1239.57 ⚠️ +5.51
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.213 1.212 0
/error-in-render avg req/sec 2060.99 2063.21 ⚠️ +2.22
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.html gzip 955 B 955 B
link.html gzip 961 B 961 B
withRouter.html gzip 948 B 948 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 12.9s 13s ⚠️ +11ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: 98d1dc5

@ijjk
Copy link
Member Author

ijjk commented Jun 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 10.1s 10.3s ⚠️ +151ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
/ failed reqs 0 0
/ total time (seconds) 1.71 1.723 ⚠️ +0.01
/ avg req/sec 1462.03 1451.36 -10.67
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.086 1.064 -0.02
/error-in-render avg req/sec 2301.29 2348.91 ⚠️ +47.62
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.html gzip 955 B 955 B
link.html gzip 961 B 961 B
withRouter.html gzip 948 B 948 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 11.2s 10.9s -396ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: 28ce205

@ijjk
Copy link
Member Author

ijjk commented Jun 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 12.1s 12.1s ⚠️ +13ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
/ failed reqs 0 0
/ total time (seconds) 2.079 2.063 -0.02
/ avg req/sec 1202.47 1211.72 ⚠️ +9.25
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.432 1.372 -0.06
/error-in-render avg req/sec 1745.26 1822.66 ⚠️ +77.4
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.html gzip 955 B 955 B
link.html gzip 961 B 961 B
withRouter.html gzip 948 B 948 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 12.7s 13s ⚠️ +252ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: 5cbc772

@ijjk ijjk requested review from timneutkens and lfades June 21, 2020 23:40
@ijjk
Copy link
Member Author

ijjk commented Jun 21, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 11.7s 11.7s -49ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
/ failed reqs 0 0
/ total time (seconds) 1.971 2.062 ⚠️ +0.09
/ avg req/sec 1268.25 1212.14 -56.11
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.17 1.211 ⚠️ +0.04
/error-in-render avg req/sec 2136.69 2065.08 -71.61
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.html gzip 954 B 954 B
link.html gzip 959 B 959 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 12.6s 12.4s -105ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: 0fb72b3

@ijjk
Copy link
Member Author

ijjk commented Jun 22, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 11.9s 12.2s ⚠️ +314ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
/ failed reqs 0 0
/ total time (seconds) 1.978 2.034 ⚠️ +0.06
/ avg req/sec 1263.91 1229.1 -34.81
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.219 1.257 ⚠️ +0.04
/error-in-render avg req/sec 2051.06 1988.91 -62.15
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
index.html gzip 954 B 954 B
link.html gzip 959 B 959 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
buildDuration 13.1s 12.5s -572ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary ijjk/next.js example/custom-routes-proxying Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: b7f0201

@kodiakhq kodiakhq bot merged commit 051481c into vercel:canary Jun 22, 2020
rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
As discussed this adds an example to demonstrate how you can achieve proxying upstream requests that didn't match any pages/assets in Next.js which can be helpful in achieving incremental migration
@ijjk ijjk deleted the example/custom-routes-proxying branch April 1, 2021 16:39
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue was opened via the examples template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants