Socket
Socket
Sign inDemoInstall

use-sync-external-store

Package Overview
Dependencies
Maintainers
3
Versions
1331
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-sync-external-store - npm Package Compare versions

Comparing version 1.4.0-rc-f3e09d6328-20240612 to 1.4.0-rc-f65ac7bd-20240826

25

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

@@ -14,19 +14,2 @@ /**

(function () {
function error(format) {
for (
var _len2 = arguments.length,
args = Array(1 < _len2 ? _len2 - 1 : 0),
_key2 = 1;
_key2 < _len2;
_key2++
)
args[_key2 - 1] = arguments[_key2];
_len2 = format;
_key2 = Error("react-stack-top-frame");
ReactSharedInternals.getCurrentStack &&
((_key2 = ReactSharedInternals.getCurrentStack(_key2)),
"" !== _key2 && ((_len2 += "%s"), (args = args.concat([_key2]))));
args.unshift(_len2);
Function.prototype.apply.call(console.error, console, args);
}
function is(x, y) {

@@ -39,3 +22,3 @@ return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);

((didWarnOld18Alpha = !0),
error(
console.error(
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."

@@ -47,3 +30,3 @@ ));

objectIs(value, cachedValue) ||
(error(
(console.error(
"The result of getSnapshot should be cached to avoid an infinite loop"

@@ -84,3 +67,3 @@ ),

return !objectIs(inst, nextValue);
} catch (error$0) {
} catch (error) {
return !0;

@@ -97,4 +80,2 @@ }

var React = require("react"),
ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
objectIs = "function" === typeof Object.is ? Object.is : is,

@@ -101,0 +82,0 @@ useState = React.useState,

@@ -14,19 +14,2 @@ /**

(function () {
function error(format) {
for (
var _len2 = arguments.length,
args = Array(1 < _len2 ? _len2 - 1 : 0),
_key2 = 1;
_key2 < _len2;
_key2++
)
args[_key2 - 1] = arguments[_key2];
_len2 = format;
_key2 = Error("react-stack-top-frame");
ReactSharedInternals.getCurrentStack &&
((_key2 = ReactSharedInternals.getCurrentStack(_key2)),
"" !== _key2 && ((_len2 += "%s"), (args = args.concat([_key2]))));
args.unshift(_len2);
Function.prototype.apply.call(console.error, console, args);
}
function is(x, y) {

@@ -39,3 +22,3 @@ return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);

((didWarnOld18Alpha = !0),
error(
console.error(
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."

@@ -47,3 +30,3 @@ ));

objectIs(value, cachedValue) ||
(error(
(console.error(
"The result of getSnapshot should be cached to avoid an infinite loop"

@@ -84,3 +67,3 @@ ),

return !objectIs(inst, nextValue);
} catch (error$0) {
} catch (error) {
return !0;

@@ -94,4 +77,2 @@ }

var React = require("react"),
ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
objectIs = "function" === typeof Object.is ? Object.is : is,

@@ -98,0 +79,0 @@ useState = React.useState,

2

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

@@ -60,3 +60,3 @@ /**

if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
return currentSelection;
return (memoizedSnapshot = nextSnapshot), currentSelection;
memoizedSnapshot = nextSnapshot;

@@ -63,0 +63,0 @@ return (memoizedSelection = nextSelection);

@@ -53,3 +53,3 @@ /**

if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
return currentSelection;
return (memoizedSnapshot = nextSnapshot), currentSelection;
memoizedSnapshot = nextSnapshot;

@@ -56,0 +56,0 @@ return (memoizedSelection = nextSelection);

@@ -59,3 +59,3 @@ /**

if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
return currentSelection;
return (memoizedSnapshot = nextSnapshot), currentSelection;
memoizedSnapshot = nextSnapshot;

@@ -62,0 +62,0 @@ return (memoizedSelection = nextSelection);

@@ -52,3 +52,3 @@ /**

if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
return currentSelection;
return (memoizedSnapshot = nextSnapshot), currentSelection;
memoizedSnapshot = nextSnapshot;

@@ -55,0 +55,0 @@ return (memoizedSelection = nextSelection);

@@ -12,36 +12,17 @@ /**

"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var React = require("react"),
ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
React = React.useSyncExternalStore;
(function (format) {
for (
var _len2 = arguments.length,
args = Array(1 < _len2 ? _len2 - 1 : 0),
_key2 = 1;
_key2 < _len2;
_key2++
)
args[_key2 - 1] = arguments[_key2];
_len2 = format;
_key2 = Error("react-stack-top-frame");
ReactSharedInternals.getCurrentStack &&
((_key2 = ReactSharedInternals.getCurrentStack(_key2)),
"" !== _key2 && ((_len2 += "%s"), (args = args.concat([_key2]))));
args.unshift(_len2);
Function.prototype.apply.call(console.error, console, args);
})(
"The main 'use-sync-external-store' entry point is not supported; all it does is re-export useSyncExternalStore from the 'react' package, so it only works with React 18+.\n\nIf you wish to support React 16 and 17, import from 'use-sync-external-store/shim' instead. It will fall back to a shimmed implementation when the native one is not available.\n\nIf you only support React 18+, you can import directly from 'react'."
);
exports.useSyncExternalStore = React;
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
if ("production" !== process.env.NODE_ENV) {
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var useSyncExternalStore$jscomp$inline_1 =
require("react").useSyncExternalStore;
console.error(
"The main 'use-sync-external-store' entry point is not supported; all it does is re-export useSyncExternalStore from the 'react' package, so it only works with React 18+.\n\nIf you wish to support React 16 and 17, import from 'use-sync-external-store/shim' instead. It will fall back to a shimmed implementation when the native one is not available.\n\nIf you only support React 18+, you can import directly from 'react'."
);
exports.useSyncExternalStore = useSyncExternalStore$jscomp$inline_1;
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
}
{
"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-f3e09d6328-20240612",
"version": "1.4.0-rc-f65ac7bd-20240826",
"repository": {

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

"peerDependencies": {
"react": "19.0.0-rc-f3e09d6328-20240612"
"react": "19.0.0-rc-f65ac7bd-20240826"
},

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc