In dev mode, when navigating from e.g index page to page B, it will then after a while destroy the index page: Disposing inactive page(s): /. Why not keeping it in memory, at least as long as there aren't too many pages built?
Rather than disposing on timeout, it appears better to me to dispose pages when there are too many of them in memory.
This would allow to then have fast client-side transitions (after the first load), which allows to have a feel of these transitions without needing to deploy to prod.
"too many pages" is kind a hard to decide.
What we can do is to provide an option on asking how many pages to buffer in the memory.
I like that and we can default that to 2.
Disabling for disposing pages can be reached by set maximum inactive age to infinite time.
module.exports = {
onDemandEntries: {
// Make sure entries are not getting disposed.
maxInactiveAge: 1000 * 60 * 60
},
// ....
}
But ability for disable HMR totally for development mode by config will be very useful. If everyone knows solution for this problem, which does not require implicit patching next.js source code, please answer here :)
@timneutkens could maybe comment on why this was closed?
@sedubois inactivity. I went through all inactive issues.
This problem also bother me. Is there any solution recently? thanks.
has anything changed related to this issue so far?
@kunokdev it's configurable now in v4 beta https://github.com/zeit/next.js#configuring-the-ondemandentries
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.
Most helpful comment
@kunokdev it's configurable now in v4 beta https://github.com/zeit/next.js#configuring-the-ondemandentries