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

[Example] Fix relay network request #16525

Merged
merged 13 commits into from Sep 2, 2020

Conversation

HsuTing
Copy link
Contributor

@HsuTing HsuTing commented Aug 24, 2020

I perfer relayData  instead of records  to deal with the cache in examples/with-react-relay-network-modern. If we use records, the server and the browser will call query on both sides at the first loading.
To prevent the double-calling, we let the query to be stored in relayData, which is  from RelaySSR(a function) in the package called react-relay-network-modern-ssr.

And I also add react-hooks to simplify code and make it more flexible.

Relative: #11343

@ijjk ijjk added the examples Issue/PR related to examples label Aug 24, 2020
@ijjk
Copy link
Member

ijjk commented Aug 24, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 13.2s 13s -147ms
nodeModulesSize 57.5 MB 57.5 MB
Page Load Tests Overall increase ✓
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
/ failed reqs 0 0
/ total time (seconds) 2.304 2.265 -0.04
/ avg req/sec 1085.11 1103.63 +18.52
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.296 1.282 -0.01
/error-in-render avg req/sec 1929.36 1949.68 +20.32
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..7f47.js gzip 10.3 kB 10.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-7e72e5b..8b35.js gzip 7.2 kB 7.2 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.15 kB 6.15 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-e35d22e..dule.js gzip 6.24 kB 6.24 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.1 kB 52.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-28298..e0c9.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-000f151..65d4.js gzip 1.29 kB 1.29 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.69 kB 7.69 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-65c8a..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-4cfda7a..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.35 kB 5.35 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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 HsuTing/next.js fix-relay-network-request Change
index.html gzip 948 B 948 B
link.html gzip 954 B 954 B
withRouter.html gzip 939 B 939 B
Overall change 2.84 kB 2.84 kB

Serverless Mode
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 15s 14.7s -280ms
nodeModulesSize 57.5 MB 57.5 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..7f47.js gzip 10.3 kB 10.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-7e72e5b..8b35.js gzip 7.2 kB 7.2 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.15 kB 6.15 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-e35d22e..dule.js gzip 6.24 kB 6.24 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.1 kB 52.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-28298..e0c9.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-000f151..65d4.js gzip 1.29 kB 1.29 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.69 kB 7.69 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-65c8a..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-4cfda7a..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.35 kB 5.35 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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 HsuTing/next.js fix-relay-network-request Change
_error.js 1.03 MB 1.03 MB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.03 MB 1.03 MB
link.js 1.07 MB 1.07 MB
routerDirect.js 1.07 MB 1.07 MB
withRouter.js 1.07 MB 1.07 MB
Overall change 5.28 MB 5.28 MB
Commit: 3c69ecd

@ijjk
Copy link
Member

ijjk commented Aug 25, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 11.9s 12s ⚠️ +60ms
nodeModulesSize 57.5 MB 57.5 MB
Page Load Tests Overall increase ✓
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
/ failed reqs 0 0
/ total time (seconds) 2.174 2.168 -0.01
/ avg req/sec 1150.2 1153.14 +2.94
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.268 1.26 -0.01
/error-in-render avg req/sec 1971.62 1984.61 +12.99
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..7f47.js gzip 10.3 kB 10.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-1338f54..276e.js gzip 7.2 kB 7.2 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.15 kB 6.15 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-1455da7..dule.js gzip 6.24 kB 6.24 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.1 kB 52.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-28298..e0c9.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-000f151..65d4.js gzip 1.29 kB 1.29 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.69 kB 7.69 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-65c8a..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-4cfda7a..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.35 kB 5.35 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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 HsuTing/next.js fix-relay-network-request Change
index.html gzip 948 B 948 B
link.html gzip 954 B 954 B
withRouter.html gzip 940 B 940 B
Overall change 2.84 kB 2.84 kB

Serverless Mode
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 13.7s 13.5s -212ms
nodeModulesSize 57.5 MB 57.5 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..7f47.js gzip 10.3 kB 10.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-1338f54..276e.js gzip 7.2 kB 7.2 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.15 kB 6.15 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-1455da7..dule.js gzip 6.24 kB 6.24 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.1 kB 52.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-28298..e0c9.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-000f151..65d4.js gzip 1.29 kB 1.29 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.69 kB 7.69 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-65c8a..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-4cfda7a..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.35 kB 5.35 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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 HsuTing/next.js fix-relay-network-request Change
_error.js 1.03 MB 1.03 MB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.03 MB 1.03 MB
link.js 1.07 MB 1.07 MB
routerDirect.js 1.07 MB 1.07 MB
withRouter.js 1.07 MB 1.07 MB
Overall change 5.28 MB 5.28 MB
Commit: 37b97d3

@HsuTing HsuTing changed the title Fix relay network request [Example] Fix relay network request Aug 25, 2020
@ijjk
Copy link
Member

ijjk commented Sep 1, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 12.8s 12.9s ⚠️ +146ms
nodeModulesSize 55.9 MB 55.9 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
/ failed reqs 0 0
/ total time (seconds) 2.282 2.32 ⚠️ +0.04
/ avg req/sec 1095.65 1077.55 ⚠️ -18.1
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.321 1.33 ⚠️ +0.01
/error-in-render avg req/sec 1891.85 1879.08 ⚠️ -12.77
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..9ff9.js gzip 10.3 kB 10.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-2db3d72..5955.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.13 kB 6.13 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-d7fe688..dule.js gzip 6.41 kB 6.41 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-ae98065..267e.js gzip 1.29 kB 1.29 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.69 kB 7.69 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-cb244c4..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.35 kB 5.35 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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 HsuTing/next.js fix-relay-network-request Change
index.html gzip 971 B 971 B
link.html gzip 976 B 976 B
withRouter.html gzip 964 B 964 B
Overall change 2.91 kB 2.91 kB

Serverless Mode
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 14.5s 14.9s ⚠️ +410ms
nodeModulesSize 55.9 MB 55.9 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..9ff9.js gzip 10.3 kB 10.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-2db3d72..5955.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.13 kB 6.13 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-d7fe688..dule.js gzip 6.41 kB 6.41 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-ae98065..267e.js gzip 1.29 kB 1.29 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.69 kB 7.69 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-cb244c4..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.35 kB 5.35 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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 HsuTing/next.js fix-relay-network-request Change
_error.js 1.03 MB 1.03 MB
404.html 4.22 kB 4.22 kB
hooks.html 3.86 kB 3.86 kB
index.js 1.03 MB 1.03 MB
link.js 1.07 MB 1.07 MB
routerDirect.js 1.07 MB 1.07 MB
withRouter.js 1.07 MB 1.07 MB
Overall change 5.28 MB 5.28 MB
Commit: 32e0e62

@ijjk
Copy link
Member

ijjk commented Sep 1, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 13.2s 13.8s ⚠️ +574ms
nodeModulesSize 55.9 MB 55.9 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
/ failed reqs 0 0
/ total time (seconds) 2.474 2.537 ⚠️ +0.06
/ avg req/sec 1010.65 985.51 ⚠️ -25.14
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.575 1.617 ⚠️ +0.04
/error-in-render avg req/sec 1587.64 1546.06 ⚠️ -41.58
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..9ff9.js gzip 10.3 kB 10.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-2db3d72..5955.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.13 kB 6.13 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-d7fe688..dule.js gzip 6.41 kB 6.41 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-ae98065..267e.js gzip 1.29 kB 1.29 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.69 kB 7.69 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-cb244c4..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.35 kB 5.35 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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 HsuTing/next.js fix-relay-network-request Change
index.html gzip 971 B 971 B
link.html gzip 976 B 976 B
withRouter.html gzip 964 B 964 B
Overall change 2.91 kB 2.91 kB

Serverless Mode
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 14.8s 15.6s ⚠️ +745ms
nodeModulesSize 55.9 MB 55.9 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..9ff9.js gzip 10.3 kB 10.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-2db3d72..5955.js gzip 7.35 kB 7.35 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.13 kB 6.13 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-d7fe688..dule.js gzip 6.41 kB 6.41 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-ae98065..267e.js gzip 1.29 kB 1.29 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.69 kB 7.69 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-cb244c4..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.35 kB 5.35 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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 HsuTing/next.js fix-relay-network-request Change
_error.js 1.03 MB 1.03 MB
404.html 4.22 kB 4.22 kB
hooks.html 3.86 kB 3.86 kB
index.js 1.03 MB 1.03 MB
link.js 1.07 MB 1.07 MB
routerDirect.js 1.07 MB 1.07 MB
withRouter.js 1.07 MB 1.07 MB
Overall change 5.28 MB 5.28 MB
Commit: b316afe

lfades
lfades previously approved these changes Sep 1, 2020
Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

@HsuTing Hi there thank you for the PR!

Everything looks good to me. There's something that's not really an issue with the current example but may be for someone wanting to test out the loading and error state on pages:

If I remove getStaticProps the page should show a loading state and then the data, that's happening as expected but the page generated in the server (Node.js) is producing an error due to missing data (lib/createEnvironment/server.js).

Timer
Timer previously requested changes Sep 1, 2020
Copy link
Member

@Timer Timer left a comment

Choose a reason for hiding this comment

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

Temporarily blocking to get a stable out

@HsuTing
Copy link
Contributor Author

HsuTing commented Sep 2, 2020

@lfades I had modified lib/createEnvironment/server.js for your issue. Maybe you can try again?
@Timer Should I need to fix something?

@ijjk
Copy link
Member

ijjk commented Sep 2, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 12.4s 12.6s ⚠️ +220ms
nodeModulesSize 55.9 MB 55.9 MB
Page Load Tests Overall increase ✓
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
/ failed reqs 0 0
/ total time (seconds) 2.239 2.235 0
/ avg req/sec 1116.67 1118.77 +2.1
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.198 1.186 -0.01
/error-in-render avg req/sec 2087.54 2107.97 +20.43
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..01b7.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39 kB 39 kB
main-f8f2cfe..033f.js gzip 7.1 kB 7.1 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.39 kB 6.39 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-a6f8e84..dule.js gzip 6.16 kB 6.16 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
index.html gzip 972 B 972 B
link.html gzip 977 B 977 B
withRouter.html gzip 964 B 964 B
Overall change 2.91 kB 2.91 kB

Serverless Mode
General
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
buildDuration 14s 13.8s -144ms
nodeModulesSize 55.9 MB 55.9 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..01b7.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39 kB 39 kB
main-f8f2cfe..033f.js gzip 7.1 kB 7.1 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.3 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
677f882d2ed8..dule.js gzip 6.39 kB 6.39 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-a6f8e84..dule.js gzip 6.16 kB 6.16 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary HsuTing/next.js fix-relay-network-request 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-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles
vercel/next.js canary HsuTing/next.js fix-relay-network-request Change
_error.js 1.03 MB 1.03 MB
404.html 4.22 kB 4.22 kB
hooks.html 3.86 kB 3.86 kB
index.js 1.03 MB 1.03 MB
link.js 1.08 MB 1.08 MB
routerDirect.js 1.07 MB 1.07 MB
withRouter.js 1.07 MB 1.07 MB
Overall change 5.29 MB 5.29 MB
Commit: 353017a

@ijjk
Copy link
Member

ijjk commented Sep 2, 2020

Failing test suites

Commit: 353017a

test/integration/cli/test/index.test.js

  • CLI Usage > dev > NODE_OPTIONS='--inspect'
Expand output

● CLI Usage › dev › NODE_OPTIONS='--inspect'

expect(received).toMatch(expected)

Matcher error: received value must be a string

Received has value: undefined

  122 |         env: { NODE_OPTIONS: '--inspect' },
  123 |       })
> 124 |       expect(output).toMatch(new RegExp(`http://localhost:${port}`))
      |                      ^
  125 |     })
  126 | 
  127 |     test('-p', async () => {

  at Object.<anonymous> (integration/cli/test/index.test.js:124:22)

@lfades lfades dismissed Timer’s stale review September 2, 2020 19:30

Stable release is out

Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

@HsuTing Everything is good now, thank you!

@lfades lfades merged commit 0649176 into vercel:canary Sep 2, 2020
@HsuTing HsuTing deleted the fix-relay-network-request branch September 3, 2020 01:14
HitoriSensei pushed a commit to HitoriSensei/next.js that referenced this pull request Sep 26, 2020
* fix(with-react-relay-network-modern): fix README.md typo error

* fix(with-react-relay-network-modern): should not use store cache for create environment

* fix(with-react-relay-network-modern): should not request api again

* feat(with-react-relay-network-modern): add relay-hooks package

* feat(with-react-relay-network-modern): use new RelayEnvironmentProvider

* feat(with-react-relay-network-modern): add useQuery hook

* fix(with-react-relay-network-modern): fix cache error

* fix(with-react-relay-network-modern): fix server loading

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants