-
Hello, We are using I was reading through the thread for #6030 where I tried adding this to my config in hopes it can speed up these specific pages that are slow. However when restarting the dev server with this option set to An example of one of these errors are
I tried adding:
To my vite config, however for every dependency I add, the same error will pop up for another peer dependency until I add every dependency to Has anyone been able to work through the slow hmr reloads and get the fast reload times back on components that are slow? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Upon further investigation it looks like when I made a change on one of the pages it reloads ALL of the source files in my project even those unrelated to the change I made. Are we required to lazy load every single component in our application? Currently we only lazy load the 'pages' that our router points to. The Pages contain the components we manage and generally just have a div in them for positioning the content. Fresh runs take about 10min and hot reloads take around 3 min. EDIT: Using React dev tools and 'why did I rerender' I ultimately discovered that the way I was passing props down the tree was causing these long reloads. I was following a pattern where each component sits in a directory next to an
Instead, I switched to making the Component the default export from the directory and stopped bundling them all in to The last change I made was how I was calling apis in my components. I noticed that each hot-reload required another network call. By decoupling the api calls to a Provider component towards the top of my tree, I was able to achieve the very fast hot-reloads again. graph TD
P[Page] --> p[State Provider]
p -->|Network Response| Component1
p -->|Network Response| Component2
p --> ComponentN
|
Beta Was this translation helpful? Give feedback.
Upon further investigation it looks like when I made a change on one of the pages it reloads ALL of the source files in my project even those unrelated to the change I made.
Are we required to lazy load every single component in our application? Currently we only lazy load the 'pages' that our router points to. The Pages contain the components we manage and generally just have a div in them for positioning the content.
Fresh runs take about 10min and hot reloads take around 3 min.
EDIT:
Using React dev tools and 'why did I rerender' I ultimately discovered that the way I was passing props down the tree was causing these long reloads.
I was following a pattern where each component sits in …