webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

fix getEventSourceWrapper window on iframe

Open minimit opened this issue 5 years ago • 3 comments

This PR contains a:

  • [x] bugfix
  • [ ] new feature
  • [ ] code refactor
  • [ ] test update
  • [ ] typo fix
  • [ ] metadata update

Motivation / Use-Case

When using iframes HMR was initializing inside each iframe, this way intead we use the parent instance of window.__whmEventSourceWrapper so 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

minimit avatar May 08 '19 08:05 minimit

Codecov Report

Merging #358 (9305296) into master (fe33d59) will decrease coverage by 0.24%. The diff coverage is 87.50%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
client.js 83.92% <87.50%> (-0.32%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update fe33d59...9305296. Read the comment docs.

codecov[bot] avatar May 08 '19 08:05 codecov[bot]

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!

minimit avatar Jun 10 '19 17:06 minimit

Closing for revision in firefox

minimit avatar Sep 08 '19 21:09 minimit