Replies: 1 comment 2 replies
-
The If they see the value in it, then it may end up in Remix core. But while you wait, you still have working code that solves your needs. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As far as I know, currently, there's no way to know when an HMR update happens other than creating your own websocket connection to the dev server (duplicating what the LiveReload component does).
One use case for that would be reloading i18n translation files. If you use i18n in Remix, you have to reload the page after modifying the translations to see the change. Simply adding those files to watched files and relying on HMR doesn't work here, because you need to let i18n know to reload the translations.
Proposal
Add
config
prop toLiveReload
component that let's you pass an onMessage hook, that will get called on HMR update.I'm happy to make the PR (it's a fairly straightforward change), however, I starting this discussion to see if you'd be open to that change and get your thoughts on what this API could look like. In particular, should it be just one generic hook (onMessage), or something more granular, like onHMR, onLog, onUpdateAccepted, etc.
Beta Was this translation helpful? Give feedback.
All reactions