FredKSchott / esm-hmr

a Hot Module Replacement (HMR) API for your ESM-based dev server.
MIT License
413 stars 11 forks source link

mobx #17

Open leeratyou opened 4 years ago

leeratyou commented 4 years ago

Wrapping components to mobx's 'observer' (that wrap them in React.memo) prevents hmr to work

    "@snowpack/plugin-react-refresh": "^2.0.3",
    "@snowpack/app-scripts-react": "^1.9.0",
    "mobx": "^5.15.4",
    "mobx-react": "^6.2.3",
    "mobx-react-lite": "^2.0.7",
    "snowpack": "^2.8.0",
FredKSchott commented 4 years ago

Can you include steps that I could reproduce, including code snippets that I can add to a Snowpack app to see this failure in action?

leeratyou commented 4 years ago

@FredKSchott sure repo to reproduce: https://github.com/leeratyou/snowpack-mobx-issue

  1. start project
  2. phone/code any
  3. display to Home screen
  4. edit src/pages/Home
  5. that triggers file change but not Home content
dodas commented 3 years ago

I am interested in this as well. Any examples on how to setup HMR with mobx/MST?

Something like this: https://github.com/mobxjs/mobx-state-tree/issues/372#issuecomment-336145224

Thanks!

ar7casper commented 3 years ago

@leeratyou Any news on that?