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

[Examples] Move with-apollo to SSG #13742

Merged
merged 19 commits into from
Jun 5, 2020
Merged

Conversation

lfades
Copy link
Member

@lfades lfades commented Jun 4, 2020

Based on #13607 - I created a new PR as I can't push changes to the initial PR.

Migrated the Apollo client to use SSG, also removed the link to the live demo because I don't know who the owner is or how to update the deployment.

The implementation is pretty simple and will be added to all the other Apollo examples

@lfades lfades changed the title Update with-apollo example [Examples] Move with-apollo to SSG Jun 4, 2020
@ijjk
Copy link
Member

ijjk commented Jun 4, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 13.4s 13.1s -254ms
nodeModulesSize 66 MB 66 MB
Page Load Tests Overall increase ✓
vercel/next.js canary lfades/next.js ssg/with-apollo Change
/ failed reqs 0 0
/ total time (seconds) 2.402 2.332 -0.07
/ avg req/sec 1040.66 1071.9 ⚠️ +31.24
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.477 1.434 -0.04
/error-in-render avg req/sec 1692.22 1742.88 ⚠️ +50.66
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.59 kB 6.59 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.67 kB 5.67 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
vercel/next.js canary lfades/next.js ssg/with-apollo Change
index.html gzip 924 B 924 B
link.html gzip 934 B 934 B
withRouter.html gzip 922 B 922 B
Overall change 2.78 kB 2.78 kB

Serverless Mode
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 14.3s 14.5s ⚠️ +212ms
nodeModulesSize 66 MB 66 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.59 kB 6.59 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.67 kB 5.67 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_error.js 878 kB 878 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.81 kB 3.81 kB
index.js 879 kB 879 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 909 kB 909 kB
Overall change 4.5 MB 4.5 MB

@adamsoffer
Copy link
Contributor

adamsoffer commented Jun 4, 2020

@lfades Super excited to see this example get updated. FYI I'm the owner of the next-with-apollo.now.sh deployment (it's deployed to vercel) and I can update it once this is merged if we want to keep the live demo in the README.

@adamsoffer
Copy link
Contributor

Also, we should probably use incremental builds in this example. Right now if you submit a post and refresh the page it's gone.

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

ijjk commented Jun 4, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 11.7s 11.5s -174ms
nodeModulesSize 66 MB 66 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary lfades/next.js ssg/with-apollo Change
/ failed reqs 0 0
/ total time (seconds) 1.942 1.976 ⚠️ +0.03
/ avg req/sec 1287.14 1265.42 -21.72
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.069 1.124 ⚠️ +0.06
/error-in-render avg req/sec 2339.56 2225.11 -114.45
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
vercel/next.js canary lfades/next.js ssg/with-apollo Change
index.html gzip 925 B 925 B
link.html gzip 935 B 935 B
withRouter.html gzip 923 B 923 B
Overall change 2.78 kB 2.78 kB

Serverless Mode
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 12.8s 12.7s -118ms
nodeModulesSize 66 MB 66 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_error.js 878 kB 878 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.81 kB 3.81 kB
index.js 878 kB 878 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 909 kB 909 kB
Overall change 4.5 MB 4.5 MB

@lfades
Copy link
Member Author

lfades commented Jun 4, 2020

@adamsoffer It's ready now, can you check it out and then update the deployment 🙏

@ijjk
Copy link
Member

ijjk commented Jun 4, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 10.1s 10.9s ⚠️ +787ms
nodeModulesSize 66 MB 66 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary lfades/next.js ssg/with-apollo Change
/ failed reqs 0 0
/ total time (seconds) 1.788 1.852 ⚠️ +0.06
/ avg req/sec 1398.08 1349.64 -48.44
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.121 1.23 ⚠️ +0.11
/error-in-render avg req/sec 2230.27 2032.34 -197.93
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
vercel/next.js canary lfades/next.js ssg/with-apollo Change
index.html gzip 925 B 925 B
link.html gzip 935 B 935 B
withRouter.html gzip 923 B 923 B
Overall change 2.78 kB 2.78 kB

Serverless Mode
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 12.4s 12.6s ⚠️ +173ms
nodeModulesSize 66 MB 66 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_error.js 878 kB 878 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.81 kB 3.81 kB
index.js 878 kB 878 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 909 kB 909 kB
Overall change 4.5 MB 4.5 MB

@adamsoffer
Copy link
Contributor

@lfades done 👍

I notice that after you submit a post you have to refresh the page twice to see reflected in the UI. I understand why this is (the first time you refresh it invalidates the cache and the second time it serves the newly built page) but I'm curious, how would we go about improving this example so that it displays the newly submitted post after a single refresh?

@lfades
Copy link
Member Author

lfades commented Jun 4, 2020

@adamsoffer One of the things we're going to release is the possibility to revalidate pages manually, that should address this case and many others.

@adamsoffer
Copy link
Contributor

@lfades awesome.

@ijjk
Copy link
Member

ijjk commented Jun 5, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 12.7s 13s ⚠️ +238ms
nodeModulesSize 66 MB 66 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary lfades/next.js ssg/with-apollo Change
/ failed reqs 0 0
/ total time (seconds) 2.335 2.273 -0.06
/ avg req/sec 1070.46 1099.74 ⚠️ +29.28
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.384 1.463 ⚠️ +0.08
/error-in-render avg req/sec 1806.17 1708.58 -97.59
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
vercel/next.js canary lfades/next.js ssg/with-apollo Change
index.html gzip 925 B 925 B
link.html gzip 935 B 935 B
withRouter.html gzip 923 B 923 B
Overall change 2.78 kB 2.78 kB

Serverless Mode
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 13.9s 13.8s -148ms
nodeModulesSize 66 MB 66 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_error.js 878 kB 878 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.81 kB 3.81 kB
index.js 878 kB 878 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 909 kB 909 kB
Overall change 4.5 MB 4.5 MB

@adamsoffer
Copy link
Contributor

@lfades thoughts on just adding fetch('/') after createPost() until that release? That invalidates the cache immediately after creating a post.

@Timer Timer added this to the 9.4.5 milestone Jun 5, 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.

LGTM, I trust you that this works.

@ijjk
Copy link
Member

ijjk commented Jun 5, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 11.5s 11.2s -351ms
nodeModulesSize 66 MB 66 MB
Page Load Tests Overall increase ✓
vercel/next.js canary lfades/next.js ssg/with-apollo Change
/ failed reqs 0 0
/ total time (seconds) 2.006 1.955 -0.05
/ avg req/sec 1245.98 1278.71 ⚠️ +32.73
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.141 1.144 0
/error-in-render avg req/sec 2191.88 2185.67 -6.21
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
vercel/next.js canary lfades/next.js ssg/with-apollo Change
index.html gzip 925 B 925 B
link.html gzip 935 B 935 B
withRouter.html gzip 923 B 923 B
Overall change 2.78 kB 2.78 kB

Serverless Mode
General
vercel/next.js canary lfades/next.js ssg/with-apollo Change
buildDuration 12.6s 12.5s -82ms
nodeModulesSize 66 MB 66 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary lfades/next.js ssg/with-apollo 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 lfades/next.js ssg/with-apollo Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles
vercel/next.js canary lfades/next.js ssg/with-apollo Change
_error.js 878 kB 878 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.81 kB 3.81 kB
index.js 878 kB 878 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 909 kB 909 kB
Overall change 4.5 MB 4.5 MB

@kodiakhq kodiakhq bot merged commit 2d2c762 into vercel:canary Jun 5, 2020
@pix2D
Copy link

pix2D commented Jun 8, 2020

@lfades Shouldn't an example called with-apollo also showcase SSR and not just SSG?

kodiakhq bot pushed a commit that referenced this pull request Jun 9, 2020
@jpedroschmitz
Copy link
Contributor

@pix2D, this example was updated so you can use SSR and SSG. You just need to replace the getStaticProps method to getServerSideProps.

@lfades comment about it

@pix2D
Copy link

pix2D commented Jun 16, 2020

@jpedroschmitz Ah apologies, I did not get to that conclusion from looking at the demo mainly because I didn't see getDataFromTree anywhere. Will test it out.

@willwill96
Copy link

@jpedroschmitz It seems like in this approach, you need to know all of the queries ahead of time in order to make SSR/SSG work. Is this intentional? I really liked how with the old withApollo higher order component, it would automatically traverse the app tree and figure out the queries needed to run for you. If you have numerous components with different queries on your page, it seems like it would be extremely tedious and would go against React's dynamic nature to need to put those queries in both places. Maybe I am misunderstanding something though.

rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
Based on vercel#13607 - I created a new PR as I can't push changes to the initial PR.

Migrated the Apollo client to use SSG, also removed the link to the live demo because I don't know who the owner is or how to update the deployment.

The implementation is pretty simple and will be added to all the other Apollo examples
rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
@TheRusskiy
Copy link
Contributor

TheRusskiy commented Nov 1, 2020

agree with @willwill96, IMHO this change is a step backward in terms of utility :-(
In my opinion getStaticProps support should come as an additional feature instead of the only feature.

@jesstelford
Copy link
Contributor

Here is the last commit containing the getInitialProps() version for those looking like I was.

@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.
Labels
examples Issue was opened via the examples template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants