Socket
Socket
Sign inDemoInstall

use-sync-external-store

Package Overview
Dependencies
1
Maintainers
3
Versions
1209
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0-experimental-613e6f5fc-20230616 to 0.0.0-experimental-6230622a1a-20240610

cjs/use-sync-external-store-shim.native.production.js

59

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

@@ -15,6 +15,3 @@ /**

(function() {
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
'use strict';
if (

@@ -27,5 +24,5 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
var React = require('react');
var React = require('react');
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

@@ -39,29 +36,46 @@ function error(format) {

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) {
var supportsCreateTask = !!console.createTask;
function printWarning(level, format, args, currentStack) {
// When changing this logic, you might want to also
// update consoleWithStackDev.www.js as well.
{
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.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 (!supportsCreateTask && 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);
}

@@ -233,3 +247,2 @@ }

exports.useSyncExternalStore = useSyncExternalStore;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (

@@ -242,4 +255,4 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
})();
}

@@ -15,6 +15,3 @@ /**

(function() {
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
'use strict';
if (

@@ -27,5 +24,5 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
var React = require('react');
var React = require('react');
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

@@ -39,29 +36,46 @@ function error(format) {

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) {
var supportsCreateTask = !!console.createTask;
function printWarning(level, format, args, currentStack) {
// When changing this logic, you might want to also
// update consoleWithStackDev.www.js as well.
{
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.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 (!supportsCreateTask && 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);
}

@@ -221,3 +235,2 @@ }

exports.useSyncExternalStore = useSyncExternalStore;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (

@@ -230,4 +243,4 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
})();
}

@@ -15,6 +15,3 @@ /**

(function() {
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
'use strict';
if (

@@ -27,3 +24,3 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
var React = require('react');
var React = require('react');
var shim = require('use-sync-external-store/shim');

@@ -160,3 +157,2 @@

exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (

@@ -169,4 +165,4 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
})();
}

@@ -15,6 +15,3 @@ /**

(function() {
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
'use strict';
if (

@@ -27,3 +24,3 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
var React = require('react');
var React = require('react');

@@ -159,3 +156,2 @@ /**

exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (

@@ -168,4 +164,4 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
})();
}

@@ -15,6 +15,3 @@ /**

(function() {
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
'use strict';
if (

@@ -27,5 +24,5 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
var React = require('react');
var React = require('react');
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

@@ -39,29 +36,46 @@ function error(format) {

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) {
var supportsCreateTask = !!console.createTask;
function printWarning(level, format, args, currentStack) {
// When changing this logic, you might want to also
// update consoleWithStackDev.www.js as well.
{
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.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 (!supportsCreateTask && 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);
}

@@ -77,3 +91,2 @@ }

exports.useSyncExternalStore = useSyncExternalStore;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (

@@ -86,4 +99,4 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&

}
})();
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/use-sync-external-store.production.min.js');
module.exports = require('./cjs/use-sync-external-store.production.js');
} else {
module.exports = require('./cjs/use-sync-external-store.development.js');
}
{
"name": "use-sync-external-store",
"description": "Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.",
"version": "0.0.0-experimental-613e6f5fc-20230616",
"version": "0.0.0-experimental-6230622a1a-20240610",
"repository": {

@@ -22,4 +22,8 @@ "type": "git",

"peerDependencies": {
"react": "0.0.0-experimental-613e6f5fc-20230616"
"react": "0.0.0-experimental-6230622a1a-20240610"
},
"devDependencies": {
"react-17": "npm:react@^17",
"react-dom-17": "npm:react-dom@^17"
}
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');
module.exports = require('../cjs/use-sync-external-store-shim.production.js');
} else {
module.exports = require('../cjs/use-sync-external-store-shim.development.js');
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('../cjs/use-sync-external-store-shim.native.production.min.js');
module.exports = require('../cjs/use-sync-external-store-shim.native.production.js');
} else {
module.exports = require('../cjs/use-sync-external-store-shim.native.development.js');
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js');
module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');
} else {
module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/use-sync-external-store-with-selector.production.min.js');
module.exports = require('./cjs/use-sync-external-store-with-selector.production.js');
} else {
module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');
}
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