Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After migrating to esbuild HMR no longer works on local dev plugins #4152

Open
aeroxy opened this issue Sep 29, 2022 · 4 comments
Open

After migrating to esbuild HMR no longer works on local dev plugins #4152

aeroxy opened this issue Sep 29, 2022 · 4 comments

Comments

@aeroxy
Copy link
Contributor

aeroxy commented Sep 29, 2022

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.

@aeroxy
Copy link
Contributor Author

aeroxy commented Sep 29, 2022

@aigoncharov should look into this.

@aigoncharov
Copy link
Contributor

@aeroxy the plugins are still watched (

await startWatchPlugins(
) 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
Copy link
Contributor Author

aeroxy commented Sep 29, 2022

@aeroxy the plugins are still watched (

await startWatchPlugins(

) 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.

@aigoncharov
Copy link
Contributor

This might be a good place to start facebook/react#16604 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants