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

Don't dispose previous pages in dev mode #1939

Closed
sedubois opened this issue May 11, 2017 · 8 comments
Closed

Don't dispose previous pages in dev mode #1939

sedubois opened this issue May 11, 2017 · 8 comments

Comments

@sedubois
Copy link
Contributor

@sedubois sedubois commented May 11, 2017

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.

@arunoda
Copy link
Contributor

@arunoda arunoda commented May 31, 2017

"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.

@IhostVlad
Copy link

@IhostVlad IhostVlad commented Jul 4, 2017

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 :)

@sedubois
Copy link
Contributor Author

@sedubois sedubois commented Jul 4, 2017

@timneutkens could maybe comment on why this was closed?

@timneutkens
Copy link
Member

@timneutkens timneutkens commented Jul 4, 2017

@sedubois inactivity. I went through all inactive issues.

@tz5514
Copy link

@tz5514 tz5514 commented Jul 16, 2017

This problem also bother me. Is there any solution recently? thanks.

AugustinLF pushed a commit to AugustinLF/next.js that referenced this issue Jul 18, 2017
AugustinLF pushed a commit to AugustinLF/next.js that referenced this issue Aug 7, 2017
AugustinLF pushed a commit to AugustinLF/next.js that referenced this issue Aug 7, 2017
timneutkens pushed a commit that referenced this issue Sep 28, 2017
* Keep some buffered pages, that won't be disposed. Fix #1939

* With reworked buffer
arunoda added a commit that referenced this issue Sep 28, 2017
arunoda added a commit that referenced this issue Sep 28, 2017
arunoda added a commit that referenced this issue Sep 28, 2017
* Revert "Keep some buffered pages, that won't be disposed. Fix #1939 (#2592)"

This reverts commit 3643612.

* Revert "Add beta installation instruction"

This reverts commit 418cc21.

* Revert "4.0.0-beta.1"

This reverts commit c2d98e2.

* Revert "Treat navigation to empty hash as hash navigate (#2971)"

This reverts commit c6bd6ef.

* Revert "React 16 (fiber) (#2996)"

This reverts commit d19cc97.
@kunokdev
Copy link

@kunokdev kunokdev commented Oct 5, 2017

has anything changed related to this issue so far?

@timneutkens
Copy link
Member

@timneutkens timneutkens commented Oct 5, 2017

@kunokdev it's configurable now in v4 beta https://github.com/zeit/next.js#configuring-the-ondemandentries

@lock
Copy link

@lock lock bot commented May 10, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants