use-sync-external-store
Advanced tools
Comparing version 0.0.0-experimental-67f38366a-20210830 to 0.0.0-experimental-6bce0355c-20211031
@@ -14,10 +14,95 @@ /** @license React vundefined | ||
(function() { | ||
'use strict'; | ||
function useSyncExternalStore() { | ||
throw new Error('Not yet implemented'); | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ | ||
// Don't require this file directly; it's embedded by Rollup during build. | ||
if ( | ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && | ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === | ||
'function' | ||
) { | ||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); | ||
} | ||
'use strict'; | ||
var React = require('react'); | ||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function error(format) { | ||
{ | ||
{ | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
printWarning('error', format, args); | ||
} | ||
} | ||
} | ||
function printWarning(level, format, args) { | ||
// When changing this logic, you might want to also | ||
// update consoleWithStackDev.www.js as well. | ||
{ | ||
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; | ||
var stack = ReactDebugCurrentFrame.getStackAddendum(); | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} // eslint-disable-next-line react-internal/safe-string-coercion | ||
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 | ||
// 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); | ||
} | ||
} | ||
var useSyncExternalStore = React.useSyncExternalStore; | ||
{ | ||
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\n' + 'If 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\n' + "If you only support React 18+, you can import directly from 'react'."); | ||
} | ||
exports.useSyncExternalStore = useSyncExternalStore; | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ | ||
// Don't require this file directly; it's embedded by Rollup during build. | ||
if ( | ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && | ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === | ||
'function' | ||
) { | ||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); | ||
} | ||
})(); | ||
} |
@@ -9,2 +9,2 @@ /** @license React vundefined | ||
*/ | ||
'use strict';exports.useSyncExternalStore=function(){throw Error("Not yet implemented");}; | ||
'use strict';var a=require("react").useSyncExternalStore;exports.useSyncExternalStore=a; |
{ | ||
"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-67f38366a-20210830", | ||
"version": "0.0.0-experimental-6bce0355c-20211031", | ||
"repository": { | ||
@@ -15,2 +15,6 @@ "type": "git", | ||
"index.js", | ||
"index.native.js", | ||
"with-selector.js", | ||
"with-selector.native.js", | ||
"shim/", | ||
"cjs/" | ||
@@ -20,4 +24,4 @@ ], | ||
"peerDependencies": { | ||
"react": "0.0.0-experimental-67f38366a-20210830" | ||
"react": "0.0.0-experimental-6bce0355c-20211031" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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 3 instances in 1 package
40861
18
894
6
10
1