Socket
Socket
Sign inDemoInstall

react-refresh

Package Overview
Dependencies
0
Maintainers
10
Versions
1554
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0-experimental-8af27aeed to 0.0.0-experimental-8afa144bd-20240416

cjs/react-refresh-babel.production.js

116

cjs/react-refresh-babel.development.js

@@ -1,5 +0,6 @@

/** @license React vundefined
/**
* @license React
* react-refresh-babel.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -171,3 +172,3 @@ * This source code is licensed under the MIT license found in the

}
} else ;

@@ -272,2 +273,20 @@ break;

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':
return true;

@@ -381,2 +400,34 @@

function findHOCCallPathsAbove(path) {
var calls = [];
while (true) {
if (!path) {
return calls;
}
var parentPath = path.parentPath;
if (!parentPath) {
return calls;
}
if ( // hoc(_c = function() { })
parentPath.node.type === 'AssignmentExpression' && path.node === parentPath.node.right) {
// Ignore registrations.
path = parentPath;
continue;
}
if ( // hoc1(hoc2(...))
parentPath.node.type === 'CallExpression' && path.node !== parentPath.node.callee) {
calls.push(parentPath);
path = parentPath;
continue;
}
return calls; // Stop at other types.
}
}
var seenForRegistration = new WeakSet();

@@ -496,2 +547,3 @@ var seenForSignature = new WeakSet();

var insertAfterPath;
var modulePrefix = '';

@@ -504,2 +556,7 @@ switch (path.parent.type) {

case 'TSModuleBlock':
insertAfterPath = path;
programPath = insertAfterPath.parentPath.parentPath;
break;
case 'ExportNamedDeclaration':

@@ -517,2 +574,19 @@ insertAfterPath = path.parentPath;

return;
} // These types can be nested in typescript namespace
// We need to find the export chain
// Or return if it stays local
if (path.parent.type === 'TSModuleBlock' || path.parent.type === 'ExportNamedDeclaration') {
while (programPath.type !== 'Program') {
if (programPath.type === 'TSModuleDeclaration') {
if (programPath.parentPath.type !== 'Program' && programPath.parentPath.type !== 'ExportNamedDeclaration') {
return;
}
modulePrefix = programPath.node.id.name + '$' + modulePrefix;
}
programPath = programPath.parentPath;
}
}

@@ -540,6 +614,7 @@

seenForRegistration.add(node); // Don't mutate the tree above this point.
// export function Named() {}
var innerName = modulePrefix + inferredName; // export function Named() {}
// function Named() {}
findInnerComponents(inferredName, path, function (persistentID, targetExpr) {
findInnerComponents(innerName, path, function (persistentID, targetExpr) {
var handle = createRegistration(programPath, persistentID);

@@ -651,3 +726,6 @@ insertAfterPath.insertAfter(t.expressionStatement(t.assignmentExpression('=', handle, targetExpr)));

// let Foo = hoc(() => {})
path.replaceWith(t.callExpression(sigCallID, createArgumentsForSignature(node, signature, path.scope))); // Result: let Foo = hoc(__signature(() => {}, ...))
var paths = [path].concat(findHOCCallPathsAbove(path));
paths.forEach(function (p) {
p.replaceWith(t.callExpression(sigCallID, createArgumentsForSignature(p.node, signature, p.scope)));
}); // Result: let Foo = __signature(hoc(__signature(() => {}, ...)), ...)
}

@@ -660,2 +738,3 @@ }

var insertAfterPath;
var modulePrefix = '';

@@ -668,2 +747,7 @@ switch (path.parent.type) {

case 'TSModuleBlock':
insertAfterPath = path;
programPath = insertAfterPath.parentPath.parentPath;
break;
case 'ExportNamedDeclaration':

@@ -681,2 +765,19 @@ insertAfterPath = path.parentPath;

return;
} // These types can be nested in typescript namespace
// We need to find the export chain
// Or return if it stays local
if (path.parent.type === 'TSModuleBlock' || path.parent.type === 'ExportNamedDeclaration') {
while (programPath.type !== 'Program') {
if (programPath.type === 'TSModuleDeclaration') {
if (programPath.parentPath.type !== 'Program' && programPath.parentPath.type !== 'ExportNamedDeclaration') {
return;
}
modulePrefix = programPath.node.id.name + '$' + modulePrefix;
}
programPath = programPath.parentPath;
}
} // Make sure we're not mutating the same tree twice.

@@ -700,3 +801,4 @@ // This can happen if another Babel plugin replaces parents.

var inferredName = declPath.node.id.name;
findInnerComponents(inferredName, declPath, function (persistentID, targetExpr, targetPath) {
var innerName = modulePrefix + inferredName;
findInnerComponents(innerName, declPath, function (persistentID, targetExpr, targetPath) {
if (targetPath === null) {

@@ -703,0 +805,0 @@ // For case like:

47

cjs/react-refresh-babel.production.min.js

@@ -1,21 +0,26 @@

/** @license React vundefined
* react-refresh-babel.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';module.exports=function(r){function t(a,b){var d=a.scope.generateUidIdentifier("c");l.has(a)||l.set(a,[]);l.get(a).push({handle:d,persistentID:b});return d}function u(a){return"string"===typeof a&&"A"<=a[0]&&"Z">=a[0]}function m(a,b,d){var c=b.node;switch(c.type){case "Identifier":if(!u(c.name))break;d(a,c,null);return!0;case "FunctionDeclaration":return d(a,c.id,null),!0;case "ArrowFunctionExpression":if("ArrowFunctionExpression"===c.body.type)break;d(a,c,b);return!0;case "FunctionExpression":return d(a,
c,b),!0;case "CallExpression":var f=b.get("arguments");if(void 0===f||0===f.length)break;var g=b.get("callee");switch(g.node.type){case "MemberExpression":case "Identifier":g=g.getSource();if(!m(a+"$"+g,f[0],d))return!1;d(a,c,b);return!0;default:return!1}case "VariableDeclarator":if(f=c.init,null!==f&&(g=c.id.name,u(g))){switch(f.type){case "ArrowFunctionExpression":case "FunctionExpression":break;case "CallExpression":c=f.callee;var e=c.type;if("Import"===e||"Identifier"===e&&(0===c.name.indexOf("require")||
0===c.name.indexOf("import")))return!1;break;case "TaggedTemplateExpression":break;default:return!1}c=b.get("init");if(m(a,c,d))return!0;g=b.scope.getBinding(g);if(void 0===g)return;b=!1;g=g.referencePaths;for(e=0;e<g.length;e++){var h=g[e];if(!h.node||"JSXIdentifier"===h.node.type||"Identifier"===h.node.type){h=h.parent;if("JSXOpeningElement"===h.type)b=!0;else if("CallExpression"===h.type){h=h.callee;var k=void 0;switch(h.type){case "Identifier":k=h.name;break;case "MemberExpression":k=h.property.name}switch(k){case "createElement":case "jsx":case "jsxDEV":case "jsxs":b=
!0}}if(b)return d(a,f,c),!0}}}}return!1}function w(a){a=n.get(a);return void 0===a?null:{key:a.map(function(a){return a.name+"{"+a.key+"}"}).join("\n"),customHooks:a.filter(function(a){a:switch(a.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":a=
!0;break a;default:a=!1}return!a}).map(function(a){return e.cloneDeep(a.callee)})}}function B(a){a=a.hub.file;var b=x.get(a);if(void 0!==b)return b;b=!1;for(var d=a.ast.comments,c=0;c<d.length;c++)if(-1!==d[c].value.indexOf("@refresh reset")){b=!0;break}x.set(a,b);return b}function v(a,b,d){var c=b.key;b=b.customHooks;var f=B(d.path),g=[];b.forEach(function(a){switch(a.type){case "MemberExpression":if("Identifier"===a.object.type)var b=a.object.name;break;case "Identifier":b=a.name}d.hasBinding(b)?
g.push(a):f=!0});b=c;"function"!==typeof require||p.emitFullSignatures||(b=require("crypto").createHash("sha1").update(c).digest("base64"));a=[a,e.stringLiteral(b)];(f||0<g.length)&&a.push(e.booleanLiteral(f));0<g.length&&a.push(e.functionExpression(null,[],e.blockStatement([e.returnStatement(e.arrayExpression(g))])));return a}var p=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"===typeof r.env){var y=r.env();if("development"!==y&&!p.skipEnvCheck)throw Error('React Refresh Babel transform should only be enabled in development environment. Instead, the environment is: "'+
y+'". If you want to override this check, pass {skipEnvCheck: true} as plugin options.');}var e=r.types,C=e.identifier(p.refreshReg||"$RefreshReg$"),z=e.identifier(p.refreshSig||"$RefreshSig$"),l=new Map,x=new WeakMap,k=new WeakSet,q=new WeakSet,A=new WeakSet,n=new WeakMap,D={CallExpression:function(a){var b=a.node.callee,d=null;switch(b.type){case "Identifier":d=b.name;break;case "MemberExpression":d=b.property.name}if(null!==d&&/^use[A-Z]/.test(d)&&(b=a.scope.getFunctionParent(),null!==b)){b=b.block;
n.has(b)||n.set(b,[]);b=n.get(b);var c="";"VariableDeclarator"===a.parent.type&&(c=a.parentPath.get("id").getSource());var f=a.get("arguments");"useState"===d&&0<f.length?c+="("+f[0].getSource()+")":"useReducer"===d&&1<f.length&&(c+="("+f[1].getSource()+")");b.push({callee:a.node.callee,name:d,key:c})}}};return{visitor:{ExportDefaultDeclaration:function(a){var b=a.node,d=b.declaration,c=a.get("declaration");if("CallExpression"===d.type&&!k.has(b)){k.add(b);var f=a.parentPath;m("%default%",c,function(a,
b,c){null!==c&&(a=t(f,a),c.replaceWith(e.assignmentExpression("=",a,b)))})}},FunctionDeclaration:{enter:function(a){var b=a.node;switch(a.parent.type){case "Program":var d=a;var c=a.parentPath;break;case "ExportNamedDeclaration":d=a.parentPath;c=d.parentPath;break;case "ExportDefaultDeclaration":d=a.parentPath;c=d.parentPath;break;default:return}var f=b.id;null!==f&&(f=f.name,u(f)&&!k.has(b)&&(k.add(b),m(f,a,function(a,b){a=t(c,a);d.insertAfter(e.expressionStatement(e.assignmentExpression("=",a,b)))})))},
exit:function(a){var b=a.node,d=b.id;if(null!==d){var c=w(b);if(null!==c&&!q.has(b)){q.add(b);b=a.scope.generateUidIdentifier("_s");a.scope.parent.push({id:b,init:e.callExpression(z,[])});a.get("body").unshiftContainer("body",e.expressionStatement(e.callExpression(b,[])));var f=null;a.find(function(a){if(a.parentPath.isBlock())return f=a,!0});null!==f&&f.insertAfter(e.expressionStatement(e.callExpression(b,v(d,c,f.scope))))}}}},"ArrowFunctionExpression|FunctionExpression":{exit:function(a){var b=
a.node,d=w(b);if(null!==d&&!q.has(b)){q.add(b);var c=a.scope.generateUidIdentifier("_s");a.scope.parent.push({id:c,init:e.callExpression(z,[])});"BlockStatement"!==a.node.body.type&&(a.node.body=e.blockStatement([e.returnStatement(a.node.body)]));a.get("body").unshiftContainer("body",e.expressionStatement(e.callExpression(c,[])));if("VariableDeclarator"===a.parent.type){var f=null;a.find(function(a){if(a.parentPath.isBlock())return f=a,!0});null!==f&&f.insertAfter(e.expressionStatement(e.callExpression(c,
v(a.parent.id,d,f.scope))))}else a.replaceWith(e.callExpression(c,v(b,d,a.scope)))}}},VariableDeclaration:function(a){var b=a.node;switch(a.parent.type){case "Program":var d=a;var c=a.parentPath;break;case "ExportNamedDeclaration":d=a.parentPath;c=d.parentPath;break;case "ExportDefaultDeclaration":d=a.parentPath;c=d.parentPath;break;default:return}if(!k.has(b)&&(k.add(b),a=a.get("declarations"),1===a.length)){var f=a[0];m(f.node.id.name,f,function(a,b,h){null!==h&&(a=t(c,a),"VariableDeclarator"===
h.parent.type?d.insertAfter(e.expressionStatement(e.assignmentExpression("=",a,f.node.id))):h.replaceWith(e.assignmentExpression("=",a,b)))})}},Program:{enter:function(a){a.traverse(D)},exit:function(a){var b=l.get(a);if(void 0!==b){var d=a.node;if(!A.has(d)){A.add(d);l.delete(a);var c=[];a.pushContainer("body",e.variableDeclaration("var",c));b.forEach(function(b){var d=b.handle;a.pushContainer("body",e.expressionStatement(e.callExpression(C,[d,e.stringLiteral(b.persistentID)])));c.push(e.variableDeclarator(d))})}}}}}}};
/*
React
react-refresh-babel.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
'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,
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")||
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=
!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=
!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)?
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"===
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||
"$RefreshSig$"),n=new Map,z=new WeakMap,m=new WeakSet,t=new WeakSet,C=new WeakSet,q=new WeakMap,G={CallExpression:function(a){var b=a.node.callee,e=null;switch(b.type){case "Identifier":e=b.name;break;case "MemberExpression":e=b.property.name}if(null!==e&&/^use[A-Z]/.test(e)&&(b=a.scope.getFunctionParent(),null!==b)){b=b.block;q.has(b)||q.set(b,[]);b=q.get(b);var c="";"VariableDeclarator"===a.parent.type&&(c=a.parentPath.get("id").getSource());var d=a.get("arguments");"useState"===e&&0<d.length?c+=
"("+d[0].getSource()+")":"useReducer"===e&&1<d.length&&(c+="("+d[1].getSource()+")");b.push({callee:a.node.callee,name:e,key:c})}}};return{visitor:{ExportDefaultDeclaration:function(a){var b=a.node,e=b.declaration,c=a.get("declaration");if("CallExpression"===e.type&&!m.has(b)){m.add(b);var d=a.parentPath;p("%default%",c,function(f,h,k){null!==k&&(f=v(d,f),k.replaceWith(g.assignmentExpression("=",f,h)))})}},FunctionDeclaration:{enter: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;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}var f=
b.id;null!==f&&(f=f.name,w(f)&&!m.has(b)&&(m.add(b),p(e+f,a,function(h,k){h=v(d,h);c.insertAfter(g.expressionStatement(g.assignmentExpression("=",h,k)))})))},exit:function(a){var b=a.node,e=b.id;if(null!==e){var c=y(b);if(null!==c&&!t.has(b)){t.add(b);b=a.scope.generateUidIdentifier("_s");a.scope.parent.push({id:b,init:g.callExpression(B,[])});a.get("body").unshiftContainer("body",g.expressionStatement(g.callExpression(b,[])));var d=null;a.find(function(f){if(f.parentPath.isBlock())return d=f,!0});
null!==d&&d.insertAfter(g.expressionStatement(g.callExpression(b,x(e,c,d.scope))))}}}},"ArrowFunctionExpression|FunctionExpression":{exit:function(a){var b=a.node,e=y(b);if(null!==e&&!t.has(b)){t.add(b);var c=a.scope.generateUidIdentifier("_s");a.scope.parent.push({id:c,init:g.callExpression(B,[])});"BlockStatement"!==a.node.body.type&&(a.node.body=g.blockStatement([g.returnStatement(a.node.body)]));a.get("body").unshiftContainer("body",g.expressionStatement(g.callExpression(c,[])));if("VariableDeclarator"===
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;
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"===
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))})}}}}}}};
//# sourceMappingURL=react-refresh-babel.production.min.js.map

@@ -1,5 +0,6 @@

/** @license React vundefined
/**
* @license React
* react-refresh-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -17,47 +18,5 @@ * This source code is licensed under the MIT license found in the

// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
var REACT_FRAGMENT_TYPE = 0xeacb;
var REACT_STRICT_MODE_TYPE = 0xeacc;
var REACT_PROFILER_TYPE = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
var REACT_SUSPENSE_TYPE = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
var REACT_CACHE_TYPE = 0xeae4;
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
var REACT_MEMO_TYPE = Symbol.for('react.memo');
if (typeof Symbol === 'function' && Symbol.for) {
var symbolFor = Symbol.for;
REACT_ELEMENT_TYPE = symbolFor('react.element');
REACT_PORTAL_TYPE = symbolFor('react.portal');
REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
REACT_PROFILER_TYPE = symbolFor('react.profiler');
REACT_PROVIDER_TYPE = symbolFor('react.provider');
REACT_CONTEXT_TYPE = symbolFor('react.context');
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
REACT_MEMO_TYPE = symbolFor('react.memo');
REACT_LAZY_TYPE = symbolFor('react.lazy');
REACT_SCOPE_TYPE = symbolFor('react.scope');
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
REACT_CACHE_TYPE = symbolFor('react.cache');
}
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.

@@ -70,3 +29,2 @@ // It's OK to reference families, but use WeakMap/Set for types.

// that have actually been edited here. This keeps checks fast.
// $FlowIssue

@@ -86,6 +44,4 @@ var updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.

// If there is no WeakMap, we won't attempt to do retrying.
// $FlowIssue
var rootElements = // $FlowIssue
typeof WeakMap === 'function' ? new WeakMap() : null;
var rootElements = typeof WeakMap === 'function' ? new WeakMap() : null;
var isPerformingRefresh = false;

@@ -379,10 +335,25 @@

{
allSignaturesByType.set(type, {
forceReset: forceReset,
ownKey: key,
fullKey: null,
getCustomHooks: getCustomHooks || function () {
return [];
if (!allSignaturesByType.has(type)) {
allSignaturesByType.set(type, {
forceReset: forceReset,
ownKey: key,
fullKey: null,
getCustomHooks: getCustomHooks || function () {
return [];
}
});
} // Visit inner types because we might not have signed them.
if (typeof type === 'object' && type !== null) {
switch (getProperty(type, '$$typeof')) {
case REACT_FORWARD_REF_TYPE:
setSignature(type.render, key, forceReset, getCustomHooks);
break;
case REACT_MEMO_TYPE:
setSignature(type.type, key, forceReset, getCustomHooks);
break;
}
});
}
}

@@ -515,3 +486,3 @@ } // This is lazily called during first render for a type.

if (alternate !== null) {
var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null;
var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root);
var isMounted = current.memoizedState != null && current.memoizedState.element != null;

@@ -568,3 +539,3 @@

// const value = useCustomHook();
// _s(); /* Second call triggers collecting the custom Hook list.
// _s(); /* Call without arguments triggers collecting the custom Hook list.
// * This doesn't happen during the module evaluation because we

@@ -576,3 +547,3 @@ // * don't want to change the module order with inline requires.

//
// /* First call specifies the signature: */
// /* Call with arguments attaches the signature to the type: */
// _s(

@@ -586,33 +557,33 @@ // Hello,

{
// We'll fill in the signature in two steps.
// First, we'll know the signature itself. This happens outside the component.
// Then, we'll know the references to custom Hooks. This happens inside the component.
// After that, the returned function will be a fast path no-op.
var status = 'needsSignature';
var savedType;
var hasCustomHooks;
var didCollectHooks = false;
return function (type, key, forceReset, getCustomHooks) {
switch (status) {
case 'needsSignature':
if (type !== undefined) {
// If we received an argument, this is the initial registration call.
savedType = type;
hasCustomHooks = typeof getCustomHooks === 'function';
setSignature(type, key, forceReset, getCustomHooks); // The next call we expect is from inside a function, to fill in the custom Hooks.
if (typeof key === 'string') {
// We're in the initial phase that associates signatures
// with the functions. Note this may be called multiple times
// in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).
if (!savedType) {
// We're in the innermost call, so this is the actual type.
savedType = type;
hasCustomHooks = typeof getCustomHooks === 'function';
} // Set the signature for all types (even wrappers!) in case
// they have no signatures of their own. This is to prevent
// problems like https://github.com/facebook/react/issues/20417.
status = 'needsCustomHooks';
}
break;
if (type != null && (typeof type === 'function' || typeof type === 'object')) {
setSignature(type, key, forceReset, getCustomHooks);
}
case 'needsCustomHooks':
if (hasCustomHooks) {
collectCustomHooksForSignature(savedType);
}
status = 'resolved';
break;
return type;
} else {
// We're in the _s() call without arguments, which means
// this is the time to collect custom Hook signatures.
// Only do this once. This path is hot and runs *inside* every render!
if (!didCollectHooks && hasCustomHooks) {
didCollectHooks = true;
collectCustomHooksForSignature(savedType);
}
}
return type;
};

@@ -619,0 +590,0 @@ }

@@ -1,9 +0,12 @@

/** @license React vundefined
* react-refresh-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*
React
react-refresh-runtime.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
'use strict';throw Error("React Refresh runtime should not be included in the production bundle.");
//# sourceMappingURL=react-refresh-runtime.production.min.js.map

@@ -7,4 +7,4 @@ {

],
"version": "0.0.0-experimental-8af27aeed",
"homepage": "https://reactjs.org/",
"version": "0.0.0-experimental-8afa144bd-20240416",
"homepage": "https://react.dev/",
"bugs": "https://github.com/facebook/react/issues",

@@ -17,3 +17,2 @@ "license": "MIT",

"runtime.js",
"build-info.json",
"cjs/",

@@ -23,2 +22,8 @@ "umd/"

"main": "runtime.js",
"exports": {
".": "./runtime.js",
"./runtime": "./runtime.js",
"./babel": "./babel.js",
"./package.json": "./package.json"
},
"repository": {

@@ -34,4 +39,5 @@ "type": "git",

"react-16-8": "npm:react@16.8.0",
"react-dom-16-8": "npm:react-dom@16.8.0"
"react-dom-16-8": "npm:react-dom@16.8.0",
"scheduler-0-13": "npm:scheduler@0.13.0"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc