Closed MangelMaxime closed 2 years ago
@MangelMaxime I managed to make Elmish.HMR compatible with both Webpack and Vite/Snowpack for Fable.Lit. If it's ok with you, I can send a PR to add similar changes here, although my solution is not Lit-specific so it'd be nice to have a common Elmish.HMR that's not dependent on a specific renderer.
I didn't deal with the Navigation issue though. I think we can use hot.dispose
to remove the old subscriptions, but probably patching all potential Program extensions with subscriptions is not scalable. If termination capabilities were added to Elmish as discussed here, Elmish.HMR could terminate the "old" program and each extension should be responsible of cleaning up after themselves.
@alfonsogarciacaro
I am going to work on this issue (I was waiting to finish Nacara v1 before doing a round of maintenance across my different projects).
I need to refactor the repository structure to make the maintenance easier and also have demo project to tests the different bundler, etc.
@alfonsogarciacaro Not trying to spam you :)
But as I am not sure if you saw my notification from https://github.com/elmish/hmr/pull/30, I am pinging you here too.
Can you please have a look at my comments from https://github.com/elmish/hmr/pull/30 I have some problem with Vite HMR
Weird, I did miss the notification indeed 😕 Thanks for letting me know! I'll reply in the PR :+1:
Done in #30
Different bundler seems to offer different API with a few minor difference.
See #28 and https://github.com/fable-compiler/fable3-samples/issues/10#issuecomment-875304624