use-sync-external-store
Advanced tools
Comparing version 1.4.0-rc-57fbe3ba37-20240520 to 1.4.0-rc-6d3110b4d9-20240531
@@ -37,3 +37,3 @@ /** | ||
} | ||
} | ||
} // eslint-disable-next-line react-internal/no-production-logging | ||
@@ -44,19 +44,35 @@ function printWarning(level, format, args) { | ||
{ | ||
var stack = ReactSharedInternals.getStackAddendum(); | ||
var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n'; | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} // eslint-disable-next-line react-internal/safe-string-coercion | ||
if (ReactSharedInternals.getCurrentStack) { | ||
// We only add the current stack to the console when createTask is not supported. | ||
// Since createTask requires DevTools to be open to work, this means that stacks | ||
// can be lost while DevTools isn't open but we can't detect this. | ||
var stack = ReactSharedInternals.getCurrentStack(); | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} | ||
} | ||
var argsWithFormat = args.map(function (item) { | ||
return String(item); | ||
}); // Careful: RN currently depends on this prefix | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
if (isErrorLogger) { | ||
// Don't prefix our default logging formatting in ReactFiberErrorLoggger. | ||
// Don't toString the arguments. | ||
args.unshift(format); | ||
} else { | ||
// TODO: Remove this prefix and stop toStringing in the wrapper and | ||
// instead do it at each callsite as needed. | ||
// Careful: RN currently depends on this prefix | ||
// eslint-disable-next-line react-internal/safe-string-coercion | ||
args = args.map(function (item) { | ||
return String(item); | ||
}); | ||
args.unshift('Warning: ' + format); | ||
} // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
// eslint-disable-next-line react-internal/no-production-logging | ||
Function.prototype.apply.call(console[level], console, argsWithFormat); | ||
Function.prototype.apply.call(console[level], console, args); | ||
} | ||
@@ -63,0 +79,0 @@ } |
@@ -37,3 +37,3 @@ /** | ||
} | ||
} | ||
} // eslint-disable-next-line react-internal/no-production-logging | ||
@@ -44,19 +44,35 @@ function printWarning(level, format, args) { | ||
{ | ||
var stack = ReactSharedInternals.getStackAddendum(); | ||
var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n'; | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} // eslint-disable-next-line react-internal/safe-string-coercion | ||
if (ReactSharedInternals.getCurrentStack) { | ||
// We only add the current stack to the console when createTask is not supported. | ||
// Since createTask requires DevTools to be open to work, this means that stacks | ||
// can be lost while DevTools isn't open but we can't detect this. | ||
var stack = ReactSharedInternals.getCurrentStack(); | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} | ||
} | ||
var argsWithFormat = args.map(function (item) { | ||
return String(item); | ||
}); // Careful: RN currently depends on this prefix | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
if (isErrorLogger) { | ||
// Don't prefix our default logging formatting in ReactFiberErrorLoggger. | ||
// Don't toString the arguments. | ||
args.unshift(format); | ||
} else { | ||
// TODO: Remove this prefix and stop toStringing in the wrapper and | ||
// instead do it at each callsite as needed. | ||
// Careful: RN currently depends on this prefix | ||
// eslint-disable-next-line react-internal/safe-string-coercion | ||
args = args.map(function (item) { | ||
return String(item); | ||
}); | ||
args.unshift('Warning: ' + format); | ||
} // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
// eslint-disable-next-line react-internal/no-production-logging | ||
Function.prototype.apply.call(console[level], console, argsWithFormat); | ||
Function.prototype.apply.call(console[level], console, args); | ||
} | ||
@@ -63,0 +79,0 @@ } |
@@ -37,3 +37,3 @@ /** | ||
} | ||
} | ||
} // eslint-disable-next-line react-internal/no-production-logging | ||
@@ -44,19 +44,35 @@ function printWarning(level, format, args) { | ||
{ | ||
var stack = ReactSharedInternals.getStackAddendum(); | ||
var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n'; | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} // eslint-disable-next-line react-internal/safe-string-coercion | ||
if (ReactSharedInternals.getCurrentStack) { | ||
// We only add the current stack to the console when createTask is not supported. | ||
// Since createTask requires DevTools to be open to work, this means that stacks | ||
// can be lost while DevTools isn't open but we can't detect this. | ||
var stack = ReactSharedInternals.getCurrentStack(); | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} | ||
} | ||
var argsWithFormat = args.map(function (item) { | ||
return String(item); | ||
}); // Careful: RN currently depends on this prefix | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
if (isErrorLogger) { | ||
// Don't prefix our default logging formatting in ReactFiberErrorLoggger. | ||
// Don't toString the arguments. | ||
args.unshift(format); | ||
} else { | ||
// TODO: Remove this prefix and stop toStringing in the wrapper and | ||
// instead do it at each callsite as needed. | ||
// Careful: RN currently depends on this prefix | ||
// eslint-disable-next-line react-internal/safe-string-coercion | ||
args = args.map(function (item) { | ||
return String(item); | ||
}); | ||
args.unshift('Warning: ' + format); | ||
} // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
// eslint-disable-next-line react-internal/no-production-logging | ||
Function.prototype.apply.call(console[level], console, argsWithFormat); | ||
Function.prototype.apply.call(console[level], console, args); | ||
} | ||
@@ -63,0 +79,0 @@ } |
{ | ||
"name": "use-sync-external-store", | ||
"description": "Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.", | ||
"version": "1.4.0-rc-57fbe3ba37-20240520", | ||
"version": "1.4.0-rc-6d3110b4d9-20240531", | ||
"repository": { | ||
@@ -22,3 +22,3 @@ "type": "git", | ||
"peerDependencies": { | ||
"react": "19.0.0-rc-57fbe3ba37-20240520" | ||
"react": "19.0.0-rc-6d3110b4d9-20240531" | ||
}, | ||
@@ -25,0 +25,0 @@ "devDependencies": { |
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
44833
1097