fix getEventSourceWrapper window on iframe#358
fix getEventSourceWrapper window on iframe#358minimit wants to merge 1 commit intowebpack:masterfrom minimit:fix-iframe
Conversation
Codecov Report
@@ Coverage Diff @@
## master #358 +/- ##
==========================================
- Coverage 88.63% 88.38% -0.25%
==========================================
Files 3 3
Lines 264 267 +3
Branches 76 77 +1
==========================================
+ Hits 234 236 +2
- Misses 30 31 +1
Continue to review full report at Codecov.
|
|
I've tested with iframes and it works good, you can have as many iframes that you want and the hot reloads styles inside and outside the iframes! |
|
Closing for revision in firefox |
| // cache the wrapper for other entries loaded on | ||
| // the same page with the same options.path | ||
| window.__whmEventSourceWrapper[options.path] = EventSourceWrapper(); | ||
| top.__whmEventSourceWrapper[options.path] = EventSourceWrapper(); |
There was a problem hiding this comment.
I think we should not keep it cached now. e.g. On this reload server is closing web socket connection
module.hot.accept() => { window.location.reload(); });
while when creating new EventSourceWrapper(); it work properly.
This PR contains a:
Motivation / Use-Case
When using iframes HMR was initializing inside each iframe, this way intead we use the parent instance of
window.__whmEventSourceWrapperso you have no duplicate listeners and no limit on how many iframes you can have before the HMR hungs up with too many calls.Breaking Changes
None
Additional Info