forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning for large amount of page data (vercel#29956)
Co-authored-by: Steven <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
08879b6
commit a25c1dd
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Large Page Data | ||
|
||
#### Why This Error Occurred | ||
|
||
One of your pages includes a large amount of page data (>= 128KB). This can negatively impact performance since page data must be parsed by the client before the page is hydrated. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
Reduce the amount of data returned from `getStaticProps`, `getServerSideProps`, or `getInitialProps` to only the essential data to render the page. | ||
|
||
### Useful Links | ||
|
||
- [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching) |
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react' | ||
import Link from 'next/link' | ||
|
||
export async function getStaticProps({ params }) { | ||
return { | ||
props: { | ||
lotsOfData: new Array(128 * 1000).fill('a').join(''), | ||
}, | ||
revalidate: false, | ||
} | ||
} | ||
|
||
export default (props) => { | ||
return ( | ||
<> | ||
<p>lots of data returned</p> | ||
<Link href="/"> | ||
<a id="home">to home</a> | ||
</Link> | ||
<br /> | ||
<Link href="/another"> | ||
<a id="another">to another</a> | ||
</Link> | ||
</> | ||
) | ||
} |