mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
#### improve export spinner update at least once a minute in non-tty update progress regularly when using the spinner decrease frequency of the spinner (windows console output is expensive) #### restart static page generation and collecting page data worker pools when hanging when for 1 minute no activity happens on the worker pool, restart it log a warning for hanging jobs #### add page generation duration to summary tree  for `[+n more pages]` is will show `(avg 321 ms)` when the average is over the threshold. It will allocate 8 lines for preview pages (instead of 4) when they contain slow pages ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [x] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes
35 lines
789 B
JavaScript
35 lines
789 B
JavaScript
export default ({ renderDuration }) => {
|
|
const target = Date.now() + (+renderDuration || 200)
|
|
while (Date.now() < target);
|
|
return <div>{renderDuration}</div>
|
|
}
|
|
|
|
export function getStaticPaths() {
|
|
return {
|
|
paths: [
|
|
[2000, 10],
|
|
[5, 5],
|
|
[25, 25],
|
|
[20, 20],
|
|
[10, 10],
|
|
[15, 15],
|
|
[15, 10],
|
|
[10, 10],
|
|
[300, 10],
|
|
[10, 1000],
|
|
].map(([propsDuration, renderDuration]) => ({
|
|
params: {
|
|
renderDuration: `${renderDuration}`,
|
|
propsDuration: `${propsDuration}`,
|
|
},
|
|
})),
|
|
fallback: true,
|
|
}
|
|
}
|
|
|
|
export async function getStaticProps({ params }) {
|
|
const { renderDuration, propsDuration } = params
|
|
await new Promise((r) => setTimeout(r, +propsDuration))
|
|
return { props: { renderDuration } }
|
|
}
|