@atlaspack/runtime-browser-hmr 2.14.5-canary.26 → 2.14.5-canary.261
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 +242 -0
- package/dist/HMRRuntime.js +52 -0
- package/dist/loaders/hmr-runtime.js +588 -0
- package/lib/HMRRuntime.js +3 -3
- package/lib/loaders/hmr-runtime.js +177 -49
- package/lib/types/HMRRuntime.d.ts +3 -0
- package/lib/types/loaders/hmr-runtime.d.ts +2 -0
- package/package.json +11 -7
- package/src/{HMRRuntime.js → HMRRuntime.ts} +8 -10
- package/src/loaders/{hmr-runtime.js → hmr-runtime.ts} +225 -75
- package/tsconfig.json +16 -0
- package/tsconfig.tsbuildinfo +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,247 @@
|
|
|
1
1
|
# @atlaspack/runtime-browser-hmr
|
|
2
2
|
|
|
3
|
+
## 2.14.36
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`5776be2`](https://github.com/atlassian-labs/atlaspack/commit/5776be21f70a3f2b9471ba33da3ba1a883f21f1a)]:
|
|
8
|
+
- @atlaspack/utils@3.1.0
|
|
9
|
+
- @atlaspack/plugin@2.14.36
|
|
10
|
+
|
|
11
|
+
## 2.14.35
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`c372f3f`](https://github.com/atlassian-labs/atlaspack/commit/c372f3fd6fce8200d5cf47f41bc7895c6cbb5558), [`17dfea9`](https://github.com/atlassian-labs/atlaspack/commit/17dfea9e9f3169807808520df9c09ebf70dc8b10)]:
|
|
16
|
+
- @atlaspack/utils@3.0.3
|
|
17
|
+
- @atlaspack/plugin@2.14.35
|
|
18
|
+
|
|
19
|
+
## 2.14.34
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies []:
|
|
24
|
+
- @atlaspack/utils@3.0.2
|
|
25
|
+
- @atlaspack/plugin@2.14.34
|
|
26
|
+
|
|
27
|
+
## 2.14.33
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`236e546`](https://github.com/atlassian-labs/atlaspack/commit/236e5465863dca6044a7191e05260a5b924c342e)]:
|
|
32
|
+
- @atlaspack/utils@3.0.1
|
|
33
|
+
- @atlaspack/plugin@2.14.33
|
|
34
|
+
|
|
35
|
+
## 2.14.32
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [[`1180103`](https://github.com/atlassian-labs/atlaspack/commit/118010351ed444f8178988afb3f77807154dd933)]:
|
|
40
|
+
- @atlaspack/utils@3.0.0
|
|
41
|
+
- @atlaspack/plugin@2.14.32
|
|
42
|
+
|
|
43
|
+
## 2.14.31
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- [#785](https://github.com/atlassian-labs/atlaspack/pull/785) [`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922) Thanks [@matt-koko](https://github.com/matt-koko)! - We need to re-publish every package in Atlaspack with the corrected types field.
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [[`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922)]:
|
|
50
|
+
- @atlaspack/plugin@2.14.31
|
|
51
|
+
- @atlaspack/utils@2.19.3
|
|
52
|
+
|
|
53
|
+
## 2.14.30
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies []:
|
|
58
|
+
- @atlaspack/utils@2.19.2
|
|
59
|
+
- @atlaspack/plugin@2.14.30
|
|
60
|
+
|
|
61
|
+
## 2.14.29
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- Updated dependencies []:
|
|
66
|
+
- @atlaspack/utils@2.19.1
|
|
67
|
+
- @atlaspack/plugin@2.14.29
|
|
68
|
+
|
|
69
|
+
## 2.14.28
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies [[`f0349a6`](https://github.com/atlassian-labs/atlaspack/commit/f0349a6b9b04755088f121095ca6301a2ada3767)]:
|
|
74
|
+
- @atlaspack/utils@2.19.0
|
|
75
|
+
- @atlaspack/plugin@2.14.28
|
|
76
|
+
|
|
77
|
+
## 2.14.27
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- Updated dependencies []:
|
|
82
|
+
- @atlaspack/utils@2.18.4
|
|
83
|
+
- @atlaspack/plugin@2.14.27
|
|
84
|
+
|
|
85
|
+
## 2.14.26
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
|
|
90
|
+
|
|
91
|
+
- Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
|
|
92
|
+
- @atlaspack/plugin@2.14.26
|
|
93
|
+
- @atlaspack/utils@2.18.3
|
|
94
|
+
|
|
95
|
+
## 2.14.25
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- Updated dependencies []:
|
|
100
|
+
- @atlaspack/utils@2.18.2
|
|
101
|
+
- @atlaspack/plugin@2.14.25
|
|
102
|
+
|
|
103
|
+
## 2.14.24
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- Updated dependencies []:
|
|
108
|
+
- @atlaspack/utils@2.18.1
|
|
109
|
+
- @atlaspack/plugin@2.14.24
|
|
110
|
+
|
|
111
|
+
## 2.14.23
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
|
|
116
|
+
- @atlaspack/utils@2.18.0
|
|
117
|
+
- @atlaspack/plugin@2.14.23
|
|
118
|
+
|
|
119
|
+
## 2.14.22
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- [#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
|
|
124
|
+
|
|
125
|
+
- Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
|
|
126
|
+
- @atlaspack/plugin@2.14.22
|
|
127
|
+
- @atlaspack/utils@2.17.4
|
|
128
|
+
|
|
129
|
+
## 2.14.21
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- Updated dependencies []:
|
|
134
|
+
- @atlaspack/utils@2.17.3
|
|
135
|
+
- @atlaspack/plugin@2.14.21
|
|
136
|
+
|
|
137
|
+
## 2.14.20
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- [#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
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
|
|
144
|
+
- @atlaspack/plugin@2.14.20
|
|
145
|
+
- @atlaspack/utils@2.17.2
|
|
146
|
+
|
|
147
|
+
## 2.14.19
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Updated dependencies []:
|
|
152
|
+
- @atlaspack/utils@2.17.1
|
|
153
|
+
- @atlaspack/plugin@2.14.19
|
|
154
|
+
|
|
155
|
+
## 2.14.18
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`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)]:
|
|
160
|
+
- @atlaspack/utils@2.17.0
|
|
161
|
+
- @atlaspack/plugin@2.14.18
|
|
162
|
+
|
|
163
|
+
## 2.14.17
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- Updated dependencies []:
|
|
168
|
+
- @atlaspack/utils@2.16.1
|
|
169
|
+
- @atlaspack/plugin@2.14.17
|
|
170
|
+
|
|
171
|
+
## 2.14.16
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
|
|
176
|
+
- @atlaspack/utils@2.16.0
|
|
177
|
+
- @atlaspack/plugin@2.14.16
|
|
178
|
+
|
|
179
|
+
## 2.14.15
|
|
180
|
+
|
|
181
|
+
### Patch Changes
|
|
182
|
+
|
|
183
|
+
- Updated dependencies []:
|
|
184
|
+
- @atlaspack/utils@2.15.3
|
|
185
|
+
- @atlaspack/plugin@2.14.15
|
|
186
|
+
|
|
187
|
+
## 2.14.14
|
|
188
|
+
|
|
189
|
+
### Patch Changes
|
|
190
|
+
|
|
191
|
+
- Updated dependencies []:
|
|
192
|
+
- @atlaspack/utils@2.15.2
|
|
193
|
+
- @atlaspack/plugin@2.14.14
|
|
194
|
+
|
|
195
|
+
## 2.14.13
|
|
196
|
+
|
|
197
|
+
### Patch Changes
|
|
198
|
+
|
|
199
|
+
- [#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
|
|
200
|
+
|
|
201
|
+
- Updated dependencies []:
|
|
202
|
+
- @atlaspack/utils@2.15.1
|
|
203
|
+
- @atlaspack/plugin@2.14.13
|
|
204
|
+
|
|
205
|
+
## 2.14.12
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
|
|
210
|
+
- @atlaspack/utils@2.15.0
|
|
211
|
+
- @atlaspack/plugin@2.14.12
|
|
212
|
+
|
|
213
|
+
## 2.14.11
|
|
214
|
+
|
|
215
|
+
### Patch Changes
|
|
216
|
+
|
|
217
|
+
- Updated dependencies []:
|
|
218
|
+
- @atlaspack/utils@2.14.11
|
|
219
|
+
- @atlaspack/plugin@2.14.11
|
|
220
|
+
|
|
221
|
+
## 2.14.10
|
|
222
|
+
|
|
223
|
+
### Patch Changes
|
|
224
|
+
|
|
225
|
+
- Updated dependencies []:
|
|
226
|
+
- @atlaspack/plugin@2.14.10
|
|
227
|
+
- @atlaspack/utils@2.14.10
|
|
228
|
+
|
|
229
|
+
## 2.14.9
|
|
230
|
+
|
|
231
|
+
### Patch Changes
|
|
232
|
+
|
|
233
|
+
- Updated dependencies []:
|
|
234
|
+
- @atlaspack/utils@2.14.9
|
|
235
|
+
- @atlaspack/plugin@2.14.9
|
|
236
|
+
|
|
237
|
+
## 2.14.8
|
|
238
|
+
|
|
239
|
+
### Patch Changes
|
|
240
|
+
|
|
241
|
+
- Updated dependencies []:
|
|
242
|
+
- @atlaspack/utils@2.14.8
|
|
243
|
+
- @atlaspack/plugin@2.14.8
|
|
244
|
+
|
|
3
245
|
## 2.14.7
|
|
4
246
|
|
|
5
247
|
### Patch Changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const plugin_1 = require("@atlaspack/plugin");
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
// Without this, the hmr-runtime.js is transpiled with the React Refresh swc transform because it
|
|
10
|
+
// lives in `/app/packages/runtimes/...` and thus the `config` in the JSTransformer is actually the
|
|
11
|
+
// user's package.json, and hmr-runtime.js is transpiled as a JSX asset.
|
|
12
|
+
const FILENAME =
|
|
13
|
+
// @ts-expect-error TS2339
|
|
14
|
+
process.env.ATLASPACK_BUILD_REPL && process.browser
|
|
15
|
+
? '/' + __filename
|
|
16
|
+
: __filename;
|
|
17
|
+
const HMR_RUNTIME = process.env.ATLASPACK_REGISTER_USE_SRC === 'true'
|
|
18
|
+
? fs_1.default.readFileSync(path_1.default.join(__dirname, './loaders/hmr-runtime.ts'), 'utf8')
|
|
19
|
+
: fs_1.default.readFileSync(path_1.default.join(__dirname, './loaders/hmr-runtime.js'), 'utf8');
|
|
20
|
+
exports.default = new plugin_1.Runtime({
|
|
21
|
+
apply({ bundle, options }) {
|
|
22
|
+
if (bundle.type !== 'js' ||
|
|
23
|
+
!options.hmrOptions ||
|
|
24
|
+
bundle.env.isLibrary ||
|
|
25
|
+
bundle.env.isWorklet() ||
|
|
26
|
+
bundle.env.sourceType === 'script') {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const { host, port } = options.hmrOptions;
|
|
30
|
+
return {
|
|
31
|
+
filePath: FILENAME,
|
|
32
|
+
code: `var HMR_HOST = ${JSON.stringify(host != null && host !== '0.0.0.0' ? host : null)};` +
|
|
33
|
+
`var HMR_PORT = ${JSON.stringify(port != null &&
|
|
34
|
+
// Default to the HTTP port in the browser, only override
|
|
35
|
+
// in watch mode or if hmr port != serve port
|
|
36
|
+
(!options.serveOptions || options.serveOptions.port !== port)
|
|
37
|
+
? port
|
|
38
|
+
: null)};` +
|
|
39
|
+
`var HMR_SECURE = ${JSON.stringify(!!(options.serveOptions && options.serveOptions.https))};` +
|
|
40
|
+
`var HMR_ENV_HASH = "${bundle.env.id}";` +
|
|
41
|
+
`var HMR_USE_SSE = ${JSON.stringify(
|
|
42
|
+
// @ts-expect-error TS2339
|
|
43
|
+
!!(process.env.ATLASPACK_BUILD_REPL && process.browser))};` +
|
|
44
|
+
`module.bundle.HMR_BUNDLE_ID = ${JSON.stringify(bundle.id)};` +
|
|
45
|
+
HMR_RUNTIME,
|
|
46
|
+
isEntry: true,
|
|
47
|
+
env: {
|
|
48
|
+
sourceType: 'module',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
});
|