Skip to content

fix: debounce fs route hmr events, avoid reload for existing routes#2174

Open
katywings wants to merge 2 commits into
mainfrom
fix-fs-route-hmr
Open

fix: debounce fs route hmr events, avoid reload for existing routes#2174
katywings wants to merge 2 commits into
mainfrom
fix-fs-route-hmr

Conversation

@katywings

@katywings katywings commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What is the current behavior?

  • When starting the server, multiple reloads and invalidations are triggered per added route
  • When renaming routes, multiple reloads and invalidations are triggered (file rename = "remove file + add file")
  • When just changing an existing route, it still triggers a full client reload
Screencast_20260704_131753.mp4

What is the new behavior?

  • Reloads and invalidations are debounced
  • Changing an existing valid route triggers a soft HMR, no client reload
  • Adding a default export to an existing invalid route file, adds the route and reloads the client
  • Removing a default export from an existing valid route file, removes the route and reloads the client
Screencast_20260704_131925.mp4

Other information

From what I can tell the route HMR has been broken atleast since #2125. I tried to make sure that I didn't introduce a regression. The routes graph is still updated when adding new files.

@changeset-bot

changeset-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a5a3cdd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify

netlify Bot commented Jul 4, 2026

Copy link
Copy Markdown

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit a5a3cdd
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a493a845d6cf400087f8cb4
😎 Deploy Preview https://deploy-preview-2174--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Jul 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/start@2174
npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/vite-plugin-nitro-2@2174

commit: a5a3cdd

@katywings katywings marked this pull request as ready for review July 4, 2026 16:57
@katywings katywings changed the title WIP: fix: debounce fs route hmr events, avoid reload for existing routes fix: debounce fs route hmr events, avoid reload for existing routes Jul 4, 2026

/**
* Debounce catches multiple route changes in a row
* Short timeout for inexpensive invalidations11

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.

"11"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants