-
Notifications
You must be signed in to change notification settings - Fork 27.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
[HMR] is extremely slow after v8.1.1-canary.25 update #7313
Comments
@xiaoyu-tamu Hi! I'm not able to reproduce this, so I'll need a bit more information. Are you using TypeScript? How large is your project? Can you provide a reproducible demo? |
Yes. I am using Typescript. It's a monorepo project, but I don't think it matters. |
The two videos below will show the time difference. Once file saved, the top left text will change. and the right side terminal will print compiling... From the two videos, you can see the canary 28 HMR time is longer than canary 24. My project has only 20 components and 5 pages right now. I cannot reproduce this when project size is small, ( with a single page and one div contain hello world text). 8.1.1 canary 24 video: https://www.youtube.com/watch?v=Q73v9UnvMmo&feature=youtu.be |
Thanks for the more information! Does this persist for every reload or only the first? Can you please share your project? |
I will try to make a minimal reproducible demo later. |
I wanted to echo @xiaoyu-tamu sentiment. I converted a project to typescript and found the HMR times increased dramatically. I can confidently say it happens on every reload. project: https://github.com/HorizonShadow/aa2gd/tree/develop |
It becomes slow because // next.config.js
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = {
webpack: config => {
config.plugins = config.plugins.filter(
plugin => !(plugin instanceof ForkTsCheckerWebpackPlugin),
);
return config;
},
}; |
@HorizonShadow the code you provided has no TypeScript. Can you please provide/point us to the TypeScript version? To reiterate: we cannot reproduce this and need a full reproduction to get it fixed. Thank you for your understanding. |
@Timer Sorry, I removed it due to too many issues. On top of it being slow, it wasn't reloading properly and was serving old components. https://github.com/HorizonShadow/aa2gd/tree/7e6a9ee0a0b52ce33bf5e0b11d1e95b02353b137 This is the latest version before I started removing it. |
@HorizonShadow it looks this is related to microsoft/TypeScript#30663 If you upgrade to the latest version of TypeScript the speed increases dramatically |
This seems to not work anymore with latest canary, did anything change? |
Why do we need This approach is described for example here: https://iamturns.com/typescript-babel/ |
I'm okay with having it (since the whole point of typescript is type safety and ForkTsCheckerWebpackPlugin is maximum level). But some people only want dev time linting, so some kind of configurable opt-out would be really cool. |
Hey @Timer 👋 - hot reloading doesn't work in my project either for some reason. I see the little triangle animation on the bottom right of the screen when I make changes, but nothing happens. I'm on the latest version of next and typescript. Any ideas? To reproduce:
|
ah nevermind. I found the culprit. For some reason, this provider breaks hot reloading: https://github.com/tokenfoundry/react-metamask |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
for 8.1.1-canary.24 release, HMR takes about 0.2 seconds on my 2016 MacBook pro.
for 8.1.1-canary.25~28 release, HMR takes about 1.0+ second on my 2016 MacBook pro.
To Reproduce
Expected behavior
HMR should stay fast.
System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: