react-refresh 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build-info.json
ADDED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React v0.9.0
|
|
2
2
|
* react-refresh-babel.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
12
|
if (process.env.NODE_ENV !== "production") {
|
|
15
13
|
(function() {
|
|
16
14
|
'use strict';
|
|
@@ -18,9 +16,9 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
18
16
|
function ReactFreshBabelPlugin (babel) {
|
|
19
17
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
20
18
|
|
|
21
|
-
if (typeof babel.
|
|
19
|
+
if (typeof babel.env === 'function') {
|
|
22
20
|
// Only available in Babel 7.
|
|
23
|
-
var env = babel.
|
|
21
|
+
var env = babel.env();
|
|
24
22
|
|
|
25
23
|
if (env !== 'development' && !opts.skipEnvCheck) {
|
|
26
24
|
throw new Error('React Refresh Babel transform should only be enabled in development environment. ' + 'Instead, the environment is: "' + env + '". If you want to override this check, pass {skipEnvCheck: true} as plugin options.');
|
|
@@ -170,9 +168,6 @@ function ReactFreshBabelPlugin (babel) {
|
|
|
170
168
|
} // Neither require nor import. Might be a HOC.
|
|
171
169
|
// Pass through.
|
|
172
170
|
|
|
173
|
-
} else if (calleeType === 'MemberExpression') ; else {
|
|
174
|
-
// More complicated call.
|
|
175
|
-
return false;
|
|
176
171
|
}
|
|
177
172
|
|
|
178
173
|
break;
|
|
@@ -360,7 +355,7 @@ function ReactFreshBabelPlugin (babel) {
|
|
|
360
355
|
if (typeof require === 'function' && !opts.emitFullSignatures) {
|
|
361
356
|
// Prefer to hash when we can (e.g. outside of ASTExplorer).
|
|
362
357
|
// This makes it deterministically compact, even if there's
|
|
363
|
-
// e.g. a useState
|
|
358
|
+
// e.g. a useState initializer with some code inside.
|
|
364
359
|
// We also need it for www that has transforms like cx()
|
|
365
360
|
// that don't understand if something is part of a string.
|
|
366
361
|
finalKey = require('crypto').createHash('sha1').update(key).digest('base64');
|
|
@@ -577,7 +572,7 @@ function ReactFreshBabelPlugin (babel) {
|
|
|
577
572
|
// This is used to associate a type with a signature.
|
|
578
573
|
// Unlike with $RefreshReg$, this needs to work for nested
|
|
579
574
|
// declarations too. So we need to search for a path where
|
|
580
|
-
// we can insert a statement rather than
|
|
575
|
+
// we can insert a statement rather than hard coding it.
|
|
581
576
|
|
|
582
577
|
var insertAfterPath = null;
|
|
583
578
|
path.find(function (p) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React v0.9.0
|
|
2
2
|
* react-refresh-babel.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
9
|
'use strict';module.exports=function(r){function t(a,b){var d=a.scope.generateUidIdentifier("c");l.has(a)||l.set(a,[]);l.get(a).push({handle:d,persistentID:b});return d}function u(a){return"string"===typeof a&&"A"<=a[0]&&"Z">=a[0]}function m(a,b,d){var c=b.node;switch(c.type){case "Identifier":if(!u(c.name))break;d(a,c,null);return!0;case "FunctionDeclaration":return d(a,c.id,null),!0;case "ArrowFunctionExpression":if("ArrowFunctionExpression"===c.body.type)break;d(a,c,b);return!0;case "FunctionExpression":return d(a,
|
|
11
|
-
c,b),!0;case "CallExpression":var f=b.get("arguments");if(void 0===f||0===f.length)break;var g=b.get("callee");switch(g.node.type){case "MemberExpression":case "Identifier":g=g.getSource();if(!m(a+"$"+g,f[0],d))return!1;d(a,c,b);return!0;default:return!1}case "VariableDeclarator":if(f=c.init,null!==f&&(g=c.id.name,u(g))){switch(f.type){case "ArrowFunctionExpression":case "FunctionExpression":break;case "CallExpression":c=f.callee;var e=c.type;if("Import"===e
|
|
12
|
-
0===c.name.indexOf("import"))
|
|
13
|
-
|
|
10
|
+
c,b),!0;case "CallExpression":var f=b.get("arguments");if(void 0===f||0===f.length)break;var g=b.get("callee");switch(g.node.type){case "MemberExpression":case "Identifier":g=g.getSource();if(!m(a+"$"+g,f[0],d))return!1;d(a,c,b);return!0;default:return!1}case "VariableDeclarator":if(f=c.init,null!==f&&(g=c.id.name,u(g))){switch(f.type){case "ArrowFunctionExpression":case "FunctionExpression":break;case "CallExpression":c=f.callee;var e=c.type;if("Import"===e||"Identifier"===e&&(0===c.name.indexOf("require")||
|
|
11
|
+
0===c.name.indexOf("import")))return!1;break;case "TaggedTemplateExpression":break;default:return!1}c=b.get("init");if(m(a,c,d))return!0;g=b.scope.getBinding(g);if(void 0===g)return;b=!1;g=g.referencePaths;for(e=0;e<g.length;e++){var h=g[e];if(!h.node||"JSXIdentifier"===h.node.type||"Identifier"===h.node.type){h=h.parent;if("JSXOpeningElement"===h.type)b=!0;else if("CallExpression"===h.type){h=h.callee;var k=void 0;switch(h.type){case "Identifier":k=h.name;break;case "MemberExpression":k=h.property.name}switch(k){case "createElement":case "jsx":case "jsxDEV":case "jsxs":b=
|
|
12
|
+
!0}}if(b)return d(a,f,c),!0}}}}return!1}function w(a){a=n.get(a);return void 0===a?null:{key:a.map(function(a){return a.name+"{"+a.key+"}"}).join("\n"),customHooks:a.filter(function(a){a:switch(a.name){case "useState":case "React.useState":case "useReducer":case "React.useReducer":case "useEffect":case "React.useEffect":case "useLayoutEffect":case "React.useLayoutEffect":case "useMemo":case "React.useMemo":case "useCallback":case "React.useCallback":case "useRef":case "React.useRef":case "useContext":case "React.useContext":case "useImperativeMethods":case "React.useImperativeMethods":case "useDebugValue":case "React.useDebugValue":a=
|
|
14
13
|
!0;break a;default:a=!1}return!a}).map(function(a){return e.cloneDeep(a.callee)})}}function B(a){a=a.hub.file;var b=x.get(a);if(void 0!==b)return b;b=!1;for(var d=a.ast.comments,c=0;c<d.length;c++)if(-1!==d[c].value.indexOf("@refresh reset")){b=!0;break}x.set(a,b);return b}function v(a,b,d){var c=b.key;b=b.customHooks;var f=B(d.path),g=[];b.forEach(function(a){switch(a.type){case "MemberExpression":if("Identifier"===a.object.type)var b=a.object.name;break;case "Identifier":b=a.name}d.hasBinding(b)?
|
|
15
|
-
g.push(a):f=!0});b=c;"function"!==typeof require||p.emitFullSignatures||(b=require("crypto").createHash("sha1").update(c).digest("base64"));a=[a,e.stringLiteral(b)];(f||0<g.length)&&a.push(e.booleanLiteral(f));0<g.length&&a.push(e.functionExpression(null,[],e.blockStatement([e.returnStatement(e.arrayExpression(g))])));return a}var p=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"===typeof r.
|
|
14
|
+
g.push(a):f=!0});b=c;"function"!==typeof require||p.emitFullSignatures||(b=require("crypto").createHash("sha1").update(c).digest("base64"));a=[a,e.stringLiteral(b)];(f||0<g.length)&&a.push(e.booleanLiteral(f));0<g.length&&a.push(e.functionExpression(null,[],e.blockStatement([e.returnStatement(e.arrayExpression(g))])));return a}var p=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"===typeof r.env){var y=r.env();if("development"!==y&&!p.skipEnvCheck)throw Error('React Refresh Babel transform should only be enabled in development environment. Instead, the environment is: "'+
|
|
16
15
|
y+'". If you want to override this check, pass {skipEnvCheck: true} as plugin options.');}var e=r.types,C=e.identifier(p.refreshReg||"$RefreshReg$"),z=e.identifier(p.refreshSig||"$RefreshSig$"),l=new Map,x=new WeakMap,k=new WeakSet,q=new WeakSet,A=new WeakSet,n=new WeakMap,D={CallExpression:function(a){var b=a.node.callee,d=null;switch(b.type){case "Identifier":d=b.name;break;case "MemberExpression":d=b.property.name}if(null!==d&&/^use[A-Z]/.test(d)&&(b=a.scope.getFunctionParent(),null!==b)){b=b.block;
|
|
17
16
|
n.has(b)||n.set(b,[]);b=n.get(b);var c="";"VariableDeclarator"===a.parent.type&&(c=a.parentPath.get("id").getSource());var f=a.get("arguments");"useState"===d&&0<f.length?c+="("+f[0].getSource()+")":"useReducer"===d&&1<f.length&&(c+="("+f[1].getSource()+")");b.push({callee:a.node.callee,name:d,key:c})}}};return{visitor:{ExportDefaultDeclaration:function(a){var b=a.node,d=b.declaration,c=a.get("declaration");if("CallExpression"===d.type&&!k.has(b)){k.add(b);var f=a.parentPath;m("%default%",c,function(a,
|
|
18
17
|
b,c){null!==c&&(a=t(f,a),c.replaceWith(e.assignmentExpression("=",a,b)))})}},FunctionDeclaration:{enter:function(a){var b=a.node;switch(a.parent.type){case "Program":var d=a;var c=a.parentPath;break;case "ExportNamedDeclaration":d=a.parentPath;c=d.parentPath;break;case "ExportDefaultDeclaration":d=a.parentPath;c=d.parentPath;break;default:return}var f=b.id;null!==f&&(f=f.name,u(f)&&!k.has(b)&&(k.add(b),m(f,a,function(a,b){a=t(c,a);d.insertAfter(e.expressionStatement(e.assignmentExpression("=",a,b)))})))},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React v0.9.0
|
|
2
2
|
* react-refresh-runtime.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
12
|
if (process.env.NODE_ENV !== "production") {
|
|
15
13
|
(function() {
|
|
16
14
|
'use strict';
|
|
@@ -35,7 +33,6 @@ var REACT_LAZY_TYPE = 0xead4;
|
|
|
35
33
|
var REACT_BLOCK_TYPE = 0xead9;
|
|
36
34
|
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
37
35
|
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
38
|
-
var REACT_RESPONDER_TYPE = 0xead6;
|
|
39
36
|
var REACT_SCOPE_TYPE = 0xead7;
|
|
40
37
|
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
41
38
|
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
@@ -59,7 +56,6 @@ if (typeof Symbol === 'function' && Symbol.for) {
|
|
|
59
56
|
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
60
57
|
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
61
58
|
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
62
|
-
REACT_RESPONDER_TYPE = symbolFor('react.responder');
|
|
63
59
|
REACT_SCOPE_TYPE = symbolFor('react.scope');
|
|
64
60
|
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
|
|
65
61
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React v0.9.0
|
|
2
2
|
* react-refresh-runtime.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,5 +6,4 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
9
|
'use strict';throw Error("React Refresh runtime should not be included in the production bundle.");
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.9.0",
|
|
8
8
|
"homepage": "https://reactjs.org/",
|
|
9
9
|
"bugs": "https://github.com/facebook/react/issues",
|
|
10
10
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"cjs/",
|
|
18
18
|
"umd/"
|
|
19
19
|
],
|
|
20
|
-
"main": "
|
|
20
|
+
"main": "runtime.js",
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
23
|
"url": "https://github.com/facebook/react.git",
|