@next/react-refresh-utils 12.0.9 → 12.0.10-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,59 +3,63 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // This function gets unwrapped into global scope, which is why we don't invert
4
4
  // if-blocks. Also, you cannot use `return`.
5
5
  function default_1() {
6
- var _a, _b;
7
- // Legacy CSS implementations will `eval` browser code in a Node.js context
8
- // to extract CSS. For backwards compatibility, we need to check we're in a
9
- // browser context before continuing.
10
- if (typeof self !== 'undefined' &&
11
- // AMP / No-JS mode does not inject these helpers:
12
- '$RefreshHelpers$' in self) {
13
- var currentExports = module.__proto__.exports;
14
- var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
15
- // This cannot happen in MainTemplate because the exports mismatch between
16
- // templating and execution.
17
- self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
18
- // A module can be accepted automatically based on its exports, e.g. when
19
- // it is a Refresh Boundary.
20
- if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
21
- // Save the previous exports on update so we can compare the boundary
22
- // signatures.
23
- module.hot.dispose(function (data) {
24
- data.prevExports = currentExports;
25
- });
26
- // Unconditionally accept an update to this module, we'll check if it's
27
- // still a Refresh Boundary later.
28
- module.hot.accept();
29
- // This field is set when the previous version of this module was a
30
- // Refresh Boundary, letting us know we need to check for invalidation or
31
- // enqueue an update.
32
- if (prevExports !== null) {
33
- // A boundary can become ineligible if its exports are incompatible
34
- // with the previous exports.
35
- //
36
- // For example, if you add/remove/change exports, we'll want to
37
- // re-execute the importing modules, and force those components to
38
- // re-render. Similarly, if you convert a class component to a
39
- // function, we want to invalidate the boundary.
40
- if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
41
- module.hot.invalidate();
42
- }
43
- else {
44
- self.$RefreshHelpers$.scheduleUpdate();
6
+ // Wrapped in an IIFE to avoid polluting the global scope
7
+ ;
8
+ (function () {
9
+ var _a, _b;
10
+ // Legacy CSS implementations will `eval` browser code in a Node.js context
11
+ // to extract CSS. For backwards compatibility, we need to check we're in a
12
+ // browser context before continuing.
13
+ if (typeof self !== 'undefined' &&
14
+ // AMP / No-JS mode does not inject these helpers:
15
+ '$RefreshHelpers$' in self) {
16
+ var currentExports = module.__proto__.exports;
17
+ var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
18
+ // This cannot happen in MainTemplate because the exports mismatch between
19
+ // templating and execution.
20
+ self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
21
+ // A module can be accepted automatically based on its exports, e.g. when
22
+ // it is a Refresh Boundary.
23
+ if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
24
+ // Save the previous exports on update so we can compare the boundary
25
+ // signatures.
26
+ module.hot.dispose(function (data) {
27
+ data.prevExports = currentExports;
28
+ });
29
+ // Unconditionally accept an update to this module, we'll check if it's
30
+ // still a Refresh Boundary later.
31
+ module.hot.accept();
32
+ // This field is set when the previous version of this module was a
33
+ // Refresh Boundary, letting us know we need to check for invalidation or
34
+ // enqueue an update.
35
+ if (prevExports !== null) {
36
+ // A boundary can become ineligible if its exports are incompatible
37
+ // with the previous exports.
38
+ //
39
+ // For example, if you add/remove/change exports, we'll want to
40
+ // re-execute the importing modules, and force those components to
41
+ // re-render. Similarly, if you convert a class component to a
42
+ // function, we want to invalidate the boundary.
43
+ if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
44
+ module.hot.invalidate();
45
+ }
46
+ else {
47
+ self.$RefreshHelpers$.scheduleUpdate();
48
+ }
45
49
  }
46
50
  }
47
- }
48
- else {
49
- // Since we just executed the code for the module, it's possible that the
50
- // new exports made it ineligible for being a boundary.
51
- // We only care about the case when we were _previously_ a boundary,
52
- // because we already accepted this update (accidental side effect).
53
- var isNoLongerABoundary = prevExports !== null;
54
- if (isNoLongerABoundary) {
55
- module.hot.invalidate();
51
+ else {
52
+ // Since we just executed the code for the module, it's possible that the
53
+ // new exports made it ineligible for being a boundary.
54
+ // We only care about the case when we were _previously_ a boundary,
55
+ // because we already accepted this update (accidental side effect).
56
+ var isNoLongerABoundary = prevExports !== null;
57
+ if (isNoLongerABoundary) {
58
+ module.hot.invalidate();
59
+ }
56
60
  }
57
61
  }
58
- }
62
+ })();
59
63
  }
60
64
  exports.default = default_1;
61
65
  //# sourceMappingURL=ReactRefreshModule.runtime.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/react-refresh-utils",
3
- "version": "12.0.9",
3
+ "version": "12.0.10-canary.0",
4
4
  "description": "An experimental package providing utilities for React Refresh.",
5
5
  "repository": {
6
6
  "url": "vercel/next.js",
@@ -30,5 +30,5 @@
30
30
  "devDependencies": {
31
31
  "react-refresh": "0.8.3"
32
32
  },
33
- "gitHead": "07431d3e0f057a0bd58af6d456e4bee646fd8b42"
33
+ "gitHead": "b314c9886c92054030f2b6831964237867045096"
34
34
  }