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

Fix cms-wordpress preview mode for post revisions #14911

Merged
merged 2 commits into from Jul 7, 2020

Conversation

tomasztunik
Copy link
Contributor

Preview of existing posts should always return the latest revision so DESC sorting was required. Otherwise, it would always return the oldest revision.

Tested against latest Wordpress and GraphQL plugins on drafts, published, and edited but unpublished changes. The example works great!

Preview of existing posts should always return the latest revision so DESC sorting was required. Otherwise, it would always return the oldest revision.

Tested against latest Wordpress and GraphQL plugins on drafts, published, and edited but unpublished changes. The example works great!
@ijjk ijjk added the examples Issue/PR related to examples label Jul 7, 2020
@ijjk
Copy link
Member

ijjk commented Jul 7, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary tomasztunik/next.js patch-1 Change
buildDuration 9.7s 9.7s -11ms
nodeModulesSize 66.1 MB 66.1 MB
Page Load Tests Overall increase ✓
vercel/next.js canary tomasztunik/next.js patch-1 Change
/ failed reqs 0 0
/ total time (seconds) 1.642 1.681 ⚠️ +0.04
/ avg req/sec 1522.42 1487.06 ⚠️ -35.36
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.013 0.967 -0.05
/error-in-render avg req/sec 2468.97 2584.34 +115.37
Client Bundles (main, webpack, commons)
vercel/next.js canary tomasztunik/next.js patch-1 Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..c646.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary tomasztunik/next.js patch-1 Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary tomasztunik/next.js patch-1 Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary tomasztunik/next.js patch-1 Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes
vercel/next.js canary tomasztunik/next.js patch-1 Change
index.html gzip 954 B 954 B
link.html gzip 960 B 960 B
withRouter.html gzip 945 B 945 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary tomasztunik/next.js patch-1 Change
buildDuration 10.6s 10.7s ⚠️ +46ms
nodeModulesSize 66.1 MB 66.1 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary tomasztunik/next.js patch-1 Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..c646.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary tomasztunik/next.js patch-1 Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary tomasztunik/next.js patch-1 Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary tomasztunik/next.js patch-1 Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles
vercel/next.js canary tomasztunik/next.js patch-1 Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 877 kB 877 kB
link.js 915 kB 915 kB
routerDirect.js 909 kB 909 kB
withRouter.js 909 kB 909 kB
Overall change 4.49 MB 4.49 MB
Commit: ed86fcb

Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

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

Makes sense 👍

@ijjk
Copy link
Member

ijjk commented Jul 7, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary tomasztunik/next.js patch-1 Change
buildDuration 10.8s 10.4s -396ms
nodeModulesSize 66.1 MB 66.1 MB
Page Load Tests Overall increase ✓
vercel/next.js canary tomasztunik/next.js patch-1 Change
/ failed reqs 0 0
/ total time (seconds) 1.772 1.715 -0.06
/ avg req/sec 1410.59 1458.03 +47.44
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.022 1.028 ⚠️ +0.01
/error-in-render avg req/sec 2446.53 2431.72 ⚠️ -14.81
Client Bundles (main, webpack, commons)
vercel/next.js canary tomasztunik/next.js patch-1 Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..c646.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary tomasztunik/next.js patch-1 Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary tomasztunik/next.js patch-1 Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary tomasztunik/next.js patch-1 Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes
vercel/next.js canary tomasztunik/next.js patch-1 Change
index.html gzip 954 B 954 B
link.html gzip 960 B 960 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary tomasztunik/next.js patch-1 Change
buildDuration 11.6s 11.5s -79ms
nodeModulesSize 66.1 MB 66.1 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary tomasztunik/next.js patch-1 Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..c646.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary tomasztunik/next.js patch-1 Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary tomasztunik/next.js patch-1 Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary tomasztunik/next.js patch-1 Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles
vercel/next.js canary tomasztunik/next.js patch-1 Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 877 kB 877 kB
link.js 915 kB 915 kB
routerDirect.js 909 kB 909 kB
withRouter.js 909 kB 909 kB
Overall change 4.49 MB 4.49 MB
Commit: b8198b4

@kodiakhq kodiakhq bot merged commit 015898e into vercel:canary Jul 7, 2020
@tomasztunik tomasztunik deleted the patch-1 branch July 7, 2020 11:20
rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
Preview of existing posts should always return the latest revision so DESC sorting was required. Otherwise, it would always return the oldest revision.

Tested against latest Wordpress and GraphQL plugins on drafts, published, and edited but unpublished changes. The example works great!
@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

3 participants