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

React Fast Refresh #151

Closed
mohsen1 opened this issue May 26, 2020 · 3 comments
Closed

React Fast Refresh #151

mohsen1 opened this issue May 26, 2020 · 3 comments

Comments

@mohsen1
Copy link

mohsen1 commented May 26, 2020

Since React Fast Refresh requires bundler specific work, I am creating this issue just to track this work. It's not high priority at all.

You mentioned you are planning for plugins in future. This would be a good candidate to test your plugin API design.

Here is a rough document for how to implement React Fast Refresh.

@zmitry
Copy link

zmitry commented May 26, 2020

I guess this could be solved with this one #111 but it's more complex than that.
I think it would be good to have feature pairty with create react app. For now esbuild lacks svg import feature to be compat with cra.

As for reach refresh it requires more more work than plugins system, we would also need some api for hot updates so it might require this feature #21 to be finished as well.

@evanw
Copy link
Owner

evanw commented May 27, 2020

I'm not sure this makes sense as part of esbuild. First of all esbuild is focused on production builds, not development builds. I am also trying to avoid building in complicated custom transforms for various frameworks like this. For example, I'm not planning to replicate the compiler pipelines of Vue, Svelte, or Angular either. That's why the readme says "I'm not trying to create an extremely flexible build system that can build anything."

In a world where esbuild has support for JavaScript plugins, it could potentially make sense to add this as a plugin. Or it could make sense to use esbuild's transform API to speed up another bundler that has React Fast Refresh support, and for people who want to use React Fast Refresh with esbuild to use that bundler instead.

@evanw
Copy link
Owner

evanw commented Jul 2, 2020

I'm going to close this because I believe the above answer is sufficient for this issue. It's true that someone could possibly write an esbuild plugin for this in the future, but I'm not going to keep issues open for each potential esbuild plugin. There are too many of them and it's not useful for me to track them in separate issues. This issue has already been linked to #111, the general issue for the plugin API, so it won't be lost.

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

3 participants