@atlaspack/transformer-react-refresh-wrap 2.12.1-dev.3367 → 2.12.1-dev.3368

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.
@@ -43,7 +43,8 @@ var enqueueUpdate = debounce(function () {
43
43
  module.exports.prelude = function (module) {
44
44
  window.__REACT_REFRESH_VERSION_TRANSFORMER = version;
45
45
  window.$RefreshReg$ = function (type, id) {
46
- if (window.__REACT_REFRESH_VERSION_TRANSFORMER !== window.__REACT_REFRESH_VERSION_RUNTIME) {
46
+ if (window.__REACT_REFRESH_VERSION_TRANSFORMER && window.__REACT_REFRESH_VERSION_RUNTIME && window.__REACT_REFRESH_VERSION_TRANSFORMER !== window.__REACT_REFRESH_VERSION_RUNTIME) {
47
+ // Both versions were set and they did not match
47
48
  throw new Error(`react-refresh versions did not match between transformer and runtime. Please check your dependencies. Transformer: ${window.__REACT_REFRESH_VERSION_TRANSFORMER}, Runtime: ${window.__REACT_REFRESH_VERSION_RUNTIME}`);
48
49
  }
49
50
  Refresh.register(type, module.id + ' ' + id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/transformer-react-refresh-wrap",
3
- "version": "2.12.1-dev.3367+07fefed65",
3
+ "version": "2.12.1-dev.3368+af1db7f65",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,12 +13,12 @@
13
13
  "source": "src/ReactRefreshWrapTransformer.js",
14
14
  "engines": {
15
15
  "node": ">= 16.0.0",
16
- "atlaspack": "^2.12.1-dev.3367+07fefed65"
16
+ "atlaspack": "^2.12.1-dev.3368+af1db7f65"
17
17
  },
18
18
  "dependencies": {
19
- "@atlaspack/plugin": "2.12.1-dev.3367+07fefed65",
20
- "@atlaspack/utils": "2.12.1-dev.3367+07fefed65",
19
+ "@atlaspack/plugin": "2.12.1-dev.3368+af1db7f65",
20
+ "@atlaspack/utils": "2.12.1-dev.3368+af1db7f65",
21
21
  "react-refresh": ">=0.9 <=0.14"
22
22
  },
23
- "gitHead": "07fefed65a9a4d7bd0bdc9c45b39704ee4ca70dd"
23
+ "gitHead": "af1db7f65c4816917ddf83716deedc536a1b8b27"
24
24
  }
@@ -41,9 +41,12 @@ module.exports.prelude = function (module) {
41
41
  window.__REACT_REFRESH_VERSION_TRANSFORMER = version;
42
42
  window.$RefreshReg$ = function (type, id) {
43
43
  if (
44
+ window.__REACT_REFRESH_VERSION_TRANSFORMER &&
45
+ window.__REACT_REFRESH_VERSION_RUNTIME &&
44
46
  window.__REACT_REFRESH_VERSION_TRANSFORMER !==
45
- window.__REACT_REFRESH_VERSION_RUNTIME
47
+ window.__REACT_REFRESH_VERSION_RUNTIME
46
48
  ) {
49
+ // Both versions were set and they did not match
47
50
  throw new Error(
48
51
  `react-refresh versions did not match between transformer and runtime. Please check your dependencies. Transformer: ${window.__REACT_REFRESH_VERSION_TRANSFORMER}, Runtime: ${window.__REACT_REFRESH_VERSION_RUNTIME}`,
49
52
  );