react-refresh
Advanced tools
Comparing version 0.0.0-experimental-cb8afda18-20210708 to 0.0.0-experimental-cc1ec60d0d-20240607
'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-refresh-babel.production.min.js'); | ||
module.exports = require('./cjs/react-refresh-babel.production.js'); | ||
} else { | ||
module.exports = require('./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; | ||
@@ -527,2 +546,3 @@ | ||
var insertAfterPath; | ||
var modulePrefix = ''; | ||
@@ -535,2 +555,7 @@ switch (path.parent.type) { | ||
case 'TSModuleBlock': | ||
insertAfterPath = path; | ||
programPath = insertAfterPath.parentPath.parentPath; | ||
break; | ||
case 'ExportNamedDeclaration': | ||
@@ -548,2 +573,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; | ||
} | ||
} | ||
@@ -571,6 +613,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); | ||
@@ -693,2 +736,3 @@ insertAfterPath.insertAfter(t.expressionStatement(t.assignmentExpression('=', handle, targetExpr))); | ||
var insertAfterPath; | ||
var modulePrefix = ''; | ||
@@ -701,2 +745,7 @@ switch (path.parent.type) { | ||
case 'TSModuleBlock': | ||
insertAfterPath = path; | ||
programPath = insertAfterPath.parentPath.parentPath; | ||
break; | ||
case 'ExportNamedDeclaration': | ||
@@ -714,2 +763,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. | ||
@@ -733,3 +799,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) { | ||
@@ -736,0 +803,0 @@ // For case like: |
@@ -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. | ||
* | ||
@@ -16,48 +17,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 +28,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 +43,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; | ||
@@ -529,3 +484,3 @@ | ||
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; | ||
@@ -532,0 +487,0 @@ |
@@ -7,4 +7,4 @@ { | ||
], | ||
"version": "0.0.0-experimental-cb8afda18-20210708", | ||
"homepage": "https://reactjs.org/", | ||
"version": "0.0.0-experimental-cc1ec60d0d-20240607", | ||
"homepage": "https://react.dev/", | ||
"bugs": "https://github.com/facebook/react/issues", | ||
@@ -17,7 +17,11 @@ "license": "MIT", | ||
"runtime.js", | ||
"build-info.json", | ||
"cjs/", | ||
"umd/" | ||
"cjs/" | ||
], | ||
"main": "runtime.js", | ||
"exports": { | ||
".": "./runtime.js", | ||
"./runtime": "./runtime.js", | ||
"./babel": "./babel.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"repository": { | ||
@@ -24,0 +28,0 @@ "type": "git", |
'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-refresh-runtime.production.min.js'); | ||
module.exports = require('./cjs/react-refresh-runtime.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-refresh-runtime.development.js'); | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
71756
1840
1