react-refresh 0.15.0-next-5dd90c562-20230502 → 0.16.0-canary-2b036d3f1-20240327
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/cjs/react-refresh-babel.development.js +18 -0
- package/cjs/react-refresh-babel.production.js +856 -0
- package/cjs/react-refresh-babel.production.min.js +12 -10
- package/cjs/react-refresh-babel.production.min.js.map +1 -0
- package/cjs/react-refresh-runtime.development.js +0 -1
- package/cjs/react-refresh-runtime.production.js +114 -0
- package/cjs/react-refresh-runtime.production.min.js +11 -9
- package/cjs/react-refresh-runtime.production.min.js.map +1 -0
- package/package.json +2 -2
|
@@ -269,6 +269,24 @@ function ReactFreshBabelPlugin (babel) {
|
|
|
269
269
|
case 'React.useImperativeHandle':
|
|
270
270
|
case 'useDebugValue':
|
|
271
271
|
case 'React.useDebugValue':
|
|
272
|
+
case 'useId':
|
|
273
|
+
case 'React.useId':
|
|
274
|
+
case 'useDeferredValue':
|
|
275
|
+
case 'React.useDeferredValue':
|
|
276
|
+
case 'useTransition':
|
|
277
|
+
case 'React.useTransition':
|
|
278
|
+
case 'useInsertionEffect':
|
|
279
|
+
case 'React.useInsertionEffect':
|
|
280
|
+
case 'useSyncExternalStore':
|
|
281
|
+
case 'React.useSyncExternalStore':
|
|
282
|
+
case 'useFormStatus':
|
|
283
|
+
case 'React.useFormStatus':
|
|
284
|
+
case 'useFormState':
|
|
285
|
+
case 'React.useFormState':
|
|
286
|
+
case 'useActionState':
|
|
287
|
+
case 'React.useActionState':
|
|
288
|
+
case 'useOptimistic':
|
|
289
|
+
case 'React.useOptimistic':
|
|
272
290
|
return true;
|
|
273
291
|
|
|
274
292
|
default:
|
|
@@ -0,0 +1,856 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-refresh-babel.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
function ReactFreshBabelPlugin (babel) {
|
|
14
|
+
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15
|
+
|
|
16
|
+
if (typeof babel.env === 'function') {
|
|
17
|
+
// Only available in Babel 7.
|
|
18
|
+
const env = babel.env();
|
|
19
|
+
|
|
20
|
+
if (env !== 'development' && !opts.skipEnvCheck) {
|
|
21
|
+
throw new Error('React Refresh Babel transform should only be enabled in development environment. ' + 'Instead, the environment is: "' + env + '". If you want to override this check, pass {skipEnvCheck: true} as plugin options.');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const t = babel.types;
|
|
26
|
+
const refreshReg = t.identifier(opts.refreshReg || '$RefreshReg$');
|
|
27
|
+
const refreshSig = t.identifier(opts.refreshSig || '$RefreshSig$');
|
|
28
|
+
const registrationsByProgramPath = new Map();
|
|
29
|
+
|
|
30
|
+
function createRegistration(programPath, persistentID) {
|
|
31
|
+
const handle = programPath.scope.generateUidIdentifier('c');
|
|
32
|
+
|
|
33
|
+
if (!registrationsByProgramPath.has(programPath)) {
|
|
34
|
+
registrationsByProgramPath.set(programPath, []);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const registrations = registrationsByProgramPath.get(programPath);
|
|
38
|
+
registrations.push({
|
|
39
|
+
handle,
|
|
40
|
+
persistentID
|
|
41
|
+
});
|
|
42
|
+
return handle;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function isComponentishName(name) {
|
|
46
|
+
return typeof name === 'string' && name[0] >= 'A' && name[0] <= 'Z';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function findInnerComponents(inferredName, path, callback) {
|
|
50
|
+
const node = path.node;
|
|
51
|
+
|
|
52
|
+
switch (node.type) {
|
|
53
|
+
case 'Identifier':
|
|
54
|
+
{
|
|
55
|
+
if (!isComponentishName(node.name)) {
|
|
56
|
+
return false;
|
|
57
|
+
} // export default hoc(Foo)
|
|
58
|
+
// const X = hoc(Foo)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
callback(inferredName, node, null);
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
case 'FunctionDeclaration':
|
|
66
|
+
{
|
|
67
|
+
// function Foo() {}
|
|
68
|
+
// export function Foo() {}
|
|
69
|
+
// export default function Foo() {}
|
|
70
|
+
callback(inferredName, node.id, null);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
case 'ArrowFunctionExpression':
|
|
75
|
+
{
|
|
76
|
+
if (node.body.type === 'ArrowFunctionExpression') {
|
|
77
|
+
return false;
|
|
78
|
+
} // let Foo = () => {}
|
|
79
|
+
// export default hoc1(hoc2(() => {}))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
callback(inferredName, node, path);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
case 'FunctionExpression':
|
|
87
|
+
{
|
|
88
|
+
// let Foo = function() {}
|
|
89
|
+
// const Foo = hoc1(forwardRef(function renderFoo() {}))
|
|
90
|
+
// export default memo(function() {})
|
|
91
|
+
callback(inferredName, node, path);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
case 'CallExpression':
|
|
96
|
+
{
|
|
97
|
+
const argsPath = path.get('arguments');
|
|
98
|
+
|
|
99
|
+
if (argsPath === undefined || argsPath.length === 0) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const calleePath = path.get('callee');
|
|
104
|
+
|
|
105
|
+
switch (calleePath.node.type) {
|
|
106
|
+
case 'MemberExpression':
|
|
107
|
+
case 'Identifier':
|
|
108
|
+
{
|
|
109
|
+
const calleeSource = calleePath.getSource();
|
|
110
|
+
const firstArgPath = argsPath[0];
|
|
111
|
+
const innerName = inferredName + '$' + calleeSource;
|
|
112
|
+
const foundInside = findInnerComponents(innerName, firstArgPath, callback);
|
|
113
|
+
|
|
114
|
+
if (!foundInside) {
|
|
115
|
+
return false;
|
|
116
|
+
} // const Foo = hoc1(hoc2(() => {}))
|
|
117
|
+
// export default memo(React.forwardRef(function() {}))
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
callback(inferredName, node, path);
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
default:
|
|
125
|
+
{
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
case 'VariableDeclarator':
|
|
132
|
+
{
|
|
133
|
+
const init = node.init;
|
|
134
|
+
|
|
135
|
+
if (init === null) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const name = node.id.name;
|
|
140
|
+
|
|
141
|
+
if (!isComponentishName(name)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
switch (init.type) {
|
|
146
|
+
case 'ArrowFunctionExpression':
|
|
147
|
+
case 'FunctionExpression':
|
|
148
|
+
// Likely component definitions.
|
|
149
|
+
break;
|
|
150
|
+
|
|
151
|
+
case 'CallExpression':
|
|
152
|
+
{
|
|
153
|
+
// Maybe a HOC.
|
|
154
|
+
// Try to determine if this is some form of import.
|
|
155
|
+
const callee = init.callee;
|
|
156
|
+
const calleeType = callee.type;
|
|
157
|
+
|
|
158
|
+
if (calleeType === 'Import') {
|
|
159
|
+
return false;
|
|
160
|
+
} else if (calleeType === 'Identifier') {
|
|
161
|
+
if (callee.name.indexOf('require') === 0) {
|
|
162
|
+
return false;
|
|
163
|
+
} else if (callee.name.indexOf('import') === 0) {
|
|
164
|
+
return false;
|
|
165
|
+
} // Neither require nor import. Might be a HOC.
|
|
166
|
+
// Pass through.
|
|
167
|
+
|
|
168
|
+
} else ;
|
|
169
|
+
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
case 'TaggedTemplateExpression':
|
|
174
|
+
// Maybe something like styled.div`...`
|
|
175
|
+
break;
|
|
176
|
+
|
|
177
|
+
default:
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const initPath = path.get('init');
|
|
182
|
+
const foundInside = findInnerComponents(inferredName, initPath, callback);
|
|
183
|
+
|
|
184
|
+
if (foundInside) {
|
|
185
|
+
return true;
|
|
186
|
+
} // See if this identifier is used in JSX. Then it's a component.
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
const binding = path.scope.getBinding(name);
|
|
190
|
+
|
|
191
|
+
if (binding === undefined) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
let isLikelyUsedAsType = false;
|
|
196
|
+
const referencePaths = binding.referencePaths;
|
|
197
|
+
|
|
198
|
+
for (let i = 0; i < referencePaths.length; i++) {
|
|
199
|
+
const ref = referencePaths[i];
|
|
200
|
+
|
|
201
|
+
if (ref.node && ref.node.type !== 'JSXIdentifier' && ref.node.type !== 'Identifier') {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const refParent = ref.parent;
|
|
206
|
+
|
|
207
|
+
if (refParent.type === 'JSXOpeningElement') {
|
|
208
|
+
isLikelyUsedAsType = true;
|
|
209
|
+
} else if (refParent.type === 'CallExpression') {
|
|
210
|
+
const callee = refParent.callee;
|
|
211
|
+
let fnName;
|
|
212
|
+
|
|
213
|
+
switch (callee.type) {
|
|
214
|
+
case 'Identifier':
|
|
215
|
+
fnName = callee.name;
|
|
216
|
+
break;
|
|
217
|
+
|
|
218
|
+
case 'MemberExpression':
|
|
219
|
+
fnName = callee.property.name;
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
switch (fnName) {
|
|
224
|
+
case 'createElement':
|
|
225
|
+
case 'jsx':
|
|
226
|
+
case 'jsxDEV':
|
|
227
|
+
case 'jsxs':
|
|
228
|
+
isLikelyUsedAsType = true;
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (isLikelyUsedAsType) {
|
|
234
|
+
// const X = ... + later <X />
|
|
235
|
+
callback(inferredName, init, initPath);
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function isBuiltinHook(hookName) {
|
|
246
|
+
switch (hookName) {
|
|
247
|
+
case 'useState':
|
|
248
|
+
case 'React.useState':
|
|
249
|
+
case 'useReducer':
|
|
250
|
+
case 'React.useReducer':
|
|
251
|
+
case 'useEffect':
|
|
252
|
+
case 'React.useEffect':
|
|
253
|
+
case 'useLayoutEffect':
|
|
254
|
+
case 'React.useLayoutEffect':
|
|
255
|
+
case 'useMemo':
|
|
256
|
+
case 'React.useMemo':
|
|
257
|
+
case 'useCallback':
|
|
258
|
+
case 'React.useCallback':
|
|
259
|
+
case 'useRef':
|
|
260
|
+
case 'React.useRef':
|
|
261
|
+
case 'useContext':
|
|
262
|
+
case 'React.useContext':
|
|
263
|
+
case 'useImperativeHandle':
|
|
264
|
+
case 'React.useImperativeHandle':
|
|
265
|
+
case 'useDebugValue':
|
|
266
|
+
case 'React.useDebugValue':
|
|
267
|
+
case 'useId':
|
|
268
|
+
case 'React.useId':
|
|
269
|
+
case 'useDeferredValue':
|
|
270
|
+
case 'React.useDeferredValue':
|
|
271
|
+
case 'useTransition':
|
|
272
|
+
case 'React.useTransition':
|
|
273
|
+
case 'useInsertionEffect':
|
|
274
|
+
case 'React.useInsertionEffect':
|
|
275
|
+
case 'useSyncExternalStore':
|
|
276
|
+
case 'React.useSyncExternalStore':
|
|
277
|
+
case 'useFormStatus':
|
|
278
|
+
case 'React.useFormStatus':
|
|
279
|
+
case 'useFormState':
|
|
280
|
+
case 'React.useFormState':
|
|
281
|
+
case 'useActionState':
|
|
282
|
+
case 'React.useActionState':
|
|
283
|
+
case 'useOptimistic':
|
|
284
|
+
case 'React.useOptimistic':
|
|
285
|
+
return true;
|
|
286
|
+
|
|
287
|
+
default:
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function getHookCallsSignature(functionNode) {
|
|
293
|
+
const fnHookCalls = hookCalls.get(functionNode);
|
|
294
|
+
|
|
295
|
+
if (fnHookCalls === undefined) {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return {
|
|
300
|
+
key: fnHookCalls.map(call => call.name + '{' + call.key + '}').join('\n'),
|
|
301
|
+
customHooks: fnHookCalls.filter(call => !isBuiltinHook(call.name)).map(call => t.cloneDeep(call.callee))
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const hasForceResetCommentByFile = new WeakMap(); // We let user do /* @refresh reset */ to reset state in the whole file.
|
|
306
|
+
|
|
307
|
+
function hasForceResetComment(path) {
|
|
308
|
+
const file = path.hub.file;
|
|
309
|
+
let hasForceReset = hasForceResetCommentByFile.get(file);
|
|
310
|
+
|
|
311
|
+
if (hasForceReset !== undefined) {
|
|
312
|
+
return hasForceReset;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
hasForceReset = false;
|
|
316
|
+
const comments = file.ast.comments;
|
|
317
|
+
|
|
318
|
+
for (let i = 0; i < comments.length; i++) {
|
|
319
|
+
const cmt = comments[i];
|
|
320
|
+
|
|
321
|
+
if (cmt.value.indexOf('@refresh reset') !== -1) {
|
|
322
|
+
hasForceReset = true;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
hasForceResetCommentByFile.set(file, hasForceReset);
|
|
328
|
+
return hasForceReset;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function createArgumentsForSignature(node, signature, scope) {
|
|
332
|
+
const key = signature.key,
|
|
333
|
+
customHooks = signature.customHooks;
|
|
334
|
+
let forceReset = hasForceResetComment(scope.path);
|
|
335
|
+
const customHooksInScope = [];
|
|
336
|
+
customHooks.forEach(callee => {
|
|
337
|
+
// Check if a corresponding binding exists where we emit the signature.
|
|
338
|
+
let bindingName;
|
|
339
|
+
|
|
340
|
+
switch (callee.type) {
|
|
341
|
+
case 'MemberExpression':
|
|
342
|
+
if (callee.object.type === 'Identifier') {
|
|
343
|
+
bindingName = callee.object.name;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
break;
|
|
347
|
+
|
|
348
|
+
case 'Identifier':
|
|
349
|
+
bindingName = callee.name;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (scope.hasBinding(bindingName)) {
|
|
354
|
+
customHooksInScope.push(callee);
|
|
355
|
+
} else {
|
|
356
|
+
// We don't have anything to put in the array because Hook is out of scope.
|
|
357
|
+
// Since it could potentially have been edited, remount the component.
|
|
358
|
+
forceReset = true;
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
let finalKey = key;
|
|
362
|
+
|
|
363
|
+
if (typeof require === 'function' && !opts.emitFullSignatures) {
|
|
364
|
+
// Prefer to hash when we can (e.g. outside of ASTExplorer).
|
|
365
|
+
// This makes it deterministically compact, even if there's
|
|
366
|
+
// e.g. a useState initializer with some code inside.
|
|
367
|
+
// We also need it for www that has transforms like cx()
|
|
368
|
+
// that don't understand if something is part of a string.
|
|
369
|
+
finalKey = require('crypto').createHash('sha1').update(key).digest('base64');
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const args = [node, t.stringLiteral(finalKey)];
|
|
373
|
+
|
|
374
|
+
if (forceReset || customHooksInScope.length > 0) {
|
|
375
|
+
args.push(t.booleanLiteral(forceReset));
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (customHooksInScope.length > 0) {
|
|
379
|
+
args.push( // TODO: We could use an arrow here to be more compact.
|
|
380
|
+
// However, don't do it until AMA can run them natively.
|
|
381
|
+
t.functionExpression(null, [], t.blockStatement([t.returnStatement(t.arrayExpression(customHooksInScope))])));
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return args;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function findHOCCallPathsAbove(path) {
|
|
388
|
+
const calls = [];
|
|
389
|
+
|
|
390
|
+
while (true) {
|
|
391
|
+
if (!path) {
|
|
392
|
+
return calls;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const parentPath = path.parentPath;
|
|
396
|
+
|
|
397
|
+
if (!parentPath) {
|
|
398
|
+
return calls;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if ( // hoc(_c = function() { })
|
|
402
|
+
parentPath.node.type === 'AssignmentExpression' && path.node === parentPath.node.right) {
|
|
403
|
+
// Ignore registrations.
|
|
404
|
+
path = parentPath;
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
if ( // hoc1(hoc2(...))
|
|
409
|
+
parentPath.node.type === 'CallExpression' && path.node !== parentPath.node.callee) {
|
|
410
|
+
calls.push(parentPath);
|
|
411
|
+
path = parentPath;
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return calls; // Stop at other types.
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const seenForRegistration = new WeakSet();
|
|
420
|
+
const seenForSignature = new WeakSet();
|
|
421
|
+
const seenForOutro = new WeakSet();
|
|
422
|
+
const hookCalls = new WeakMap();
|
|
423
|
+
const HookCallsVisitor = {
|
|
424
|
+
CallExpression(path) {
|
|
425
|
+
const node = path.node;
|
|
426
|
+
const callee = node.callee; // Note: this visitor MUST NOT mutate the tree in any way.
|
|
427
|
+
// It runs early in a separate traversal and should be very fast.
|
|
428
|
+
|
|
429
|
+
let name = null;
|
|
430
|
+
|
|
431
|
+
switch (callee.type) {
|
|
432
|
+
case 'Identifier':
|
|
433
|
+
name = callee.name;
|
|
434
|
+
break;
|
|
435
|
+
|
|
436
|
+
case 'MemberExpression':
|
|
437
|
+
name = callee.property.name;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (name === null || !/^use[A-Z]/.test(name)) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const fnScope = path.scope.getFunctionParent();
|
|
446
|
+
|
|
447
|
+
if (fnScope === null) {
|
|
448
|
+
return;
|
|
449
|
+
} // This is a Hook call. Record it.
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
const fnNode = fnScope.block;
|
|
453
|
+
|
|
454
|
+
if (!hookCalls.has(fnNode)) {
|
|
455
|
+
hookCalls.set(fnNode, []);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const hookCallsForFn = hookCalls.get(fnNode);
|
|
459
|
+
let key = '';
|
|
460
|
+
|
|
461
|
+
if (path.parent.type === 'VariableDeclarator') {
|
|
462
|
+
// TODO: if there is no LHS, consider some other heuristic.
|
|
463
|
+
key = path.parentPath.get('id').getSource();
|
|
464
|
+
} // Some built-in Hooks reset on edits to arguments.
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
const args = path.get('arguments');
|
|
468
|
+
|
|
469
|
+
if (name === 'useState' && args.length > 0) {
|
|
470
|
+
// useState second argument is initial state.
|
|
471
|
+
key += '(' + args[0].getSource() + ')';
|
|
472
|
+
} else if (name === 'useReducer' && args.length > 1) {
|
|
473
|
+
// useReducer second argument is initial state.
|
|
474
|
+
key += '(' + args[1].getSource() + ')';
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
hookCallsForFn.push({
|
|
478
|
+
callee: path.node.callee,
|
|
479
|
+
name,
|
|
480
|
+
key
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
};
|
|
485
|
+
return {
|
|
486
|
+
visitor: {
|
|
487
|
+
ExportDefaultDeclaration(path) {
|
|
488
|
+
const node = path.node;
|
|
489
|
+
const decl = node.declaration;
|
|
490
|
+
const declPath = path.get('declaration');
|
|
491
|
+
|
|
492
|
+
if (decl.type !== 'CallExpression') {
|
|
493
|
+
// For now, we only support possible HOC calls here.
|
|
494
|
+
// Named function declarations are handled in FunctionDeclaration.
|
|
495
|
+
// Anonymous direct exports like export default function() {}
|
|
496
|
+
// are currently ignored.
|
|
497
|
+
return;
|
|
498
|
+
} // Make sure we're not mutating the same tree twice.
|
|
499
|
+
// This can happen if another Babel plugin replaces parents.
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
if (seenForRegistration.has(node)) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
seenForRegistration.add(node); // Don't mutate the tree above this point.
|
|
507
|
+
// This code path handles nested cases like:
|
|
508
|
+
// export default memo(() => {})
|
|
509
|
+
// In those cases it is more plausible people will omit names
|
|
510
|
+
// so they're worth handling despite possible false positives.
|
|
511
|
+
// More importantly, it handles the named case:
|
|
512
|
+
// export default memo(function Named() {})
|
|
513
|
+
|
|
514
|
+
const inferredName = '%default%';
|
|
515
|
+
const programPath = path.parentPath;
|
|
516
|
+
findInnerComponents(inferredName, declPath, (persistentID, targetExpr, targetPath) => {
|
|
517
|
+
if (targetPath === null) {
|
|
518
|
+
// For case like:
|
|
519
|
+
// export default hoc(Foo)
|
|
520
|
+
// we don't want to wrap Foo inside the call.
|
|
521
|
+
// Instead we assume it's registered at definition.
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
const handle = createRegistration(programPath, persistentID);
|
|
526
|
+
targetPath.replaceWith(t.assignmentExpression('=', handle, targetExpr));
|
|
527
|
+
});
|
|
528
|
+
},
|
|
529
|
+
|
|
530
|
+
FunctionDeclaration: {
|
|
531
|
+
enter(path) {
|
|
532
|
+
const node = path.node;
|
|
533
|
+
let programPath;
|
|
534
|
+
let insertAfterPath;
|
|
535
|
+
let modulePrefix = '';
|
|
536
|
+
|
|
537
|
+
switch (path.parent.type) {
|
|
538
|
+
case 'Program':
|
|
539
|
+
insertAfterPath = path;
|
|
540
|
+
programPath = path.parentPath;
|
|
541
|
+
break;
|
|
542
|
+
|
|
543
|
+
case 'TSModuleBlock':
|
|
544
|
+
insertAfterPath = path;
|
|
545
|
+
programPath = insertAfterPath.parentPath.parentPath;
|
|
546
|
+
break;
|
|
547
|
+
|
|
548
|
+
case 'ExportNamedDeclaration':
|
|
549
|
+
insertAfterPath = path.parentPath;
|
|
550
|
+
programPath = insertAfterPath.parentPath;
|
|
551
|
+
break;
|
|
552
|
+
|
|
553
|
+
case 'ExportDefaultDeclaration':
|
|
554
|
+
insertAfterPath = path.parentPath;
|
|
555
|
+
programPath = insertAfterPath.parentPath;
|
|
556
|
+
break;
|
|
557
|
+
|
|
558
|
+
default:
|
|
559
|
+
return;
|
|
560
|
+
} // These types can be nested in typescript namespace
|
|
561
|
+
// We need to find the export chain
|
|
562
|
+
// Or return if it stays local
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
if (path.parent.type === 'TSModuleBlock' || path.parent.type === 'ExportNamedDeclaration') {
|
|
566
|
+
while (programPath.type !== 'Program') {
|
|
567
|
+
if (programPath.type === 'TSModuleDeclaration') {
|
|
568
|
+
if (programPath.parentPath.type !== 'Program' && programPath.parentPath.type !== 'ExportNamedDeclaration') {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
modulePrefix = programPath.node.id.name + '$' + modulePrefix;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
programPath = programPath.parentPath;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
const id = node.id;
|
|
580
|
+
|
|
581
|
+
if (id === null) {
|
|
582
|
+
// We don't currently handle anonymous default exports.
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
const inferredName = id.name;
|
|
587
|
+
|
|
588
|
+
if (!isComponentishName(inferredName)) {
|
|
589
|
+
return;
|
|
590
|
+
} // Make sure we're not mutating the same tree twice.
|
|
591
|
+
// This can happen if another Babel plugin replaces parents.
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
if (seenForRegistration.has(node)) {
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
seenForRegistration.add(node); // Don't mutate the tree above this point.
|
|
599
|
+
|
|
600
|
+
const innerName = modulePrefix + inferredName; // export function Named() {}
|
|
601
|
+
// function Named() {}
|
|
602
|
+
|
|
603
|
+
findInnerComponents(innerName, path, (persistentID, targetExpr) => {
|
|
604
|
+
const handle = createRegistration(programPath, persistentID);
|
|
605
|
+
insertAfterPath.insertAfter(t.expressionStatement(t.assignmentExpression('=', handle, targetExpr)));
|
|
606
|
+
});
|
|
607
|
+
},
|
|
608
|
+
|
|
609
|
+
exit(path) {
|
|
610
|
+
const node = path.node;
|
|
611
|
+
const id = node.id;
|
|
612
|
+
|
|
613
|
+
if (id === null) {
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
const signature = getHookCallsSignature(node);
|
|
618
|
+
|
|
619
|
+
if (signature === null) {
|
|
620
|
+
return;
|
|
621
|
+
} // Make sure we're not mutating the same tree twice.
|
|
622
|
+
// This can happen if another Babel plugin replaces parents.
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
if (seenForSignature.has(node)) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
seenForSignature.add(node); // Don't mutate the tree above this point.
|
|
630
|
+
|
|
631
|
+
const sigCallID = path.scope.generateUidIdentifier('_s');
|
|
632
|
+
path.scope.parent.push({
|
|
633
|
+
id: sigCallID,
|
|
634
|
+
init: t.callExpression(refreshSig, [])
|
|
635
|
+
}); // The signature call is split in two parts. One part is called inside the function.
|
|
636
|
+
// This is used to signal when first render happens.
|
|
637
|
+
|
|
638
|
+
path.get('body').unshiftContainer('body', t.expressionStatement(t.callExpression(sigCallID, []))); // The second call is around the function itself.
|
|
639
|
+
// This is used to associate a type with a signature.
|
|
640
|
+
// Unlike with $RefreshReg$, this needs to work for nested
|
|
641
|
+
// declarations too. So we need to search for a path where
|
|
642
|
+
// we can insert a statement rather than hard coding it.
|
|
643
|
+
|
|
644
|
+
let insertAfterPath = null;
|
|
645
|
+
path.find(p => {
|
|
646
|
+
if (p.parentPath.isBlock()) {
|
|
647
|
+
insertAfterPath = p;
|
|
648
|
+
return true;
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
if (insertAfterPath === null) {
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
insertAfterPath.insertAfter(t.expressionStatement(t.callExpression(sigCallID, createArgumentsForSignature(id, signature, insertAfterPath.scope))));
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
},
|
|
660
|
+
'ArrowFunctionExpression|FunctionExpression': {
|
|
661
|
+
exit(path) {
|
|
662
|
+
const node = path.node;
|
|
663
|
+
const signature = getHookCallsSignature(node);
|
|
664
|
+
|
|
665
|
+
if (signature === null) {
|
|
666
|
+
return;
|
|
667
|
+
} // Make sure we're not mutating the same tree twice.
|
|
668
|
+
// This can happen if another Babel plugin replaces parents.
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
if (seenForSignature.has(node)) {
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
seenForSignature.add(node); // Don't mutate the tree above this point.
|
|
676
|
+
|
|
677
|
+
const sigCallID = path.scope.generateUidIdentifier('_s');
|
|
678
|
+
path.scope.parent.push({
|
|
679
|
+
id: sigCallID,
|
|
680
|
+
init: t.callExpression(refreshSig, [])
|
|
681
|
+
}); // The signature call is split in two parts. One part is called inside the function.
|
|
682
|
+
// This is used to signal when first render happens.
|
|
683
|
+
|
|
684
|
+
if (path.node.body.type !== 'BlockStatement') {
|
|
685
|
+
path.node.body = t.blockStatement([t.returnStatement(path.node.body)]);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
path.get('body').unshiftContainer('body', t.expressionStatement(t.callExpression(sigCallID, []))); // The second call is around the function itself.
|
|
689
|
+
// This is used to associate a type with a signature.
|
|
690
|
+
|
|
691
|
+
if (path.parent.type === 'VariableDeclarator') {
|
|
692
|
+
let insertAfterPath = null;
|
|
693
|
+
path.find(p => {
|
|
694
|
+
if (p.parentPath.isBlock()) {
|
|
695
|
+
insertAfterPath = p;
|
|
696
|
+
return true;
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
if (insertAfterPath === null) {
|
|
701
|
+
return;
|
|
702
|
+
} // Special case when a function would get an inferred name:
|
|
703
|
+
// let Foo = () => {}
|
|
704
|
+
// let Foo = function() {}
|
|
705
|
+
// We'll add signature it on next line so that
|
|
706
|
+
// we don't mess up the inferred 'Foo' function name.
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
insertAfterPath.insertAfter(t.expressionStatement(t.callExpression(sigCallID, createArgumentsForSignature(path.parent.id, signature, insertAfterPath.scope)))); // Result: let Foo = () => {}; __signature(Foo, ...);
|
|
710
|
+
} else {
|
|
711
|
+
// let Foo = hoc(() => {})
|
|
712
|
+
const paths = [path].concat(findHOCCallPathsAbove(path));
|
|
713
|
+
paths.forEach(p => {
|
|
714
|
+
p.replaceWith(t.callExpression(sigCallID, createArgumentsForSignature(p.node, signature, p.scope)));
|
|
715
|
+
}); // Result: let Foo = __signature(hoc(__signature(() => {}, ...)), ...)
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
},
|
|
720
|
+
|
|
721
|
+
VariableDeclaration(path) {
|
|
722
|
+
const node = path.node;
|
|
723
|
+
let programPath;
|
|
724
|
+
let insertAfterPath;
|
|
725
|
+
let modulePrefix = '';
|
|
726
|
+
|
|
727
|
+
switch (path.parent.type) {
|
|
728
|
+
case 'Program':
|
|
729
|
+
insertAfterPath = path;
|
|
730
|
+
programPath = path.parentPath;
|
|
731
|
+
break;
|
|
732
|
+
|
|
733
|
+
case 'TSModuleBlock':
|
|
734
|
+
insertAfterPath = path;
|
|
735
|
+
programPath = insertAfterPath.parentPath.parentPath;
|
|
736
|
+
break;
|
|
737
|
+
|
|
738
|
+
case 'ExportNamedDeclaration':
|
|
739
|
+
insertAfterPath = path.parentPath;
|
|
740
|
+
programPath = insertAfterPath.parentPath;
|
|
741
|
+
break;
|
|
742
|
+
|
|
743
|
+
case 'ExportDefaultDeclaration':
|
|
744
|
+
insertAfterPath = path.parentPath;
|
|
745
|
+
programPath = insertAfterPath.parentPath;
|
|
746
|
+
break;
|
|
747
|
+
|
|
748
|
+
default:
|
|
749
|
+
return;
|
|
750
|
+
} // These types can be nested in typescript namespace
|
|
751
|
+
// We need to find the export chain
|
|
752
|
+
// Or return if it stays local
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
if (path.parent.type === 'TSModuleBlock' || path.parent.type === 'ExportNamedDeclaration') {
|
|
756
|
+
while (programPath.type !== 'Program') {
|
|
757
|
+
if (programPath.type === 'TSModuleDeclaration') {
|
|
758
|
+
if (programPath.parentPath.type !== 'Program' && programPath.parentPath.type !== 'ExportNamedDeclaration') {
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
modulePrefix = programPath.node.id.name + '$' + modulePrefix;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
programPath = programPath.parentPath;
|
|
766
|
+
}
|
|
767
|
+
} // Make sure we're not mutating the same tree twice.
|
|
768
|
+
// This can happen if another Babel plugin replaces parents.
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
if (seenForRegistration.has(node)) {
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
seenForRegistration.add(node); // Don't mutate the tree above this point.
|
|
776
|
+
|
|
777
|
+
const declPaths = path.get('declarations');
|
|
778
|
+
|
|
779
|
+
if (declPaths.length !== 1) {
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
const declPath = declPaths[0];
|
|
784
|
+
const inferredName = declPath.node.id.name;
|
|
785
|
+
const innerName = modulePrefix + inferredName;
|
|
786
|
+
findInnerComponents(innerName, declPath, (persistentID, targetExpr, targetPath) => {
|
|
787
|
+
if (targetPath === null) {
|
|
788
|
+
// For case like:
|
|
789
|
+
// export const Something = hoc(Foo)
|
|
790
|
+
// we don't want to wrap Foo inside the call.
|
|
791
|
+
// Instead we assume it's registered at definition.
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
const handle = createRegistration(programPath, persistentID);
|
|
796
|
+
|
|
797
|
+
if (targetPath.parent.type === 'VariableDeclarator') {
|
|
798
|
+
// Special case when a variable would get an inferred name:
|
|
799
|
+
// let Foo = () => {}
|
|
800
|
+
// let Foo = function() {}
|
|
801
|
+
// let Foo = styled.div``;
|
|
802
|
+
// We'll register it on next line so that
|
|
803
|
+
// we don't mess up the inferred 'Foo' function name.
|
|
804
|
+
// (eg: with @babel/plugin-transform-react-display-name or
|
|
805
|
+
// babel-plugin-styled-components)
|
|
806
|
+
insertAfterPath.insertAfter(t.expressionStatement(t.assignmentExpression('=', handle, declPath.node.id))); // Result: let Foo = () => {}; _c1 = Foo;
|
|
807
|
+
} else {
|
|
808
|
+
// let Foo = hoc(() => {})
|
|
809
|
+
targetPath.replaceWith(t.assignmentExpression('=', handle, targetExpr)); // Result: let Foo = hoc(_c1 = () => {})
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
},
|
|
813
|
+
|
|
814
|
+
Program: {
|
|
815
|
+
enter(path) {
|
|
816
|
+
// This is a separate early visitor because we need to collect Hook calls
|
|
817
|
+
// and "const [foo, setFoo] = ..." signatures before the destructuring
|
|
818
|
+
// transform mangles them. This extra traversal is not ideal for perf,
|
|
819
|
+
// but it's the best we can do until we stop transpiling destructuring.
|
|
820
|
+
path.traverse(HookCallsVisitor);
|
|
821
|
+
},
|
|
822
|
+
|
|
823
|
+
exit(path) {
|
|
824
|
+
const registrations = registrationsByProgramPath.get(path);
|
|
825
|
+
|
|
826
|
+
if (registrations === undefined) {
|
|
827
|
+
return;
|
|
828
|
+
} // Make sure we're not mutating the same tree twice.
|
|
829
|
+
// This can happen if another Babel plugin replaces parents.
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
const node = path.node;
|
|
833
|
+
|
|
834
|
+
if (seenForOutro.has(node)) {
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
seenForOutro.add(node); // Don't mutate the tree above this point.
|
|
839
|
+
|
|
840
|
+
registrationsByProgramPath.delete(path);
|
|
841
|
+
const declarators = [];
|
|
842
|
+
path.pushContainer('body', t.variableDeclaration('var', declarators));
|
|
843
|
+
registrations.forEach((_ref) => {
|
|
844
|
+
let handle = _ref.handle,
|
|
845
|
+
persistentID = _ref.persistentID;
|
|
846
|
+
path.pushContainer('body', t.expressionStatement(t.callExpression(refreshReg, [handle, t.stringLiteral(persistentID)])));
|
|
847
|
+
declarators.push(t.variableDeclarator(handle));
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
module.exports = ReactFreshBabelPlugin;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/*
|
|
2
|
+
React
|
|
3
|
+
react-refresh-babel.production.min.js
|
|
4
|
+
|
|
5
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
This source code is licensed under the MIT license found in the
|
|
8
|
+
LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
10
|
'use strict';module.exports=function(u){function v(a,b){var e=a.scope.generateUidIdentifier("c");n.has(a)||n.set(a,[]);n.get(a).push({handle:e,persistentID:b});return e}function w(a){return"string"===typeof a&&"A"<=a[0]&&"Z">=a[0]}function p(a,b,e){var c=b.node;switch(c.type){case "Identifier":if(!w(c.name))break;e(a,c,null);return!0;case "FunctionDeclaration":return e(a,c.id,null),!0;case "ArrowFunctionExpression":if("ArrowFunctionExpression"===c.body.type)break;e(a,c,b);return!0;case "FunctionExpression":return e(a,
|
|
11
11
|
c,b),!0;case "CallExpression":var d=b.get("arguments");if(void 0===d||0===d.length)break;var f=b.get("callee");switch(f.node.type){case "MemberExpression":case "Identifier":f=f.getSource();if(!p(a+"$"+f,d[0],e))return!1;e(a,c,b);return!0;default:return!1}case "VariableDeclarator":if(d=c.init,null!==d&&(f=c.id.name,w(f))){switch(d.type){case "ArrowFunctionExpression":case "FunctionExpression":break;case "CallExpression":c=d.callee;var h=c.type;if("Import"===h||"Identifier"===h&&(0===c.name.indexOf("require")||
|
|
12
12
|
0===c.name.indexOf("import")))return!1;break;case "TaggedTemplateExpression":break;default:return!1}c=b.get("init");if(p(a,c,e))return!0;f=b.scope.getBinding(f);if(void 0===f)return;b=!1;f=f.referencePaths;for(h=0;h<f.length;h++){var k=f[h];if(!k.node||"JSXIdentifier"===k.node.type||"Identifier"===k.node.type){k=k.parent;if("JSXOpeningElement"===k.type)b=!0;else if("CallExpression"===k.type){k=k.callee;var l=void 0;switch(k.type){case "Identifier":l=k.name;break;case "MemberExpression":l=k.property.name}switch(l){case "createElement":case "jsx":case "jsxDEV":case "jsxs":b=
|
|
13
|
-
!0}}if(b)return e(a,d,c),!0}}}}return!1}function y(a){a=q.get(a);return void 0===a?null:{key:a.map(function(b){return b.name+"{"+b.key+"}"}).join("\n"),customHooks:a.filter(function(b){a:switch(b.name){case "useState":case "React.useState":case "useReducer":case "React.useReducer":case "useEffect":case "React.useEffect":case "useLayoutEffect":case "React.useLayoutEffect":case "useMemo":case "React.useMemo":case "useCallback":case "React.useCallback":case "useRef":case "React.useRef":case "useContext":case "React.useContext":case "useImperativeHandle":case "React.useImperativeHandle":case "useDebugValue":case "React.useDebugValue":b=
|
|
13
|
+
!0}}if(b)return e(a,d,c),!0}}}}return!1}function y(a){a=q.get(a);return void 0===a?null:{key:a.map(function(b){return b.name+"{"+b.key+"}"}).join("\n"),customHooks:a.filter(function(b){a:switch(b.name){case "useState":case "React.useState":case "useReducer":case "React.useReducer":case "useEffect":case "React.useEffect":case "useLayoutEffect":case "React.useLayoutEffect":case "useMemo":case "React.useMemo":case "useCallback":case "React.useCallback":case "useRef":case "React.useRef":case "useContext":case "React.useContext":case "useImperativeHandle":case "React.useImperativeHandle":case "useDebugValue":case "React.useDebugValue":case "useId":case "React.useId":case "useDeferredValue":case "React.useDeferredValue":case "useTransition":case "React.useTransition":case "useInsertionEffect":case "React.useInsertionEffect":case "useSyncExternalStore":case "React.useSyncExternalStore":case "useFormStatus":case "React.useFormStatus":case "useFormState":case "React.useFormState":case "useActionState":case "React.useActionState":case "useOptimistic":case "React.useOptimistic":b=
|
|
14
14
|
!0;break a;default:b=!1}return!b}).map(function(b){return g.cloneDeep(b.callee)})}}function D(a){a=a.hub.file;var b=z.get(a);if(void 0!==b)return b;b=!1;for(var e=a.ast.comments,c=0;c<e.length;c++)if(-1!==e[c].value.indexOf("@refresh reset")){b=!0;break}z.set(a,b);return b}function x(a,b,e){var c=b.key;b=b.customHooks;var d=D(e.path),f=[];b.forEach(function(h){switch(h.type){case "MemberExpression":if("Identifier"===h.object.type)var k=h.object.name;break;case "Identifier":k=h.name}e.hasBinding(k)?
|
|
15
15
|
f.push(h):d=!0});b=c;"function"!==typeof require||r.emitFullSignatures||(b=require("crypto").createHash("sha1").update(c).digest("base64"));a=[a,g.stringLiteral(b)];(d||0<f.length)&&a.push(g.booleanLiteral(d));0<f.length&&a.push(g.functionExpression(null,[],g.blockStatement([g.returnStatement(g.arrayExpression(f))])));return a}function E(a){for(var b=[];;){if(!a)return b;var e=a.parentPath;if(!e)return b;if("AssignmentExpression"===e.node.type&&a.node===e.node.right)a=e;else if("CallExpression"===
|
|
16
16
|
e.node.type&&a.node!==e.node.callee)b.push(e),a=e;else return b}}var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"===typeof u.env){var A=u.env();if("development"!==A&&!r.skipEnvCheck)throw Error('React Refresh Babel transform should only be enabled in development environment. Instead, the environment is: "'+A+'". If you want to override this check, pass {skipEnvCheck: true} as plugin options.');}var g=u.types,F=g.identifier(r.refreshReg||"$RefreshReg$"),B=g.identifier(r.refreshSig||
|
|
@@ -22,3 +22,5 @@ null!==d&&d.insertAfter(g.expressionStatement(g.callExpression(b,x(e,c,d.scope))
|
|
|
22
22
|
a.parent.type){var d=null;a.find(function(f){if(f.parentPath.isBlock())return d=f,!0});null!==d&&d.insertAfter(g.expressionStatement(g.callExpression(c,x(a.parent.id,e,d.scope))))}else[a].concat(E(a)).forEach(function(f){f.replaceWith(g.callExpression(c,x(f.node,e,f.scope)))})}}},VariableDeclaration:function(a){var b=a.node,e="";switch(a.parent.type){case "Program":var c=a;var d=a.parentPath;break;case "TSModuleBlock":c=a;d=c.parentPath.parentPath;break;case "ExportNamedDeclaration":c=a.parentPath;
|
|
23
23
|
d=c.parentPath;break;case "ExportDefaultDeclaration":c=a.parentPath;d=c.parentPath;break;default:return}if("TSModuleBlock"===a.parent.type||"ExportNamedDeclaration"===a.parent.type)for(;"Program"!==d.type;){if("TSModuleDeclaration"===d.type){if("Program"!==d.parentPath.type&&"ExportNamedDeclaration"!==d.parentPath.type)return;e=d.node.id.name+"$"+e}d=d.parentPath}if(!m.has(b)&&(m.add(b),a=a.get("declarations"),1===a.length)){var f=a[0];p(e+f.node.id.name,f,function(h,k,l){null!==l&&(h=v(d,h),"VariableDeclarator"===
|
|
24
24
|
l.parent.type?c.insertAfter(g.expressionStatement(g.assignmentExpression("=",h,f.node.id))):l.replaceWith(g.assignmentExpression("=",h,k)))})}},Program:{enter:function(a){a.traverse(G)},exit:function(a){var b=n.get(a);if(void 0!==b){var e=a.node;if(!C.has(e)){C.add(e);n.delete(a);var c=[];a.pushContainer("body",g.variableDeclaration("var",c));b.forEach(function(d){var f=d.handle;a.pushContainer("body",g.expressionStatement(g.callExpression(F,[f,g.stringLiteral(d.persistentID)])));c.push(g.variableDeclarator(f))})}}}}}}};
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=react-refresh-babel.production.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-refresh-babel.production.min.js","lineCount":24,"mappings":"A;;;;;;;;;aAu1BAA,MAAOC,CAAAA,OAAP,CA30BAC,QAA+B,CAACC,CAAD,CAAQ,CAiBrCC,QAASA,EAAkB,CAACC,CAAD,CAAcC,CAAd,CAA4B,CACrD,IAAMC,EAASF,CAAYG,CAAAA,KAAMC,CAAAA,qBAAlB,CAAwC,GAAxC,CAEVC,EAA2BC,CAAAA,GAA3B,CAA+BN,CAA/B,CAAL,EACEK,CAA2BE,CAAAA,GAA3B,CAA+BP,CAA/B,CAA4C,EAA5C,CAGoBK,EAA2BG,CAAAA,GAA3BC,CAA+BT,CAA/BS,CACRC,CAAAA,IAAd,CAAmB,CACjBR,OAAAA,CADiB,CAEjBD,aAAAA,CAFiB,CAAnB,CAIA,OAAOC,EAZ8C,CAevDS,QAASA,EAAkB,CAACC,CAAD,CAAO,CAChC,MAAuB,QAAvB,GAAO,MAAOA,EAAd,EAA8C,GAA9C,EAAmCA,CAAA,CAAK,CAAL,CAAnC,EAAgE,GAAhE,EAAqDA,CAAA,CAAK,CAAL,CADrB,CAIlCC,QAASA,EAAmB,CAACC,CAAD,CAAeC,CAAf,CAAqBC,CAArB,CAA+B,CACzD,IAAMC,EAAOF,CAAKE,CAAAA,IAElB,QAAQA,CAAKC,CAAAA,IAAb,EACE,KAAK,YAAL,CAEI,GAAI,CAACP,CAAA,CAAmBM,CAAKL,CAAAA,IAAxB,CAAL,CACE,KAKFI,EAAA,CAASF,CAAT,CAAuBG,CAAvB,CAA6B,IAA7B,CACA,OAAO,CAAA,CAGX,MAAK,qBAAL,CAMI,MADAD,EAAA,CAASF,CAAT,CAAuBG,CAAKE,CAA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AAuF,CAAalG,CAAAA,GAAb,CAAiBW,CAAjB,CAAJ,CAAA,CAIAuF,CAAac,CAAAA,GAAb,CAAiBrG,CAAjB,CAEAZ,EAA2ByI,CAAAA,MAA3B,CAAkC/H,CAAlC,CACA,KAAMgI,EAAc,EACpBhI,EAAKiI,CAAAA,aAAL,CAAmB,MAAnB,CAA2B1F,CAAE2F,CAAAA,mBAAF,CAAsB,KAAtB,CAA6BF,CAA7B,CAA3B,CACAtI,EAAc4D,CAAAA,OAAd,CAAsB,QAAA,CAAC6E,CAAD,CAAU,CAAA,IAC1BhJ,EAASgJ,CAAKhJ,CAAAA,MAElBa,EAAKiI,CAAAA,aAAL,CAAmB,MAAnB,CAA2B1F,CAAE0E,CAAAA,mBAAF,CAAsB1E,CAAE6E,CAAAA,cAAF,CAAiBnC,CAAjB,CAA6B,CAAC9F,CAAD,CAASoD,CAAE2B,CAAAA,aAAF,CADpEiE,CAAKjJ,CAAAA,YAC+D,CAAT,CAA7B,CAAtB,CAA3B,CACA8I,EAAYrI,CAAAA,IAAZ,CAAiB4C,CAAE6F,CAAAA,kBAAF,CAAqBjJ,CAArB,CAAjB,CAJ8B,CAAhC,CATA,CARA,CAHS,CATJ,CAxUF,CADJ,CAxd8B;","sources":["react-refresh-babel.production.js"],"names":["module","exports","ReactFreshBabelPlugin","babel","createRegistration","programPath","persistentID","handle","scope","generateUidIdentifier","registrationsByProgramPath","has","set","get","registrations","push","isComponentishName","name","findInnerComponents","inferredName","path","callback","node","type","id","body","argsPath","undefined","length","calleePath","calleeSource","getSource","foundInside","firstArgPath","init","callee","calleeType","indexOf","initPath","binding","getBinding","isLikelyUsedAsType","referencePaths","i","ref","refParent","parent","fnName","property","getHookCallsSignature","functionNode","fnHookCalls","hookCalls","key","map","call","join","customHooks","filter","t","cloneDeep","hasForceResetComment","file","hub","hasForceReset","hasForceResetCommentByFile","comments","ast","cmt","value","createArgumentsForSignature","signature","forceReset","customHooksInScope","forEach","object","bindingName","hasBinding","finalKey","require","opts","emitFullSignatures","createHash","update","digest","args","stringLiteral","booleanLiteral","functionExpression","blockStatement","returnStatement","arrayExpression","findHOCCallPathsAbove","calls","parentPath","right","arguments","env","skipEnvCheck","Error","types","refreshReg","identifier","refreshSig","Map","WeakMap","seenForRegistration","WeakSet","seenForSignature","seenForOutro","HookCallsVisitor","CallExpression","test","fnScope","getFunctionParent","fnNode","block","hookCallsForFn","visitor","ExportDefaultDeclaration","decl","declaration","declPath","add","targetExpr","targetPath","replaceWith","assignmentExpression","FunctionDeclaration","enter","modulePrefix","insertAfterPath","insertAfter","expressionStatement","exit","sigCallID","callExpression","unshiftContainer","find","p","isBlock","concat","paths","VariableDeclaration","declPaths","Program","traverse","delete","declarators","pushContainer","variableDeclaration","_ref","variableDeclarator"],"ignoreList":[0]}
|
|
@@ -557,7 +557,6 @@ function createSignatureFunctionForTransform() {
|
|
|
557
557
|
// in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).
|
|
558
558
|
if (!savedType) {
|
|
559
559
|
// We're in the innermost call, so this is the actual type.
|
|
560
|
-
// $FlowFixMe[escaped-generic] discovered when updating Flow
|
|
561
560
|
savedType = type;
|
|
562
561
|
hasCustomHooks = typeof getCustomHooks === 'function';
|
|
563
562
|
} // Set the signature for all types (even wrappers!) in case
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-refresh-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
throw new Error('React Refresh runtime should not be included in the production bundle.');
|
|
15
|
+
} // In old environments, we'll leak previous types after every edit.
|
|
16
|
+
|
|
17
|
+
function performReactRefresh() {
|
|
18
|
+
{
|
|
19
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function register(type, id) {
|
|
23
|
+
{
|
|
24
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function setSignature(type, key) {
|
|
28
|
+
|
|
29
|
+
{
|
|
30
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
31
|
+
}
|
|
32
|
+
} // This is lazily called during first render for a type.
|
|
33
|
+
// It captures Hook list at that time so inline requires don't break comparisons.
|
|
34
|
+
|
|
35
|
+
function collectCustomHooksForSignature(type) {
|
|
36
|
+
{
|
|
37
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function getFamilyByID(id) {
|
|
41
|
+
{
|
|
42
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function getFamilyByType(type) {
|
|
46
|
+
{
|
|
47
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function findAffectedHostInstances(families) {
|
|
51
|
+
{
|
|
52
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function injectIntoGlobalHook(globalObject) {
|
|
56
|
+
{
|
|
57
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function hasUnrecoverableErrors() {
|
|
61
|
+
// TODO: delete this after removing dependency in RN.
|
|
62
|
+
return false;
|
|
63
|
+
} // Exposed for testing.
|
|
64
|
+
|
|
65
|
+
function _getMountedRootCount() {
|
|
66
|
+
{
|
|
67
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
68
|
+
}
|
|
69
|
+
} // This is a wrapper over more primitive functions for setting signature.
|
|
70
|
+
// Signatures let us decide whether the Hook order has changed on refresh.
|
|
71
|
+
//
|
|
72
|
+
// This function is intended to be used as a transform target, e.g.:
|
|
73
|
+
// var _s = createSignatureFunctionForTransform()
|
|
74
|
+
//
|
|
75
|
+
// function Hello() {
|
|
76
|
+
// const [foo, setFoo] = useState(0);
|
|
77
|
+
// const value = useCustomHook();
|
|
78
|
+
// _s(); /* Call without arguments triggers collecting the custom Hook list.
|
|
79
|
+
// * This doesn't happen during the module evaluation because we
|
|
80
|
+
// * don't want to change the module order with inline requires.
|
|
81
|
+
// * Next calls are noops. */
|
|
82
|
+
// return <h1>Hi</h1>;
|
|
83
|
+
// }
|
|
84
|
+
//
|
|
85
|
+
// /* Call with arguments attaches the signature to the type: */
|
|
86
|
+
// _s(
|
|
87
|
+
// Hello,
|
|
88
|
+
// 'useState{[foo, setFoo]}(0)',
|
|
89
|
+
// () => [useCustomHook], /* Lazy to avoid triggering inline requires */
|
|
90
|
+
// );
|
|
91
|
+
|
|
92
|
+
function createSignatureFunctionForTransform() {
|
|
93
|
+
{
|
|
94
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function isLikelyComponentType(type) {
|
|
98
|
+
{
|
|
99
|
+
throw new Error('Unexpected call to React Refresh in a production environment.');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
exports._getMountedRootCount = _getMountedRootCount;
|
|
104
|
+
exports.collectCustomHooksForSignature = collectCustomHooksForSignature;
|
|
105
|
+
exports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;
|
|
106
|
+
exports.findAffectedHostInstances = findAffectedHostInstances;
|
|
107
|
+
exports.getFamilyByID = getFamilyByID;
|
|
108
|
+
exports.getFamilyByType = getFamilyByType;
|
|
109
|
+
exports.hasUnrecoverableErrors = hasUnrecoverableErrors;
|
|
110
|
+
exports.injectIntoGlobalHook = injectIntoGlobalHook;
|
|
111
|
+
exports.isLikelyComponentType = isLikelyComponentType;
|
|
112
|
+
exports.performReactRefresh = performReactRefresh;
|
|
113
|
+
exports.register = register;
|
|
114
|
+
exports.setSignature = setSignature;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/*
|
|
2
|
+
React
|
|
3
|
+
react-refresh-runtime.production.min.js
|
|
4
|
+
|
|
5
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
This source code is licensed under the MIT license found in the
|
|
8
|
+
LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
10
|
'use strict';throw Error("React Refresh runtime should not be included in the production bundle.");
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=react-refresh-runtime.production.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-refresh-runtime.production.min.js","lineCount":10,"mappings":"A;;;;;;;;;aAaE,KAAUA,MAAJ,CAAU,wEAAV,CAAN;","sources":["react-refresh-runtime.production.js"],"names":["Error"],"ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.
|
|
8
|
-
"homepage": "https://
|
|
7
|
+
"version": "0.16.0-canary-2b036d3f1-20240327",
|
|
8
|
+
"homepage": "https://react.dev/",
|
|
9
9
|
"bugs": "https://github.com/facebook/react/issues",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"files": [
|