New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/transformer-react-refresh-wrap

Package Overview
Dependencies
Maintainers
1
Versions
892
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/transformer-react-refresh-wrap - npm Package Compare versions

Comparing version 2.0.0-nightly.149 to 2.0.0-nightly.150

59

lib/helpers/helpers.js

@@ -39,37 +39,40 @@ "use strict";

registerExportsForReactRefresh(module);
module.hot.dispose(function (data) {
data.prevExports = module.exports;
});
module.hot.accept(function (getParents) {
var prevExports = module.hot.data.prevExports;
var nextExports = module.exports; // Since we just executed the code for it, it's possible
// that the new exports make it ineligible for being a boundary.
var isNoLongerABoundary = !isReactRefreshBoundary(nextExports); // It can also become ineligible if its exports are incompatible
// with the previous exports.
// For example, if you add/remove/change exports, we'll want
// to re-execute the importing modules, and force those components
// to re-render. Similarly, if you convert a class component
// to a function, we want to invalidate the boundary.
if (module.hot) {
module.hot.dispose(function (data) {
data.prevExports = module.exports;
});
module.hot.accept(function (getParents) {
var prevExports = module.hot.data.prevExports;
var nextExports = module.exports; // Since we just executed the code for it, it's possible
// that the new exports make it ineligible for being a boundary.
var didInvalidate = shouldInvalidateReactRefreshBoundary(prevExports, nextExports);
var isNoLongerABoundary = !isReactRefreshBoundary(nextExports); // It can also become ineligible if its exports are incompatible
// with the previous exports.
// For example, if you add/remove/change exports, we'll want
// to re-execute the importing modules, and force those components
// to re-render. Similarly, if you convert a class component
// to a function, we want to invalidate the boundary.
if (isNoLongerABoundary || didInvalidate) {
// We'll be conservative. The only case in which we won't do a full
// reload is if all parent modules are also refresh boundaries.
// In that case we'll add them to the current queue.
var parents = getParents();
var didInvalidate = shouldInvalidateReactRefreshBoundary(prevExports, nextExports);
if (parents.length === 0) {
// Looks like we bubbled to the root. Can't recover from that.
window.location.reload();
return;
if (isNoLongerABoundary || didInvalidate) {
// We'll be conservative. The only case in which we won't do a full
// reload is if all parent modules are also refresh boundaries.
// In that case we'll add them to the current queue.
var parents = getParents();
if (parents.length === 0) {
// Looks like we bubbled to the root. Can't recover from that.
window.location.reload();
return;
}
return parents;
}
return parents;
}
enqueueUpdate();
});
}
enqueueUpdate();
});
if (Refresh.hasUnrecoverableErrors()) {

@@ -76,0 +79,0 @@ window.location.reload();

{
"name": "@parcel/transformer-react-refresh-wrap",
"version": "2.0.0-nightly.149+453f7b0b",
"version": "2.0.0-nightly.150+2dc32a8b",
"license": "MIT",

@@ -23,9 +23,9 @@ "publishConfig": {

"@babel/types": "^7.0.0",
"@parcel/plugin": "2.0.0-nightly.149+453f7b0b",
"@parcel/source-map": "2.0.0-nightly.149+453f7b0b",
"@parcel/utils": "2.0.0-nightly.149+453f7b0b",
"@parcel/plugin": "2.0.0-nightly.150+2dc32a8b",
"@parcel/source-map": "2.0.0-nightly.150+2dc32a8b",
"@parcel/utils": "2.0.0-nightly.150+2dc32a8b",
"react-refresh": "^0.6.0",
"semver": "^5.4.1"
},
"gitHead": "453f7b0bf295e6a7cbec5d24fab4c48e21e6168f"
"gitHead": "2dc32a8b3f2113e01322f67bc5bc370bcd7be56d"
}

@@ -38,36 +38,38 @@ var Refresh = require('react-refresh/runtime');

module.hot.dispose(function(data) {
data.prevExports = module.exports;
});
if (module.hot) {
module.hot.dispose(function(data) {
data.prevExports = module.exports;
});
module.hot.accept(function(getParents) {
var prevExports = module.hot.data.prevExports;
var nextExports = module.exports;
// Since we just executed the code for it, it's possible
// that the new exports make it ineligible for being a boundary.
var isNoLongerABoundary = !isReactRefreshBoundary(nextExports);
// It can also become ineligible if its exports are incompatible
// with the previous exports.
// For example, if you add/remove/change exports, we'll want
// to re-execute the importing modules, and force those components
// to re-render. Similarly, if you convert a class component
// to a function, we want to invalidate the boundary.
var didInvalidate = shouldInvalidateReactRefreshBoundary(
prevExports,
nextExports,
);
if (isNoLongerABoundary || didInvalidate) {
// We'll be conservative. The only case in which we won't do a full
// reload is if all parent modules are also refresh boundaries.
// In that case we'll add them to the current queue.
var parents = getParents();
if (parents.length === 0) {
// Looks like we bubbled to the root. Can't recover from that.
window.location.reload();
return;
module.hot.accept(function(getParents) {
var prevExports = module.hot.data.prevExports;
var nextExports = module.exports;
// Since we just executed the code for it, it's possible
// that the new exports make it ineligible for being a boundary.
var isNoLongerABoundary = !isReactRefreshBoundary(nextExports);
// It can also become ineligible if its exports are incompatible
// with the previous exports.
// For example, if you add/remove/change exports, we'll want
// to re-execute the importing modules, and force those components
// to re-render. Similarly, if you convert a class component
// to a function, we want to invalidate the boundary.
var didInvalidate = shouldInvalidateReactRefreshBoundary(
prevExports,
nextExports,
);
if (isNoLongerABoundary || didInvalidate) {
// We'll be conservative. The only case in which we won't do a full
// reload is if all parent modules are also refresh boundaries.
// In that case we'll add them to the current queue.
var parents = getParents();
if (parents.length === 0) {
// Looks like we bubbled to the root. Can't recover from that.
window.location.reload();
return;
}
return parents;
}
return parents;
}
enqueueUpdate();
});
enqueueUpdate();
});
}
if (Refresh.hasUnrecoverableErrors()) {

@@ -74,0 +76,0 @@ window.location.reload();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc