Skip to content

feat(hmr): truncate list of files on hmr update - #21535

Merged
sapphi-red merged 2 commits into
mainfrom
arnaud/hmr-truncate
Apr 2, 2026
Merged

sapphi-red merged 2 commits into
mainfrom
arnaud/hmr-truncate

Conversation

@ArnaudBarre

Copy link
Copy Markdown
Member

It's been a long time since I wanted to do this. When I ran the codegen on my project, all the React files which imports the DB enums from it updates and the terminal a just a wall of useless text. I think truncating at 10 is a good tradeoff.

I can add a test in the hmr playground, but I'm not sure it's worth the 12 files to setup it up given how simple the code is.

Before:
Screenshot 2026-02-01 at 13 06 58

After:
Screenshot 2026-02-01 at 13 09 19

@ArnaudBarre ArnaudBarre self-assigned this Feb 1, 2026
Comment thread packages/vite/src/node/utils.ts Resolved

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with 10, I think it could be quite long though if the file paths are really long for some projects. Maybe we should truncate it by checking the string length instead?

Also, I think we should also debug log the remaining file paths as it may be useful for debugging HMR issues.

@ArnaudBarre
ArnaudBarre force-pushed the arnaud/hmr-truncate branch from 8c2398a to 1970e7e Compare March 29, 2026 18:13
Comment thread packages/vite/src/node/utils.ts Resolved
@ArnaudBarre
ArnaudBarre force-pushed the arnaud/hmr-truncate branch from af1f031 to 1adad15 Compare March 29, 2026 18:53
@ArnaudBarre
ArnaudBarre requested a review from bluwy March 29, 2026 18:54
@sapphi-red sapphi-red added feat: hmr p2-nice-to-have Not breaking anything but nice to have (priority) labels Apr 2, 2026
@sapphi-red
sapphi-red merged commit d00e806 into main Apr 2, 2026
@sapphi-red
sapphi-red deleted the arnaud/hmr-truncate branch April 2, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: hmr p2-nice-to-have Not breaking anything but nice to have (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants