-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fix HMR by saving the preview frame URL as the story changes. #2349
Conversation
I'm not sure where we are at in the release cycle; this could go straight out if you prefer. |
Codecov Report
@@ Coverage Diff @@
## release/3.3 #2349 +/- ##
===============================================
- Coverage 22.8% 22.75% -0.06%
===============================================
Files 326 326
Lines 6752 6767 +15
Branches 836 845 +9
===============================================
Hits 1540 1540
- Misses 4601 4607 +6
- Partials 611 620 +9
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
If we decide to have it on master, we can try the cherry-picking approach I proposed for future releases |
I am going to be so happy once this is released 👍 |
@RobinMalfait this is released as |
This didn't apply at all cleanly as it involved adding code to each framework's `init.js`, which was removed in the refactor. Here we do better; we simply abstract the job of URL<->redux store syncing to the core library.
This didn't apply at all cleanly as it involved adding code to each framework's `init.js`, which was removed in the refactor. Here we do better; we simply abstract the job of URL<->redux store syncing to the core library.
Sometimes when there are problems with HMR, we end up doing a
hard-reload of the preview iframe, whilst leaving the main window.
As the preview iframe didn't change its URL ever, this led to problems
where the old (usually original) story was loaded in such circumstances.
Issue:
See #614 and #1328 -- and possibly some more, I'll have a hunt through the issue list.
What I did
use
pushState
to change the preview's URL as stories change.How to test
See the repro on #614
Is this testable with jest or storyshots?
No
Does this need a new example in the kitchen sink apps?
No
Does this need an update to the documentation?
No
If your answer is yes to any of these, please make sure to include it in your PR.