Closed olivercoad closed 2 years ago
Is there a reason it's not just a single emit over
let hot = ...
like inHMR.Webpack.fs
?
What do you mean by that?
~I didn't add the comment to all the lines because HMR.Vite
is the first one to be checked so, it will always be the first one to fail and report the error.~
I just saw your comment under the original issue. I will review and test the PR later.
The syntax import.meta.webpackHot
in HMR.Webpack
is not an error.
Webpack exposed the hot
API via import.meta.webpackHot
and import.meta.hot
If you tested the PR and had the sentiment it was working it is because Webpack also expose the hot
API via module.hot
.
I know. I was asking in HMR.Vite why does each abstract method in IHot have
its own emit and let hot
marked as global. Instead of not having emits
over every abstract method like in webpack and parcel.
On Fri., 26 Nov. 2021, 23:58 Maxime Mangel, @.***> wrote:
Merged #36 https://github.com/elmish/hmr/pull/36 into master.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/elmish/hmr/pull/36#event-5677554794, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5P62SZI5UUTMBPN7M4I3TUN6AA5ANCNFSM5IZJ5ADA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
This is because Vite is very strict about how the JavaScript code should be written.
And if we do the "normal Fable way", then Fable will generate something like (import.meta.hot).data
and Vite will not detect it.
Doing this way, makes sure that we don't have extra parenthesis
added.
I didn't add it to all the emits in
HMR.Vite.fs
. Is there a reason it's not just a single emit overlet hot = ...
like inHMR.Webpack.fs
?