-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support Remix HMR v2 #1187
Support Remix HMR v2 #1187
Conversation
This comment has been minimized.
This comment has been minimized.
How did you test it? These errors appear only when you stop the dev server so it might be unrelated to the problem you were seeing. For example, if you go to |
All working well for me. The refresh was due to the dev:pkg command not running properly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments. Looks good to me though.
import('@remix-run/dev/dist/devServer_unstable/hmr.js'), | ||
import('@remix-run/dev/dist/devServer_unstable/socket.js'), | ||
import('@remix-run/dev/dist/devServer_unstable/hdr.js'), | ||
import('@remix-run/dev/dist/result.js'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these other dependencies from Remix that we are hoping have unofficially stabilized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but kind of hoping that this whole live-reload
logic, or something similar, can be added to Remix. It's basically an abstraction that we could import. But the devServer_unstable
is still changing so we'll need to wait.
Like, most of this code comes from Remix itself, it's just mixed with other things there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we need to revive the conversation with them around these internal apis.
const loaderChanges = await state.loaderChanges!; | ||
if (loaderChanges.ok) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume there's not a scenario where loaderChanges
is undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be, no. This comes from Remix: https://github.com/remix-run/remix/blob/1d3d86eaceb7784c56d34d963310ecbcb8c9637a/packages/remix-dev/devServer_unstable/index.ts#L221
); | ||
} else if (state.prevManifest) { | ||
// Full reload | ||
socket.reload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work, a full page reload? Why should this trigger here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Basically, there has been a change in the app but we can't track the change for some reason. Therefore, a full reload is the only option.
Continues #652
Closes #886