Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-refresh

Package Overview
Dependencies
Maintainers
7
Versions
1864
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-refresh - npm Package Compare versions

Comparing version 0.4.0-rc.0 to 0.4.0

2

cjs/react-refresh-babel.development.js

@@ -1,2 +0,2 @@

/** @license React v0.4.0-rc.0
/** @license React vundefined
* react-refresh-babel.development.js

@@ -3,0 +3,0 @@ *

@@ -1,2 +0,2 @@

/** @license React v0.4.0-rc.0
/** @license React vundefined
* react-refresh-babel.production.min.js

@@ -3,0 +3,0 @@ *

@@ -1,2 +0,2 @@

/** @license React v0.4.0-rc.0
/** @license React vundefined
* react-refresh-runtime.development.js

@@ -38,52 +38,2 @@ *

/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warningWithoutStack = function () {};
{
warningWithoutStack = function (condition, format) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
if (format === undefined) {
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (args.length > 8) {
// Check before the condition to catch violations early.
throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
}
if (condition) {
return;
}
if (typeof console !== 'undefined') {
var argsWithFormat = args.map(function (item) {
return '' + item;
});
argsWithFormat.unshift('Warning: ' + format);
// We intentionally don't use spread (or .apply) directly because it
// breaks IE9: https://github.com/facebook/react/issues/13610
Function.prototype.apply.call(console.error, console, argsWithFormat);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
throw new Error(message);
} catch (x) {}
};
}
var warningWithoutStack$1 = warningWithoutStack;
// In old environments, we'll leak previous types after every edit.

@@ -107,7 +57,6 @@ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;

// This is injected by the renderer via DevTools global hook.
var setRefreshHandler = null;
var scheduleRefresh = null;
var scheduleRoot = null;
var findHostInstancesForRefresh = null;
var helpersByRendererID = new Map();
var helpersByRoot = new Map();
// We keep track of mounted roots so we can schedule updates.

@@ -237,27 +186,17 @@ var mountedRoots = new Set();

if (typeof setRefreshHandler !== 'function') {
warningWithoutStack$1(false, 'Could not find the setRefreshHandler() implementation. ' + 'This likely means that injectIntoGlobalHook() was either ' + 'called before the global DevTools hook was set up, or after the ' + 'renderer has already initialized. Please file an issue with a reproducing case.');
return null;
}
helpersByRendererID.forEach(function (helpers) {
// Even if there are no roots, set the handler on first update.
// This ensures that if *new* roots are mounted, they'll use the resolve handler.
helpers.setRefreshHandler(resolveFamily);
});
if (typeof scheduleRefresh !== 'function') {
warningWithoutStack$1(false, 'Could not find the scheduleRefresh() implementation. ' + 'This likely means that injectIntoGlobalHook() was either ' + 'called before the global DevTools hook was set up, or after the ' + 'renderer has already initialized. Please file an issue with a reproducing case.');
return null;
}
if (typeof scheduleRoot !== 'function') {
warningWithoutStack$1(false, 'Could not find the scheduleRoot() implementation. ' + 'This likely means that injectIntoGlobalHook() was either ' + 'called before the global DevTools hook was set up, or after the ' + 'renderer has already initialized. Please file an issue with a reproducing case.');
return null;
}
var scheduleRefreshForRoot = scheduleRefresh;
var scheduleRenderForRoot = scheduleRoot;
// Even if there are no roots, set the handler on first update.
// This ensures that if *new* roots are mounted, they'll use the resolve handler.
setRefreshHandler(resolveFamily);
var didError = false;
var firstError = null;
failedRoots.forEach(function (element, root) {
var helpers = helpersByRoot.get(root);
if (helpers === undefined) {
throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');
}
try {
scheduleRenderForRoot(root, element);
helpers.scheduleRoot(root, element);
} catch (err) {

@@ -272,4 +211,8 @@ if (!didError) {

mountedRoots.forEach(function (root) {
var helpers = helpersByRoot.get(root);
if (helpers === undefined) {
throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');
}
try {
scheduleRefreshForRoot(root, update);
helpers.scheduleRefresh(root, update);
} catch (err) {

@@ -372,10 +315,9 @@ if (!didError) {

{
if (typeof findHostInstancesForRefresh !== 'function') {
warningWithoutStack$1(false, 'Could not find the findHostInstancesForRefresh() implementation. ' + 'This likely means that injectIntoGlobalHook() was either ' + 'called before the global DevTools hook was set up, or after the ' + 'renderer has already initialized. Please file an issue with a reproducing case.');
return new Set();
}
var findInstances = findHostInstancesForRefresh;
var affectedInstances = new Set();
mountedRoots.forEach(function (root) {
var instancesForRoot = findInstances(root, families);
var helpers = helpersByRoot.get(root);
if (helpers === undefined) {
throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');
}
var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);
instancesForRoot.forEach(function (inst) {

@@ -401,5 +343,8 @@ affectedInstances.add(inst);

// Otherwise, the renderer will think that there is no global hook, and won't do the injection.
var nextID = 0;
globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {
supportsFiber: true,
inject: function () {},
inject: function (injected) {
return nextID++;
},
onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},

@@ -413,7 +358,8 @@ onCommitFiberUnmount: function () {}

hook.inject = function (injected) {
findHostInstancesForRefresh = injected.findHostInstancesForRefresh;
scheduleRefresh = injected.scheduleRefresh;
scheduleRoot = injected.scheduleRoot;
setRefreshHandler = injected.setRefreshHandler;
return oldInject.apply(this, arguments);
var id = oldInject.apply(this, arguments);
if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {
// This version supports React Refresh.
helpersByRendererID.set(id, injected);
}
return id;
};

@@ -424,2 +370,8 @@

hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {
var helpers = helpersByRendererID.get(id);
if (helpers === undefined) {
return;
}
helpersByRoot.set(root, helpers);
var current = root.current;

@@ -450,2 +402,4 @@ var alternate = current.alternate;

failedRoots.set(root, alternate.memoizedState.element);
} else {
helpersByRoot.delete(root);
}

@@ -452,0 +406,0 @@ } else if (!wasMounted && !isMounted) {

@@ -1,2 +0,2 @@

/** @license React v0.4.0-rc.0
/** @license React vundefined
* react-refresh-runtime.production.min.js

@@ -3,0 +3,0 @@ *

@@ -7,3 +7,3 @@ {

],
"version": "0.4.0-rc.0",
"version": "0.4.0",
"homepage": "https://reactjs.org/",

@@ -10,0 +10,0 @@ "bugs": "https://github.com/facebook/react/issues",

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