wellyshen / react-cool-starter

😎 🐣 A starter boilerplate for a universal web app with the best development experience and a focus on performance and best practices.
MIT License
1.31k stars 242 forks source link

How you deal with react-refresh? #1059

Open amerllica opened 3 years ago

amerllica commented 3 years ago

Dear Wellyshen, In my project I updated the Webpack to the higher version, and also I used webpack-hot-server-middleware and I have server-build and everything works well, but I lost react-refresh. how you deal with the react-refresh issue?

Because it has some issues with Webpack 5.

wellyshen commented 3 years ago

@amerllica Thank you for telling me about this issue, I'm facing this issue too. I will spend time investigating it, if you have a solution please share it with me.

wellyshen commented 3 years ago

@amerllica Yo bro, here's the temporary workaround for this issue, see #1065

amerllica commented 3 years ago

@wellyshen Really thanks, I will upload my changes in another repo with fork of your repo, to show you how I made it, actually my friend Saeed Padyab helped me a lot. I will review this issue, thanks bro.

wellyshen commented 3 years ago

@amerllica Nice thank you for that 😎

wellyshen commented 3 years ago

@amerllica Will you show me the solution for the setup of react-fresh with SSR bundle?

amerllica commented 3 years ago

@wellyshen, My entire SSR solution is different from your implementation, I used webpack-hot-server-middleware and the react-refresh works well in it. My base configuration is on the latest version of RCS before your new SSR.

If you want I can make a SandBox or a TempRepo to show you my codes. I didn't add additional settings.

wellyshen commented 3 years ago

@amerllica I see. Do you think it's a good choice to tweak this starter for enabling react-fresh based your configuration? By the way, I have tested Next.js, react-refresh fails too.

amerllica commented 3 years ago

@wellyshen, I hate Next.js, really.

I think it could be a good approach to test my configuration. and then prepare yours with mine. and then choose what's better.

If you want, I should send a PR to another branch of your repo, please keep me posted, because of my tight time, it takes some days.

wellyshen commented 3 years ago

@amerllica Lol you make me laugh bro. Can you show me your configuration first? I will take take to study it.

amerllica commented 3 years ago

@wellyshen, it is not on GitHub, it's on BitBucket and it is private, if you want come here, I'm live now. I can show you my codes by using screen sharing.

wellyshen commented 3 years ago

@amerllica I won't see it now (because I'm eating). Maybe you can show me some code snippets when you have time.

amerllica commented 3 years ago

@wellyshen, Showing code snippets needs preparing and it takes my time. finish your eating, take rest, whenever you want, call me on WhatsApp or come here: https://meet.google.com/isf-wcxy-bqh then I can share my screen and show you what I did.

WA: https://wa.me/qr/QUAQFKN4VSMBF1

wellyshen commented 3 years ago

@amerllica I will find a day to book your time for it. Thanks bro.