Open aeroxy opened 2 years ago
@aigoncharov should look into this.
@aeroxy the plugins are still watched (https://github.com/facebook/flipper/blob/277d730f77192092219d55102117628e660b6be7/desktop/scripts/start-dev-server.tsx#L416) and they should be reloaded automatically (https://github.com/facebook/flipper/blob/main/desktop/flipper-ui-core/src/dispatcher/pluginsSourceUpdateListener.tsx). But as you say the plugins currently lose their state.
We might build custom integration with react-refresh/runtime
in future, but it is not on the roadmap though. We'd be happy to accept a PR for it though.
@aeroxy the plugins are still watched (
) and they should be reloaded automatically (https://github.com/facebook/flipper/blob/main/desktop/flipper-ui-core/src/dispatcher/pluginsSourceUpdateListener.tsx). But as you say the plugins currently lose their state. We might build custom integration with
react-refresh/runtime
in future, but it is not on the roadmap though. We'd be happy to accept a PR for it though.
Ok, let me give it a shot.
This might be a good place to start https://github.com/facebook/react/issues/16604#issuecomment-528663101
Previously we use getWatchFolders for Metro to ensure local dev plugin projects are watched when running with the fast-refresh flag. After migrating to esbuild we lose this feature, and while developing local dev plugins, we would need to refresh the flipper manually and lose all the states.