-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Ensure isReady is set correctly for auto static dynamic route #20729
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
giriloou
approved these changes
Jan 4, 2021
giriloou
previously approved these changes
Jan 4, 2021
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
buildDuration | 10.7s | 10.6s | -112ms |
nodeModulesSize | 80.6 MB | 80.6 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.243 | 2.302 | |
/ avg req/sec | 1114.43 | 1086.21 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.564 | 1.58 | |
/error-in-render avg req/sec | 1597.96 | 1582.22 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
677f882d2ed8..42af.js gzip | 13 kB | 13 kB | |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-a9a6f0d..a96d.js gzip | 6.59 kB | 6.59 kB | ✓ |
webpack-50be..df5b.js gzip | 751 B | 751 B | ✓ |
Overall change | 59.3 kB | 59.3 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
polyfills-81..14d7.js gzip | 31.2 kB | 31.2 kB | ✓ |
Overall change | 31.2 kB | 31.2 kB | ✓ |
Client Pages
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
_app-b6fc6bc..222c.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-e2ffa..0f3f.js gzip | 3.46 kB | 3.46 kB | ✓ |
hooks-010c20..8411.js gzip | 887 B | 887 B | ✓ |
index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
link-705099c..c35d.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
_buildManifest.js gzip | 323 B | 323 B | ✓ |
Overall change | 323 B | 323 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
index.html gzip | 615 B | 615 B | ✓ |
link.html gzip | 621 B | 621 B | ✓ |
withRouter.html gzip | 607 B | 607 B | ✓ |
Overall change | 1.84 kB | 1.84 kB | ✓ |
Diffs
Diff for 677f882d2ed8..74ac63f42.js
@@ -1667,11 +1667,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.query = _query; // if auto prerendered and dynamic route wait to update asPath
// until after mount to prevent hydration mismatch
- this.asPath =
+ var autoExportDynamic =
(0, _isDynamic.isDynamicRoute)(_pathname) &&
- self.__NEXT_DATA__.autoExport
- ? _pathname
- : _as;
+ self.__NEXT_DATA__.autoExport;
+
+ this.asPath = autoExportDynamic ? _pathname : _as;
this.basePath = basePath;
this.sub = subscription;
this.clc = null;
@@ -1683,7 +1683,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isReady = !!(
self.__NEXT_DATA__.gssp ||
self.__NEXT_DATA__.gip ||
- !self.location.search
+ (!autoExportDynamic && !self.location.search)
);
if (false) {
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c8e4476148174ac63f42.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9902b2dd64f53b900612.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c8e4476148174ac63f42.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9902b2dd64f53b900612.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c8e4476148174ac63f42.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9902b2dd64f53b900612.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c8e4476148174ac63f42.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9902b2dd64f53b900612.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c8e4476148174ac63f42.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9902b2dd64f53b900612.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c8e4476148174ac63f42.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.9902b2dd64f53b900612.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
buildDuration | 13s | 12.6s | -352ms |
nodeModulesSize | 80.6 MB | 80.6 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
677f882d2ed8..42af.js gzip | 13 kB | N/A | N/A |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-a9a6f0d..a96d.js gzip | 6.59 kB | 6.59 kB | ✓ |
webpack-50be..df5b.js gzip | 751 B | 751 B | ✓ |
677f882d2ed8..396f.js gzip | N/A | 13 kB | N/A |
Overall change | 59.3 kB | 59.3 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
polyfills-81..14d7.js gzip | 31.2 kB | 31.2 kB | ✓ |
Overall change | 31.2 kB | 31.2 kB | ✓ |
Client Pages
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
_app-b6fc6bc..222c.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-e2ffa..0f3f.js gzip | 3.46 kB | 3.46 kB | ✓ |
hooks-010c20..8411.js gzip | 887 B | 887 B | ✓ |
index-bbee2f..528b.js gzip | 227 B | 227 B | ✓ |
link-705099c..c35d.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..bf84.js gzip | 303 B | 303 B | ✓ |
withRouter-a..5826.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.09 kB | 8.09 kB | ✓ |
Client Build Manifests
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
_buildManifest.js gzip | 323 B | 323 B | ✓ |
Overall change | 323 B | 323 B | ✓ |
Serverless bundles Overall increase ⚠️
vercel/next.js canary | ijjk/next.js router-ready/static-dynamic | Change | |
---|---|---|---|
_error.js | 1 MB | 1 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1 MB | 1 MB | ✓ |
link.js | 1.06 MB | 1.06 MB | |
routerDirect.js | 1.05 MB | 1.05 MB | |
withRouter.js | 1.05 MB | 1.05 MB | |
Overall change | 5.17 MB | 5.17 MB |
timneutkens
approved these changes
Jan 4, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #20628 this ensures
isReady
is not initially true when the query isn't present but the page is an automatically statically optimized dynamic route