Socket
Socket
Sign inDemoInstall

use-sync-external-store

Package Overview
Dependencies
1
Maintainers
3
Versions
1221
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.0-rc-81c5ff2e04-20240521 to 1.4.0-rc-827cbea417-20240606

44

cjs/use-sync-external-store-shim.development.js

@@ -34,28 +34,44 @@ /**

printWarning('error', format, args);
printWarning('error', format, args, new Error('react-stack-top-frame'));
}
}
}
} // eslint-disable-next-line react-internal/no-production-logging
function printWarning(level, format, args) {
function printWarning(level, format, args, currentStack) {
// When changing this logic, you might want to also
// update consoleWithStackDev.www.js as well.
{
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(currentStack);
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);
}

@@ -62,0 +78,0 @@ }

@@ -34,28 +34,44 @@ /**

printWarning('error', format, args);
printWarning('error', format, args, new Error('react-stack-top-frame'));
}
}
}
} // eslint-disable-next-line react-internal/no-production-logging
function printWarning(level, format, args) {
function printWarning(level, format, args, currentStack) {
// When changing this logic, you might want to also
// update consoleWithStackDev.www.js as well.
{
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(currentStack);
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);
}

@@ -62,0 +78,0 @@ }

@@ -34,28 +34,44 @@ /**

printWarning('error', format, args);
printWarning('error', format, args, new Error('react-stack-top-frame'));
}
}
}
} // eslint-disable-next-line react-internal/no-production-logging
function printWarning(level, format, args) {
function printWarning(level, format, args, currentStack) {
// When changing this logic, you might want to also
// update consoleWithStackDev.www.js as well.
{
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(currentStack);
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);
}

@@ -62,0 +78,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-81c5ff2e04-20240521",
"version": "1.4.0-rc-827cbea417-20240606",
"repository": {

@@ -22,3 +22,3 @@ "type": "git",

"peerDependencies": {
"react": "19.0.0-rc-81c5ff2e04-20240521"
"react": "19.0.0-rc-827cbea417-20240606"
},

@@ -25,0 +25,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc