Skip to content
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

Fixes 3076: HMR update breaks in webworker #3078

Conversation

clintharris
Copy link
Contributor

@clintharris clintharris commented May 23, 2019

↪️ Pull Request

Fixes #3076 by using a web worker-safe alternative to window.reload().
Fixes #2908

💻 Examples

🚨 Test instructions

  1. Clone https://github.com/clintharris/parcel-hrm-bug-demo
  2. npm install && npm start
  3. Load http://localhost:1234, open browser JS console.
  4. Edit src/index.js to trigger HMR update.
  5. JS console error: ReferenceError: window is not defined

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@clintharris
Copy link
Contributor Author

@mischnic any chance someone on the team could consider this for merging?

@DeMoorJasper DeMoorJasper merged commit 7ad25fd into parcel-bundler:master Jun 1, 2019
@stewart42
Copy link

I see this has been included in the tag parcel-bundler@1.12.4-alpha.0 Any chance we can get a release for 1.2.4 soon even if it is in alpha?

@mischnic
Copy link
Member

I see this has been included in the tag parcel-bundler@1.12.4-alpha.0

This tag was created while publishing 2.0.0-alpha.0, there is currently no ^1.12.0 release planned.

@stewart42
Copy link

@mischnic thanks for the quick reply. That is sad news, it would have been great to get some of these small fixes released while v2 is being worked on.

twome added a commit to twome/parcel that referenced this pull request Sep 10, 2019
…e/strip-type-module-attr

* 'master' of github.com:parcel-bundler/parcel:
  fix source maps on coffeescript assets (parcel-bundler#3423)
  Fixes parcel-bundler#3133 by upgrading serialize-to-js from 1.1.1 to 3.0.0  (parcel-bundler#3451)
  Fix up misleading usage information (parcel-bundler#3158)
  bump chokidar to get a reload fix for linux (parcel-bundler#2878)
  Use uppercase for the first letter of the issue template (parcel-bundler#3192)
  Update dotenv-expand to allow overriding of falsy values (parcel-bundler#2971)
  Fixes 3076: HMR update breaks in webworker due to window (and location.reload) not existing in web worker context. (parcel-bundler#3078)
  Scope hoisting destructuring (parcel-bundler#2742)
  Create FUNDING.yml (parcel-bundler#3074)
  Added new info command  (parcel-bundler#3068)
  Fix typo (parcel-bundler#3043)
  Update deps & gitattributes (parcel-bundler#3006)
  Fix assigning to exports from inside a function in scope hoisting (parcel-bundler#2994)
  Define __esModule interop flag when requiring ES module from CommonJS (parcel-bundler#2993)
  Replace module.require in scope hoisting (parcel-bundler#2875)
  Clear scope cache before crawling (parcel-bundler#2986)
  Fix CI (parcel-bundler#2990)
  Shake exports with pure property assignments (parcel-bundler#2979)
  Update postcss.js (parcel-bundler#2922)
  Fail immediately if yarn.lock updates are needed (parcel-bundler#2945)
@mkg20001
Copy link

mkg20001 commented Oct 6, 2019

This bug has re-appeared in service workers

@mkg20001
Copy link

mkg20001 commented Oct 7, 2019

Oh wait, the fix wasn't released

I've made a tarball at: https://github.com/mkg20001/parcel/releases/download/backport-fix/parcel-bundler-1.12.4.tgz

@mischnic
Copy link
Member

mischnic commented Oct 7, 2019

Oh wait, the fix wasn't released

Also not in the release from yesterday?

@mkg20001
Copy link

mkg20001 commented Oct 7, 2019

Oh wait, didn't notice that one yet 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants