feat: Add support for refreshing hmr on failure#182
feat: Add support for refreshing hmr on failure#182shellscape merged 12 commits intoshellscape:masterfrom
Conversation
|
@shellscape Let me know when we can push this one further so I can improve as needed. |
197259b to
2318617
Compare
|
@TrySound This one is good to check. I'll have to try it against an actual project to make sure the refresh logic works. |
a31b623 to
ff02a85
Compare
It looks like that requires a little different kind of check.
|
I set up a tiny project where to test this and found out that it requires a little different kind of check to refresh correctly. Now it emits an error (below) from HMR plugin after refreshing but at least the functionality works. Should I include the example to this project? I could set up a directory where to push it. |
I found a better place for applying the logic.
| }, | ||
| "keywords": [], | ||
| "author": "Juho Vepsäläinen", | ||
| "license": "MIT", |
There was a problem hiding this comment.
Let me know if you want me to change any of this. I can also drop some of the fields.
| "pre-commit": "^1.2.2", | ||
| "puppeteer": "^3.0.2", | ||
| "webpack": "^4.43.0", | ||
| "react-refresh": "^0.8.3", |
There was a problem hiding this comment.
This one seems a necessary bad due to how the client looks it up. I suppose ideally it would live only within the example.
| "puppeteer": "^3.0.2", | ||
| "webpack": "^4.43.0", | ||
| "react-refresh": "^0.8.3", | ||
| "webpack": "^4.44.2", |
There was a problem hiding this comment.
I can revert the version update. I made it to use a fairly new version as otherwise react-refresh won't work. Likely we should find a way to test against 5 as well.
|
Let's move the examples under |
Sure, I'll move it there. That's a good idea. 👍 |
|
Forgot to mention, there's also a recipes index on the readme we'll need to update |
Ok, done. |
Recipes aren't linted anyhow.
|
Looks good, good to merge? |
Yeah, let's merge and publish. Feel free to squash and push out a minor release with the feature. 👍 |
|
@bebraw I checked out your demo and it works nicely:
|


This PR contains:
Breaking Changes?
If yes, please describe the breakage.
Please Describe Your Changes
This PR adds support
hot: 'refresh-on-failure'.Technically we could reduce
hotandliveReloadto a single enum with three options as you should never havehotandliveReloadenabled anyhow but that change likely goes beyond this PR.Open questions