-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add React Fast Refresh #973
Comments
Hey, is this issue beginner friendly? |
Hi, thanks for the interest :) Honestly, I don't know.
This could already give some interesting results. However what would need to be tested is, since Crafty is used in micro-frontend applications where an instance of React is loaded early (using RequireJS) how it would be possible to have this and Fast Refresh working at the same time? (since as explained here facebook/react#16604 (comment) there is something about a global variable needed by React to handle fast refresh. Also the other question (which is certainly going to be tightly linked to the first one, can two builds in watch mode be run in two separate directories and be refreshed at the same time on the screen ? If you want to have a go at getting the happy case to work I'd be willing to finish the part with the two extra points since most users will probably not have this use case. |
Current status; the implementation is done and behind this flag : https://swissquote.github.io/crafty/Packages/crafty_preset_react.html#fast-refresh However it seems that it's nor working correctly when React is loaded through requirejs, more experimentation is needed. |
Made some further tests and everything seems to be working properly, the gotcha is that Refresh only works when React is loaded in development mode. The next version will enable React Fast Refresh by default when using |
Create react-app 4 RC
Storybook 6.1 Alpha
react-refresh-webpack-plugin
The text was updated successfully, but these errors were encountered: