@atlaspack/runtime-react-refresh 2.14.5-canary.16 → 2.14.5-canary.161

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,179 @@
1
1
  # @atlaspack/runtime-react-refresh
2
2
 
3
+ ## 2.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`f6b3f22`](https://github.com/atlassian-labs/atlaspack/commit/f6b3f2276c7e417580b49c4879563aab51f156b1)]:
8
+ - @atlaspack/feature-flags@2.23.0
9
+ - @atlaspack/utils@2.18.2
10
+ - @atlaspack/plugin@2.14.25
11
+
12
+ ## 2.15.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#732](https://github.com/atlassian-labs/atlaspack/pull/732) [`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45) Thanks [@vykimnguyen](https://github.com/vykimnguyen)! - add tesseract context
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [[`73dd7ba`](https://github.com/atlassian-labs/atlaspack/commit/73dd7baab69456ef2f6e4a0cc7dbb04f407eb148)]:
21
+ - @atlaspack/feature-flags@2.22.0
22
+ - @atlaspack/utils@2.18.1
23
+ - @atlaspack/plugin@2.14.24
24
+
25
+ ## 2.14.23
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
30
+ - @atlaspack/feature-flags@2.21.0
31
+ - @atlaspack/utils@2.18.0
32
+ - @atlaspack/plugin@2.14.23
33
+
34
+ ## 2.14.22
35
+
36
+ ### Patch Changes
37
+
38
+ - [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
39
+
40
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94), [`12bee0e`](https://github.com/atlassian-labs/atlaspack/commit/12bee0e23f0464d7f6bd3e24fbe0d19c126d587d)]:
41
+ - @atlaspack/feature-flags@2.20.1
42
+ - @atlaspack/plugin@2.14.22
43
+ - @atlaspack/utils@2.17.4
44
+
45
+ ## 2.14.21
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
50
+ - @atlaspack/feature-flags@2.20.0
51
+ - @atlaspack/utils@2.17.3
52
+ - @atlaspack/plugin@2.14.21
53
+
54
+ ## 2.14.20
55
+
56
+ ### Patch Changes
57
+
58
+ - [#702](https://github.com/atlassian-labs/atlaspack/pull/702) [`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa) Thanks [@alshdavid](https://github.com/alshdavid)! - Fixes to Flow types
59
+
60
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa), [`1c7865a`](https://github.com/atlassian-labs/atlaspack/commit/1c7865a64451116d94015e248302435839d347c0), [`a0b959f`](https://github.com/atlassian-labs/atlaspack/commit/a0b959fbf61fc3f820ff03c7e8988945fe40a91a)]:
61
+ - @atlaspack/plugin@2.14.20
62
+ - @atlaspack/feature-flags@2.19.2
63
+ - @atlaspack/utils@2.17.2
64
+
65
+ ## 2.14.19
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [[`13aef17`](https://github.com/atlassian-labs/atlaspack/commit/13aef177eea289a6e40d2113b5ec1ac9be18a33d)]:
70
+ - @atlaspack/feature-flags@2.19.1
71
+ - @atlaspack/utils@2.17.1
72
+ - @atlaspack/plugin@2.14.19
73
+
74
+ ## 2.14.18
75
+
76
+ ### Patch Changes
77
+
78
+ - Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`becf977`](https://github.com/atlassian-labs/atlaspack/commit/becf977f625d5ee46dae3d4c679f173bf5f40cc0), [`c4415a4`](https://github.com/atlassian-labs/atlaspack/commit/c4415a455543d984ca28452c2cb87a794d22497c), [`f0f7c71`](https://github.com/atlassian-labs/atlaspack/commit/f0f7c7168a1d3d18c6f30d2daed611275692b7c5), [`de23e0c`](https://github.com/atlassian-labs/atlaspack/commit/de23e0ce49d5504fe3947ac26640a3d951087da3), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417), [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56)]:
79
+ - @atlaspack/feature-flags@2.19.0
80
+ - @atlaspack/utils@2.17.0
81
+ - @atlaspack/plugin@2.14.18
82
+
83
+ ## 2.14.17
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies []:
88
+ - @atlaspack/utils@2.16.1
89
+ - @atlaspack/plugin@2.14.17
90
+
91
+ ## 2.14.16
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies [[`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c), [`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
96
+ - @atlaspack/feature-flags@2.18.4
97
+ - @atlaspack/utils@2.16.0
98
+ - @atlaspack/plugin@2.14.16
99
+
100
+ ## 2.14.15
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be)]:
105
+ - @atlaspack/feature-flags@2.18.3
106
+ - @atlaspack/utils@2.15.3
107
+ - @atlaspack/plugin@2.14.15
108
+
109
+ ## 2.14.14
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
114
+ - @atlaspack/feature-flags@2.18.2
115
+ - @atlaspack/utils@2.15.2
116
+ - @atlaspack/plugin@2.14.14
117
+
118
+ ## 2.14.13
119
+
120
+ ### Patch Changes
121
+
122
+ - [#633](https://github.com/atlassian-labs/atlaspack/pull/633) [`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b) Thanks [@sbhuiyan-atlassian](https://github.com/sbhuiyan-atlassian)! - Ported various HMR changes from Parcel
123
+
124
+ - Updated dependencies [[`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
125
+ - @atlaspack/feature-flags@2.18.1
126
+ - @atlaspack/utils@2.15.1
127
+ - @atlaspack/plugin@2.14.13
128
+
129
+ ## 2.14.12
130
+
131
+ ### Patch Changes
132
+
133
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
134
+ - @atlaspack/utils@2.15.0
135
+ - @atlaspack/plugin@2.14.12
136
+
137
+ ## 2.14.11
138
+
139
+ ### Patch Changes
140
+
141
+ - Updated dependencies []:
142
+ - @atlaspack/utils@2.14.11
143
+ - @atlaspack/plugin@2.14.11
144
+
145
+ ## 2.14.10
146
+
147
+ ### Patch Changes
148
+
149
+ - Updated dependencies []:
150
+ - @atlaspack/plugin@2.14.10
151
+ - @atlaspack/utils@2.14.10
152
+
153
+ ## 2.14.9
154
+
155
+ ### Patch Changes
156
+
157
+ - Updated dependencies []:
158
+ - @atlaspack/utils@2.14.9
159
+ - @atlaspack/plugin@2.14.9
160
+
161
+ ## 2.14.8
162
+
163
+ ### Patch Changes
164
+
165
+ - Updated dependencies []:
166
+ - @atlaspack/utils@2.14.8
167
+ - @atlaspack/plugin@2.14.8
168
+
169
+ ## 2.14.7
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies []:
174
+ - @atlaspack/utils@2.14.7
175
+ - @atlaspack/plugin@2.14.7
176
+
3
177
  ## 2.14.6
4
178
 
5
179
  ### Patch Changes
@@ -19,7 +19,13 @@ function _utils() {
19
19
  return data;
20
20
  }
21
21
  var _package = require("react-refresh/package.json");
22
- // $FlowFixMe Package json is untyped
22
+ function _featureFlags() {
23
+ const data = require("@atlaspack/feature-flags");
24
+ _featureFlags = function () {
25
+ return data;
26
+ };
27
+ return data;
28
+ }
23
29
  const CODE = `
24
30
  var Refresh = require('react-refresh/runtime');
25
31
  var ErrorOverlay = require('react-error-overlay');
@@ -51,7 +57,13 @@ var _default = exports.default = new (_plugin().Runtime)({
51
57
  bundle,
52
58
  options
53
59
  }) {
54
- if (bundle.type !== 'js' || !options.hmrOptions || !bundle.env.isBrowser() || bundle.env.isLibrary || bundle.env.isWorker() || bundle.env.isWorklet() || options.mode !== 'development' || bundle.env.sourceType !== 'module') {
60
+ if ((0, _featureFlags().getFeatureFlag)('hmrImprovements')) {
61
+ // Note for https://jplat.atlassian.net/browse/JFP-3539:
62
+ // When cleaning up this feature flag, delete the entire
63
+ // @atlaspack/runtime-react-refresh package and remove all references to it
64
+ return;
65
+ }
66
+ if (bundle.type !== 'js' || !options.hmrOptions || !bundle.env.isBrowser() || bundle.env.isLibrary || bundle.env.isWorker() || bundle.env.isTesseract() || bundle.env.isWorklet() || options.mode !== 'development' || bundle.env.sourceType !== 'module') {
55
67
  return;
56
68
  }
57
69
  let entries = bundle.getEntryAssets();
@@ -0,0 +1,3 @@
1
+ import { Runtime } from '@atlaspack/plugin';
2
+ declare const _default: Runtime<unknown>;
3
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/runtime-react-refresh",
3
- "version": "2.14.5-canary.16+4b2b575b9",
3
+ "version": "2.14.5-canary.161+ee040bb64",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,17 +9,23 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/atlassian-labs/atlaspack.git"
11
11
  },
12
- "main": "lib/ReactRefreshRuntime.js",
13
- "source": "src/ReactRefreshRuntime.js",
12
+ "main": "./lib/ReactRefreshRuntime.js",
13
+ "source": "./src/ReactRefreshRuntime.ts",
14
+ "types": "./lib/types/ReactRefreshRuntime.d.ts",
14
15
  "engines": {
15
16
  "node": ">= 16.0.0"
16
17
  },
17
18
  "dependencies": {
18
- "@atlaspack/plugin": "2.14.5-canary.16+4b2b575b9",
19
- "@atlaspack/utils": "2.14.5-canary.16+4b2b575b9",
19
+ "@atlaspack/feature-flags": "2.14.1-canary.229+ee040bb64",
20
+ "@atlaspack/plugin": "2.14.5-canary.161+ee040bb64",
21
+ "@atlaspack/utils": "2.14.5-canary.161+ee040bb64",
20
22
  "react-error-overlay": "6.0.9",
21
- "react-refresh": ">=0.9 <=0.14"
23
+ "react-refresh": ">=0.9 <=0.16"
22
24
  },
23
25
  "type": "commonjs",
24
- "gitHead": "4b2b575b98951f2dcf0c45ed8e94359b23b43815"
26
+ "scripts": {
27
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
28
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
29
+ },
30
+ "gitHead": "ee040bb6428f29b57d892ddd8107e29077d08ffd"
25
31
  }
@@ -1,9 +1,7 @@
1
- // @flow strict-local
2
-
3
1
  import {Runtime} from '@atlaspack/plugin';
4
2
  import {loadConfig} from '@atlaspack/utils';
5
- // $FlowFixMe Package json is untyped
6
3
  import {version} from 'react-refresh/package.json';
4
+ import {getFeatureFlag} from '@atlaspack/feature-flags';
7
5
 
8
6
  const CODE = `
9
7
  var Refresh = require('react-refresh/runtime');
@@ -32,14 +30,22 @@ window.addEventListener('parcelhmraccept', () => {
32
30
  });
33
31
  `;
34
32
 
35
- export default (new Runtime({
33
+ export default new Runtime({
36
34
  async apply({bundle, options}) {
35
+ if (getFeatureFlag('hmrImprovements')) {
36
+ // Note for https://jplat.atlassian.net/browse/JFP-3539:
37
+ // When cleaning up this feature flag, delete the entire
38
+ // @atlaspack/runtime-react-refresh package and remove all references to it
39
+ return;
40
+ }
41
+
37
42
  if (
38
43
  bundle.type !== 'js' ||
39
44
  !options.hmrOptions ||
40
45
  !bundle.env.isBrowser() ||
41
46
  bundle.env.isLibrary ||
42
47
  bundle.env.isWorker() ||
48
+ bundle.env.isTesseract() ||
43
49
  bundle.env.isWorklet() ||
44
50
  options.mode !== 'development' ||
45
51
  bundle.env.sourceType !== 'module'
@@ -69,4 +75,4 @@ export default (new Runtime({
69
75
  }
70
76
  }
71
77
  },
72
- }): Runtime);
78
+ }) as Runtime<unknown>;
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }