Meteor live-reload while developing?


I’ve configured my app to migrate across live reloads using this little bit of code:

ReactInstance = Meteor._reload.migrationData('react-ui') or {}

Meteor._reload.onMigrate 'react-ui', ->
  return [true, ReactInstance]

However, I’m noticing that if I edit some code, the browser does some kind of refresh, but not the kind triggered by Meteor._reload.reload(). The subscriptions appear to be reset but the UI is stale.

I get an error saying that I’m calling setState on a React component that isnt mounted, which never happens unless I edit some client side code and wait for this background refresh which I know happens when the subscription reset message is sent.

Any ideas what this is? It seems like development mode refresh or something, but its causing me troubles. How can I learn more about this?


Am I missing something… why aren’t you putting react-ui in Session?

ReactiveVars are not automatically migrated across hot code pushes, whereas Session state is.


Session clones the objects as the go in and out. I’m doing some mutable manupulation as you can see with saveReact() not returning the ReactInstance. So Session won’t work for me, but luckily its easy enough without Session