@umijs/bundler-webpack 4.0.0-rc.9 → 4.0.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.
Files changed (77) hide show
  1. package/client/client/client.js +65 -37
  2. package/client/constants.js +9 -0
  3. package/compiled/css-minimizer-webpack-plugin/index.js +7 -7
  4. package/compiled/cssnano/index.js +6 -6
  5. package/compiled/fork-ts-checker-webpack-plugin/index.js +7 -13
  6. package/compiled/{tapable → react-refresh}/LICENSE +6 -6
  7. package/compiled/react-refresh/index.js +9 -7
  8. package/compiled/react-refresh/package.json +1 -0
  9. package/compiled/webpack/BasicEffectRulePlugin.js +1 -0
  10. package/compiled/webpack/BasicMatcherRulePlugin.js +1 -0
  11. package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
  12. package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
  13. package/compiled/webpack/ObjectMatcherRulePlugin.js +1 -0
  14. package/compiled/webpack/RuleSetCompiler.js +1 -0
  15. package/compiled/webpack/UseEffectRulePlugin.js +1 -0
  16. package/compiled/webpack/deepImports.json +6 -1
  17. package/compiled/webpack/index.js +3978 -3167
  18. package/compiled/webpack/types.d.ts +606 -171
  19. package/compiled/webpack-dev-middleware/index.js +8 -7
  20. package/compiled/webpack-manifest-plugin/index.js +1 -1
  21. package/dist/build.d.ts +1 -0
  22. package/dist/build.js +49 -56
  23. package/dist/cli.js +6 -15
  24. package/dist/client/client.js +52 -50
  25. package/dist/config/_sampleFeature.js +6 -17
  26. package/dist/config/assetRules.js +44 -55
  27. package/dist/config/bundleAnalyzerPlugin.js +12 -23
  28. package/dist/config/compressPlugin.js +89 -70
  29. package/dist/config/config.d.ts +2 -0
  30. package/dist/config/config.js +181 -179
  31. package/dist/config/copyPlugin.js +29 -40
  32. package/dist/config/cssRules.js +114 -83
  33. package/dist/config/definePlugin.js +11 -19
  34. package/dist/config/detectDeadCodePlugin.js +16 -21
  35. package/dist/config/fastRefreshPlugin.js +11 -22
  36. package/dist/config/forkTSCheckerPlugin.js +11 -22
  37. package/dist/config/harmonyLinkingErrorPlugin.js +3 -14
  38. package/dist/config/ignorePlugin.js +10 -21
  39. package/dist/config/javaScriptRules.d.ts +1 -0
  40. package/dist/config/javaScriptRules.js +152 -136
  41. package/dist/config/manifestPlugin.d.ts +1 -1
  42. package/dist/config/manifestPlugin.js +10 -18
  43. package/dist/config/miniCSSExtractPlugin.js +15 -23
  44. package/dist/config/nodePolyfill.js +14 -20
  45. package/dist/config/nodePrefixPlugin.d.ts +11 -0
  46. package/dist/config/nodePrefixPlugin.js +14 -0
  47. package/dist/config/progressPlugin.js +7 -18
  48. package/dist/config/purgecssWebpackPlugin.js +15 -26
  49. package/dist/config/speedMeasureWebpackPlugin.js +12 -23
  50. package/dist/config/ssrPlugin.d.ts +11 -0
  51. package/dist/config/ssrPlugin.js +66 -0
  52. package/dist/config/svgRules.js +44 -47
  53. package/dist/constants.d.ts +1 -0
  54. package/dist/constants.js +7 -1
  55. package/dist/dev.d.ts +4 -0
  56. package/dist/dev.js +113 -93
  57. package/dist/index.d.ts +3 -0
  58. package/dist/index.js +16 -0
  59. package/dist/loader/svgr.js +4 -13
  60. package/dist/loader/swc.js +9 -14
  61. package/dist/plugins/ProgressPlugin.js +3 -3
  62. package/dist/plugins/RuntimePublicPathPlugin.js +4 -1
  63. package/dist/schema.js +21 -6
  64. package/dist/server/server.d.ts +3 -1
  65. package/dist/server/server.js +165 -159
  66. package/dist/server/ws.d.ts +7 -2
  67. package/dist/types.d.ts +3 -0
  68. package/dist/utils/getEsBuildTarget.d.ts +5 -0
  69. package/dist/utils/getEsBuildTarget.js +12 -0
  70. package/package.json +22 -20
  71. package/compiled/tapable/index.js +0 -1
  72. package/compiled/tapable/package.json +0 -1
  73. package/compiled/tapable/tapable.d.ts +0 -116
  74. package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +0 -11
  75. package/dist/plugins/ESBuildCSSMinifyPlugin.js +0 -63
  76. package/dist/plugins/ParcelCSSMinifyPlugin.d.ts +0 -10
  77. package/dist/plugins/ParcelCSSMinifyPlugin.js +0 -75
@@ -1,6 +1,6 @@
1
- The MIT License
1
+ MIT License
2
2
 
3
- Copyright JS Foundation and other contributors
3
+ Copyright (c) Facebook, Inc. and its affiliates.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  copies of the Software, and to permit persons to whom the Software is
10
10
  furnished to do so, subject to the following conditions:
11
11
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
14
 
15
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,19 +1,21 @@
1
- (function(){"use strict";var e={83:function(e,r,n){if(process.env.NODE_ENV==="production"){e.exports=n(487)}else{e.exports=n(938)}},938:function(e,r,n){
2
- /** @license React vundefined
3
- * react-refresh-babel.development.js
1
+ (function(){"use strict";var e={653:function(e,t){
2
+ /**
3
+ * @license React
4
+ * react-refresh-runtime.development.js
4
5
  *
5
6
  * Copyright (c) Facebook, Inc. and its affiliates.
6
7
  *
7
8
  * This source code is licensed under the MIT license found in the
8
9
  * LICENSE file in the root directory of this source tree.
9
10
  */
10
- if(process.env.NODE_ENV!=="production"){(function(){"use strict";function ReactFreshBabelPlugin(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(typeof e.env==="function"){var a=e.env();if(a!=="development"&&!r.skipEnvCheck){throw new Error("React Refresh Babel transform should only be enabled in development environment. "+'Instead, the environment is: "'+a+'". If you want to override this check, pass {skipEnvCheck: true} as plugin options.')}}var i=e.types;var s=i.identifier(r.refreshReg||"$RefreshReg$");var o=i.identifier(r.refreshSig||"$RefreshSig$");var c=new Map;function createRegistration(e,r){var n=e.scope.generateUidIdentifier("c");if(!c.has(e)){c.set(e,[])}var a=c.get(e);a.push({handle:n,persistentID:r});return n}function isComponentishName(e){return typeof e==="string"&&e[0]>="A"&&e[0]<="Z"}function findInnerComponents(e,r,n){var a=r.node;switch(a.type){case"Identifier":{if(!isComponentishName(a.name)){return false}n(e,a,null);return true}case"FunctionDeclaration":{n(e,a.id,null);return true}case"ArrowFunctionExpression":{if(a.body.type==="ArrowFunctionExpression"){return false}n(e,a,r);return true}case"FunctionExpression":{n(e,a,r);return true}case"CallExpression":{var i=r.get("arguments");if(i===undefined||i.length===0){return false}var s=r.get("callee");switch(s.node.type){case"MemberExpression":case"Identifier":{var o=s.getSource();var c=i[0];var l=e+"$"+o;var p=findInnerComponents(l,c,n);if(!p){return false}n(e,a,r);return true}default:{return false}}}case"VariableDeclarator":{var f=a.init;if(f===null){return false}var d=a.id.name;if(!isComponentishName(d)){return false}switch(f.type){case"ArrowFunctionExpression":case"FunctionExpression":break;case"CallExpression":{var h=f.callee;var v=h.type;if(v==="Import"){return false}else if(v==="Identifier"){if(h.name.indexOf("require")===0){return false}else if(h.name.indexOf("import")===0){return false}}break}case"TaggedTemplateExpression":break;default:return false}var g=r.get("init");var b=findInnerComponents(e,g,n);if(b){return true}var y=r.scope.getBinding(d);if(y===undefined){return}var E=false;var k=y.referencePaths;for(var _=0;_<k.length;_++){var S=k[_];if(S.node&&S.node.type!=="JSXIdentifier"&&S.node.type!=="Identifier"){continue}var P=S.parent;if(P.type==="JSXOpeningElement"){E=true}else if(P.type==="CallExpression"){var R=P.callee;var I=void 0;switch(R.type){case"Identifier":I=R.name;break;case"MemberExpression":I=R.property.name;break}switch(I){case"createElement":case"jsx":case"jsxDEV":case"jsxs":E=true;break}}if(E){n(e,f,g);return true}}}}return false}function isBuiltinHook(e){switch(e){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"useImperativeHandle":case"React.useImperativeHandle":case"useDebugValue":case"React.useDebugValue":return true;default:return false}}function getHookCallsSignature(e){var r=h.get(e);if(r===undefined){return null}return{key:r.map((function(e){return e.name+"{"+e.key+"}"})).join("\n"),customHooks:r.filter((function(e){return!isBuiltinHook(e.name)})).map((function(e){return i.cloneDeep(e.callee)}))}}var l=new WeakMap;function hasForceResetComment(e){var r=e.hub.file;var n=l.get(r);if(n!==undefined){return n}n=false;var a=r.ast.comments;for(var i=0;i<a.length;i++){var s=a[i];if(s.value.indexOf("@refresh reset")!==-1){n=true;break}}l.set(r,n);return n}function createArgumentsForSignature(e,a,s){var o=a.key,c=a.customHooks;var l=hasForceResetComment(s.path);var p=[];c.forEach((function(e){var r;switch(e.type){case"MemberExpression":if(e.object.type==="Identifier"){r=e.object.name}break;case"Identifier":r=e.name;break}if(s.hasBinding(r)){p.push(e)}else{l=true}}));var f=o;if(true&&!r.emitFullSignatures){f=n(113).createHash("sha1").update(o).digest("base64")}var d=[e,i.stringLiteral(f)];if(l||p.length>0){d.push(i.booleanLiteral(l))}if(p.length>0){d.push(i.functionExpression(null,[],i.blockStatement([i.returnStatement(i.arrayExpression(p))])))}return d}function findHOCCallPathsAbove(e){var r=[];while(true){if(!e){return r}var n=e.parentPath;if(!n){return r}if(n.node.type==="AssignmentExpression"&&e.node===n.node.right){e=n;continue}if(n.node.type==="CallExpression"&&e.node!==n.node.callee){r.push(n);e=n;continue}return r}}var p=new WeakSet;var f=new WeakSet;var d=new WeakSet;var h=new WeakMap;var v={CallExpression:function(e){var r=e.node;var n=r.callee;var a=null;switch(n.type){case"Identifier":a=n.name;break;case"MemberExpression":a=n.property.name;break}if(a===null||!/^use[A-Z]/.test(a)){return}var i=e.scope.getFunctionParent();if(i===null){return}var s=i.block;if(!h.has(s)){h.set(s,[])}var o=h.get(s);var c="";if(e.parent.type==="VariableDeclarator"){c=e.parentPath.get("id").getSource()}var l=e.get("arguments");if(a==="useState"&&l.length>0){c+="("+l[0].getSource()+")"}else if(a==="useReducer"&&l.length>1){c+="("+l[1].getSource()+")"}o.push({callee:e.node.callee,name:a,key:c})}};return{visitor:{ExportDefaultDeclaration:function(e){var r=e.node;var n=r.declaration;var a=e.get("declaration");if(n.type!=="CallExpression"){return}if(p.has(r)){return}p.add(r);var s="%default%";var o=e.parentPath;findInnerComponents(s,a,(function(e,r,n){if(n===null){return}var a=createRegistration(o,e);n.replaceWith(i.assignmentExpression("=",a,r))}))},FunctionDeclaration:{enter:function(e){var r=e.node;var n;var a;var s="";switch(e.parent.type){case"Program":a=e;n=e.parentPath;break;case"TSModuleBlock":a=e;n=a.parentPath.parentPath;break;case"ExportNamedDeclaration":a=e.parentPath;n=a.parentPath;break;case"ExportDefaultDeclaration":a=e.parentPath;n=a.parentPath;break;default:return}if(e.parent.type==="TSModuleBlock"||e.parent.type==="ExportNamedDeclaration"){while(n.type!=="Program"){if(n.type==="TSModuleDeclaration"){if(n.parentPath.type!=="Program"&&n.parentPath.type!=="ExportNamedDeclaration"){return}s=n.node.id.name+"$"+s}n=n.parentPath}}var o=r.id;if(o===null){return}var c=o.name;if(!isComponentishName(c)){return}if(p.has(r)){return}p.add(r);var l=s+c;findInnerComponents(l,e,(function(e,r){var s=createRegistration(n,e);a.insertAfter(i.expressionStatement(i.assignmentExpression("=",s,r)))}))},exit:function(e){var r=e.node;var n=r.id;if(n===null){return}var a=getHookCallsSignature(r);if(a===null){return}if(f.has(r)){return}f.add(r);var s=e.scope.generateUidIdentifier("_s");e.scope.parent.push({id:s,init:i.callExpression(o,[])});e.get("body").unshiftContainer("body",i.expressionStatement(i.callExpression(s,[])));var c=null;e.find((function(e){if(e.parentPath.isBlock()){c=e;return true}}));if(c===null){return}c.insertAfter(i.expressionStatement(i.callExpression(s,createArgumentsForSignature(n,a,c.scope))))}},"ArrowFunctionExpression|FunctionExpression":{exit:function(e){var r=e.node;var n=getHookCallsSignature(r);if(n===null){return}if(f.has(r)){return}f.add(r);var a=e.scope.generateUidIdentifier("_s");e.scope.parent.push({id:a,init:i.callExpression(o,[])});if(e.node.body.type!=="BlockStatement"){e.node.body=i.blockStatement([i.returnStatement(e.node.body)])}e.get("body").unshiftContainer("body",i.expressionStatement(i.callExpression(a,[])));if(e.parent.type==="VariableDeclarator"){var s=null;e.find((function(e){if(e.parentPath.isBlock()){s=e;return true}}));if(s===null){return}s.insertAfter(i.expressionStatement(i.callExpression(a,createArgumentsForSignature(e.parent.id,n,s.scope))))}else{var c=[e].concat(findHOCCallPathsAbove(e));c.forEach((function(e){e.replaceWith(i.callExpression(a,createArgumentsForSignature(e.node,n,e.scope)))}))}}},VariableDeclaration:function(e){var r=e.node;var n;var a;var s="";switch(e.parent.type){case"Program":a=e;n=e.parentPath;break;case"TSModuleBlock":a=e;n=a.parentPath.parentPath;break;case"ExportNamedDeclaration":a=e.parentPath;n=a.parentPath;break;case"ExportDefaultDeclaration":a=e.parentPath;n=a.parentPath;break;default:return}if(e.parent.type==="TSModuleBlock"||e.parent.type==="ExportNamedDeclaration"){while(n.type!=="Program"){if(n.type==="TSModuleDeclaration"){if(n.parentPath.type!=="Program"&&n.parentPath.type!=="ExportNamedDeclaration"){return}s=n.node.id.name+"$"+s}n=n.parentPath}}if(p.has(r)){return}p.add(r);var o=e.get("declarations");if(o.length!==1){return}var c=o[0];var l=c.node.id.name;var f=s+l;findInnerComponents(f,c,(function(e,r,s){if(s===null){return}var o=createRegistration(n,e);if(s.parent.type==="VariableDeclarator"){a.insertAfter(i.expressionStatement(i.assignmentExpression("=",o,c.node.id)))}else{s.replaceWith(i.assignmentExpression("=",o,r))}}))},Program:{enter:function(e){e.traverse(v)},exit:function(e){var r=c.get(e);if(r===undefined){return}var n=e.node;if(d.has(n)){return}d.add(n);c.delete(e);var a=[];e.pushContainer("body",i.variableDeclaration("var",a));r.forEach((function(r){var n=r.handle,o=r.persistentID;e.pushContainer("body",i.expressionStatement(i.callExpression(s,[n,i.stringLiteral(o)])));a.push(i.variableDeclarator(n))}))}}}}}e.exports=ReactFreshBabelPlugin})()}},487:function(e,r,n){
11
- /** @license React vundefined
12
- * react-refresh-babel.production.min.js
11
+ if(process.env.NODE_ENV!=="production"){(function(){"use strict";var e=Symbol.for("react.forward_ref");var r=Symbol.for("react.memo");var n=typeof WeakMap==="function"?WeakMap:Map;var o=new Map;var i=new n;var a=new n;var u=new n;var f=[];var s=new Map;var c=new Map;var l=new Set;var d=new Set;var p=typeof WeakMap==="function"?new WeakMap:null;var y=false;function computeFullKey(e){if(e.fullKey!==null){return e.fullKey}var t=e.ownKey;var r;try{r=e.getCustomHooks()}catch(r){e.forceReset=true;e.fullKey=t;return t}for(var n=0;n<r.length;n++){var o=r[n];if(typeof o!=="function"){e.forceReset=true;e.fullKey=t;return t}var i=a.get(o);if(i===undefined){continue}var u=computeFullKey(i);if(i.forceReset){e.forceReset=true}t+="\n---\n"+u}e.fullKey=t;return t}function haveEqualSignatures(e,t){var r=a.get(e);var n=a.get(t);if(r===undefined&&n===undefined){return true}if(r===undefined||n===undefined){return false}if(computeFullKey(r)!==computeFullKey(n)){return false}if(n.forceReset){return false}return true}function isReactClass(e){return e.prototype&&e.prototype.isReactComponent}function canPreserveStateBetween(e,t){if(isReactClass(e)||isReactClass(t)){return false}if(haveEqualSignatures(e,t)){return true}return false}function resolveFamily(e){return u.get(e)}function cloneMap(e){var t=new Map;e.forEach((function(e,r){t.set(r,e)}));return t}function cloneSet(e){var t=new Set;e.forEach((function(e){t.add(e)}));return t}function getProperty(e,t){try{return e[t]}catch(e){return undefined}}function performReactRefresh(){if(f.length===0){return null}if(y){return null}y=true;try{var e=new Set;var t=new Set;var r=f;f=[];r.forEach((function(r){var n=r[0],o=r[1];var i=n.current;u.set(i,n);u.set(o,n);n.current=o;if(canPreserveStateBetween(i,o)){t.add(n)}else{e.add(n)}}));var n={updatedFamilies:t,staleFamilies:e};s.forEach((function(e){e.setRefreshHandler(resolveFamily)}));var o=false;var i=null;var a=cloneSet(d);var h=cloneSet(l);var v=cloneMap(c);a.forEach((function(e){var t=v.get(e);if(t===undefined){throw new Error("Could not find helpers for a root. This is a bug in React Refresh.")}if(!d.has(e)){}if(p===null){return}if(!p.has(e)){return}var r=p.get(e);try{t.scheduleRoot(e,r)}catch(e){if(!o){o=true;i=e}}}));h.forEach((function(e){var t=v.get(e);if(t===undefined){throw new Error("Could not find helpers for a root. This is a bug in React Refresh.")}if(!l.has(e)){}try{t.scheduleRefresh(e,n)}catch(e){if(!o){o=true;i=e}}}));if(o){throw i}return n}finally{y=false}}function register(t,n){{if(t===null){return}if(typeof t!=="function"&&typeof t!=="object"){return}if(i.has(t)){return}var a=o.get(n);if(a===undefined){a={current:t};o.set(n,a)}else{f.push([a,t])}i.set(t,a);if(typeof t==="object"&&t!==null){switch(getProperty(t,"$$typeof")){case e:register(t.render,n+"$render");break;case r:register(t.type,n+"$type");break}}}}function setSignature(t,n){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var i=arguments.length>3?arguments[3]:undefined;{if(!a.has(t)){a.set(t,{forceReset:o,ownKey:n,fullKey:null,getCustomHooks:i||function(){return[]}})}if(typeof t==="object"&&t!==null){switch(getProperty(t,"$$typeof")){case e:setSignature(t.render,n,o,i);break;case r:setSignature(t.type,n,o,i);break}}}}function collectCustomHooksForSignature(e){{var t=a.get(e);if(t!==undefined){computeFullKey(t)}}}function getFamilyByID(e){{return o.get(e)}}function getFamilyByType(e){{return i.get(e)}}function findAffectedHostInstances(e){{var t=new Set;l.forEach((function(r){var n=c.get(r);if(n===undefined){throw new Error("Could not find helpers for a root. This is a bug in React Refresh.")}var o=n.findHostInstancesForRefresh(r,e);o.forEach((function(e){t.add(e)}))}));return t}}function injectIntoGlobalHook(e){{var t=e.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t===undefined){var r=0;e.__REACT_DEVTOOLS_GLOBAL_HOOK__=t={renderers:new Map,supportsFiber:true,inject:function(e){return r++},onScheduleFiberRoot:function(e,t,r){},onCommitFiberRoot:function(e,t,r,n){},onCommitFiberUnmount:function(){}}}if(t.isDisabled){console["warn"]("Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). "+"Fast Refresh is not compatible with this shim and will be disabled.");return}var n=t.inject;t.inject=function(e){var t=n.apply(this,arguments);if(typeof e.scheduleRefresh==="function"&&typeof e.setRefreshHandler==="function"){s.set(t,e)}return t};t.renderers.forEach((function(e,t){if(typeof e.scheduleRefresh==="function"&&typeof e.setRefreshHandler==="function"){s.set(t,e)}}));var o=t.onCommitFiberRoot;var i=t.onScheduleFiberRoot||function(){};t.onScheduleFiberRoot=function(e,t,r){if(!y){d.delete(t);if(p!==null){p.set(t,r)}}return i.apply(this,arguments)};t.onCommitFiberRoot=function(e,t,r,n){var i=s.get(e);if(i!==undefined){c.set(t,i);var a=t.current;var u=a.alternate;if(u!==null){var f=u.memoizedState!=null&&u.memoizedState.element!=null&&l.has(t);var p=a.memoizedState!=null&&a.memoizedState.element!=null;if(!f&&p){l.add(t);d.delete(t)}else if(f&&p);else if(f&&!p){l.delete(t);if(n){d.add(t)}else{c.delete(t)}}else if(!f&&!p){if(n){d.add(t)}}}else{l.add(t)}}return o.apply(this,arguments)}}}function hasUnrecoverableErrors(){return false}function _getMountedRootCount(){{return l.size}}function createSignatureFunctionForTransform(){{var e;var t;var r=false;return function(n,o,i,a){if(typeof o==="string"){if(!e){e=n;t=typeof a==="function"}if(n!=null&&(typeof n==="function"||typeof n==="object")){setSignature(n,o,i,a)}return n}else{if(!r&&t){r=true;collectCustomHooksForSignature(e)}}}}}function isLikelyComponentType(t){{switch(typeof t){case"function":{if(t.prototype!=null){if(t.prototype.isReactComponent){return true}var n=Object.getOwnPropertyNames(t.prototype);if(n.length>1||n[0]!=="constructor"){return false}if(t.prototype.__proto__!==Object.prototype){return false}}var o=t.name||t.displayName;return typeof o==="string"&&/^[A-Z]/.test(o)}case"object":{if(t!=null){switch(getProperty(t,"$$typeof")){case e:case r:return true;default:return false}}return false}default:{return false}}}}t._getMountedRootCount=_getMountedRootCount;t.collectCustomHooksForSignature=collectCustomHooksForSignature;t.createSignatureFunctionForTransform=createSignatureFunctionForTransform;t.findAffectedHostInstances=findAffectedHostInstances;t.getFamilyByID=getFamilyByID;t.getFamilyByType=getFamilyByType;t.hasUnrecoverableErrors=hasUnrecoverableErrors;t.injectIntoGlobalHook=injectIntoGlobalHook;t.isLikelyComponentType=isLikelyComponentType;t.performReactRefresh=performReactRefresh;t.register=register;t.setSignature=setSignature})()}},665:function(){
12
+ /**
13
+ * @license React
14
+ * react-refresh-runtime.production.min.js
13
15
  *
14
16
  * Copyright (c) Facebook, Inc. and its affiliates.
15
17
  *
16
18
  * This source code is licensed under the MIT license found in the
17
19
  * LICENSE file in the root directory of this source tree.
18
20
  */
19
- e.exports=function(e){function t(e,r){var n=e.scope.generateUidIdentifier("c");c.has(e)||c.set(e,[]);c.get(e).push({handle:n,persistentID:r});return n}function u(e){return"string"===typeof e&&"A"<=e[0]&&"Z">=e[0]}function m(e,r,n){var a=r.node;switch(a.type){case"Identifier":if(!u(a.name))break;n(e,a,null);return!0;case"FunctionDeclaration":return n(e,a.id,null),!0;case"ArrowFunctionExpression":if("ArrowFunctionExpression"===a.body.type)break;n(e,a,r);return!0;case"FunctionExpression":return n(e,a,r),!0;case"CallExpression":var i=r.get("arguments");if(void 0===i||0===i.length)break;var s=r.get("callee");switch(s.node.type){case"MemberExpression":case"Identifier":s=s.getSource();if(!m(e+"$"+s,i[0],n))return!1;n(e,a,r);return!0;default:return!1}case"VariableDeclarator":if(i=a.init,null!==i&&(s=a.id.name,u(s))){switch(i.type){case"ArrowFunctionExpression":case"FunctionExpression":break;case"CallExpression":a=i.callee;var o=a.type;if("Import"===o||"Identifier"===o&&(0===a.name.indexOf("require")||0===a.name.indexOf("import")))return!1;break;case"TaggedTemplateExpression":break;default:return!1}a=r.get("init");if(m(e,a,n))return!0;s=r.scope.getBinding(s);if(void 0===s)return;r=!1;s=s.referencePaths;for(o=0;o<s.length;o++){var c=s[o];if(!c.node||"JSXIdentifier"===c.node.type||"Identifier"===c.node.type){c=c.parent;if("JSXOpeningElement"===c.type)r=!0;else if("CallExpression"===c.type){c=c.callee;var l=void 0;switch(c.type){case"Identifier":l=c.name;break;case"MemberExpression":l=c.property.name}switch(l){case"createElement":case"jsx":case"jsxDEV":case"jsxs":r=!0}}if(r)return n(e,i,a),!0}}}}return!1}function x(e){e=h.get(e);return void 0===e?null:{key:e.map((function(e){return e.name+"{"+e.key+"}"})).join("\n"),customHooks:e.filter((function(e){e:switch(e.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"useImperativeHandle":case"React.useImperativeHandle":case"useDebugValue":case"React.useDebugValue":e=!0;break e;default:e=!1}return!e})).map((function(e){return i.cloneDeep(e.callee)}))}}function C(e){e=e.hub.file;var r=l.get(e);if(void 0!==r)return r;r=!1;for(var n=e.ast.comments,a=0;a<n.length;a++)if(-1!==n[a].value.indexOf("@refresh reset")){r=!0;break}l.set(e,r);return r}function w(e,a,s){var o=a.key;a=a.customHooks;var c=C(s.path),l=[];a.forEach((function(e){switch(e.type){case"MemberExpression":if("Identifier"===e.object.type)var r=e.object.name;break;case"Identifier":r=e.name}s.hasBinding(r)?l.push(e):c=!0}));a=o;false||r.emitFullSignatures||(a=n(113).createHash("sha1").update(o).digest("base64"));e=[e,i.stringLiteral(a)];(c||0<l.length)&&e.push(i.booleanLiteral(c));0<l.length&&e.push(i.functionExpression(null,[],i.blockStatement([i.returnStatement(i.arrayExpression(l))])));return e}function D(e){for(var r=[];;){if(!e)return r;var n=e.parentPath;if(!n)return r;if("AssignmentExpression"===n.node.type&&e.node===n.node.right)e=n;else if("CallExpression"===n.node.type&&e.node!==n.node.callee)r.push(n),e=n;else return r}}var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"===typeof e.env){var a=e.env();if("development"!==a&&!r.skipEnvCheck)throw Error('React Refresh Babel transform should only be enabled in development environment. Instead, the environment is: "'+a+'". If you want to override this check, pass {skipEnvCheck: true} as plugin options.')}var i=e.types,s=i.identifier(r.refreshReg||"$RefreshReg$"),o=i.identifier(r.refreshSig||"$RefreshSig$"),c=new Map,l=new WeakMap,p=new WeakSet,f=new WeakSet,d=new WeakSet,h=new WeakMap,v={CallExpression:function(e){var r=e.node.callee,n=null;switch(r.type){case"Identifier":n=r.name;break;case"MemberExpression":n=r.property.name}if(null!==n&&/^use[A-Z]/.test(n)&&(r=e.scope.getFunctionParent(),null!==r)){r=r.block;h.has(r)||h.set(r,[]);r=h.get(r);var a="";"VariableDeclarator"===e.parent.type&&(a=e.parentPath.get("id").getSource());var i=e.get("arguments");"useState"===n&&0<i.length?a+="("+i[0].getSource()+")":"useReducer"===n&&1<i.length&&(a+="("+i[1].getSource()+")");r.push({callee:e.node.callee,name:n,key:a})}}};return{visitor:{ExportDefaultDeclaration:function(e){var r=e.node,n=r.declaration,a=e.get("declaration");if("CallExpression"===n.type&&!p.has(r)){p.add(r);var s=e.parentPath;m("%default%",a,(function(e,r,n){null!==n&&(e=t(s,e),n.replaceWith(i.assignmentExpression("=",e,r)))}))}},FunctionDeclaration:{enter:function(e){var r=e.node,n="";switch(e.parent.type){case"Program":var a=e;var s=e.parentPath;break;case"TSModuleBlock":a=e;s=a.parentPath.parentPath;break;case"ExportNamedDeclaration":a=e.parentPath;s=a.parentPath;break;case"ExportDefaultDeclaration":a=e.parentPath;s=a.parentPath;break;default:return}if("TSModuleBlock"===e.parent.type||"ExportNamedDeclaration"===e.parent.type)for(;"Program"!==s.type;){if("TSModuleDeclaration"===s.type){if("Program"!==s.parentPath.type&&"ExportNamedDeclaration"!==s.parentPath.type)return;n=s.node.id.name+"$"+n}s=s.parentPath}var o=r.id;null!==o&&(o=o.name,u(o)&&!p.has(r)&&(p.add(r),m(n+o,e,(function(e,r){e=t(s,e);a.insertAfter(i.expressionStatement(i.assignmentExpression("=",e,r)))}))))},exit:function(e){var r=e.node,n=r.id;if(null!==n){var a=x(r);if(null!==a&&!f.has(r)){f.add(r);r=e.scope.generateUidIdentifier("_s");e.scope.parent.push({id:r,init:i.callExpression(o,[])});e.get("body").unshiftContainer("body",i.expressionStatement(i.callExpression(r,[])));var s=null;e.find((function(e){if(e.parentPath.isBlock())return s=e,!0}));null!==s&&s.insertAfter(i.expressionStatement(i.callExpression(r,w(n,a,s.scope))))}}}},"ArrowFunctionExpression|FunctionExpression":{exit:function(e){var r=e.node,n=x(r);if(null!==n&&!f.has(r)){f.add(r);var a=e.scope.generateUidIdentifier("_s");e.scope.parent.push({id:a,init:i.callExpression(o,[])});"BlockStatement"!==e.node.body.type&&(e.node.body=i.blockStatement([i.returnStatement(e.node.body)]));e.get("body").unshiftContainer("body",i.expressionStatement(i.callExpression(a,[])));if("VariableDeclarator"===e.parent.type){var s=null;e.find((function(e){if(e.parentPath.isBlock())return s=e,!0}));null!==s&&s.insertAfter(i.expressionStatement(i.callExpression(a,w(e.parent.id,n,s.scope))))}else[e].concat(D(e)).forEach((function(e){e.replaceWith(i.callExpression(a,w(e.node,n,e.scope)))}))}}},VariableDeclaration:function(e){var r=e.node,n="";switch(e.parent.type){case"Program":var a=e;var s=e.parentPath;break;case"TSModuleBlock":a=e;s=a.parentPath.parentPath;break;case"ExportNamedDeclaration":a=e.parentPath;s=a.parentPath;break;case"ExportDefaultDeclaration":a=e.parentPath;s=a.parentPath;break;default:return}if("TSModuleBlock"===e.parent.type||"ExportNamedDeclaration"===e.parent.type)for(;"Program"!==s.type;){if("TSModuleDeclaration"===s.type){if("Program"!==s.parentPath.type&&"ExportNamedDeclaration"!==s.parentPath.type)return;n=s.node.id.name+"$"+n}s=s.parentPath}if(!p.has(r)&&(p.add(r),e=e.get("declarations"),1===e.length)){var o=e[0];m(n+o.node.id.name,o,(function(e,r,n){null!==n&&(e=t(s,e),"VariableDeclarator"===n.parent.type?a.insertAfter(i.expressionStatement(i.assignmentExpression("=",e,o.node.id))):n.replaceWith(i.assignmentExpression("=",e,r)))}))}},Program:{enter:function(e){e.traverse(v)},exit:function(e){var r=c.get(e);if(void 0!==r){var n=e.node;if(!d.has(n)){d.add(n);c.delete(e);var a=[];e.pushContainer("body",i.variableDeclaration("var",a));r.forEach((function(r){var n=r.handle;e.pushContainer("body",i.expressionStatement(i.callExpression(s,[n,i.stringLiteral(r.persistentID)])));a.push(i.variableDeclarator(n))}))}}}}}}}},113:function(e){e.exports=require("crypto")}};var r={};function __nccwpck_require__(n){var a=r[n];if(a!==undefined){return a.exports}var i=r[n]={exports:{}};var s=true;try{e[n](i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete r[n]}return i.exports}!function(){__nccwpck_require__.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};__nccwpck_require__.d(r,{a:r});return r}}();!function(){__nccwpck_require__.d=function(e,r){for(var n in r){if(__nccwpck_require__.o(r,n)&&!__nccwpck_require__.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:r[n]})}}}}();!function(){__nccwpck_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)}}();!function(){__nccwpck_require__.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n={};!function(){__nccwpck_require__.r(n);var e=__nccwpck_require__(83);var r=__nccwpck_require__.n(e);n["default"]=r()}();module.exports=n})();
21
+ throw Error("React Refresh runtime should not be included in the production bundle.")},999:function(e,t,r){if(process.env.NODE_ENV==="production"){e.exports=r(665)}else{e.exports=r(653)}}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var o=t[r]={exports:{}};var i=true;try{e[r](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(999);module.exports=r})();
@@ -0,0 +1 @@
1
+ {"name":"react-refresh","license":"MIT"}
@@ -0,0 +1 @@
1
+ module.exports = require('./').BasicEffectRulePlugin;
@@ -0,0 +1 @@
1
+ module.exports = require('./').BasicMatcherRulePlugin;
@@ -28,7 +28,8 @@ module.exports = function () {
28
28
  var currentStatus = "idle";
29
29
 
30
30
  // while downloading
31
- var blockingPromises;
31
+ var blockingPromises = 0;
32
+ var blockingPromisesWaiting = [];
32
33
 
33
34
  // The update info
34
35
  var currentUpdateApplyHandlers;
@@ -218,17 +219,28 @@ module.exports = function () {
218
219
  return Promise.all(results);
219
220
  }
220
221
 
222
+ function unblock() {
223
+ if (--blockingPromises === 0) {
224
+ setStatus("ready").then(function () {
225
+ if (blockingPromises === 0) {
226
+ var list = blockingPromisesWaiting;
227
+ blockingPromisesWaiting = [];
228
+ for (var i = 0; i < list.length; i++) {
229
+ list[i]();
230
+ }
231
+ }
232
+ });
233
+ }
234
+ }
235
+
221
236
  function trackBlockingPromise(promise) {
222
237
  switch (currentStatus) {
223
238
  case "ready":
224
239
  setStatus("prepare");
225
- blockingPromises.push(promise);
226
- waitForBlockingPromises(function () {
227
- return setStatus("ready");
228
- });
229
- return promise;
240
+ /* fallthrough */
230
241
  case "prepare":
231
- blockingPromises.push(promise);
242
+ blockingPromises++;
243
+ promise.then(unblock, unblock);
232
244
  return promise;
233
245
  default:
234
246
  return promise;
@@ -236,11 +248,11 @@ module.exports = function () {
236
248
  }
237
249
 
238
250
  function waitForBlockingPromises(fn) {
239
- if (blockingPromises.length === 0) return fn();
240
- var blocker = blockingPromises;
241
- blockingPromises = [];
242
- return Promise.all(blocker).then(function () {
243
- return waitForBlockingPromises(fn);
251
+ if (blockingPromises === 0) return fn();
252
+ return new Promise(function (resolve) {
253
+ blockingPromisesWaiting.push(function () {
254
+ resolve(fn());
255
+ });
244
256
  });
245
257
  }
246
258
 
@@ -261,7 +273,6 @@ module.exports = function () {
261
273
 
262
274
  return setStatus("prepare").then(function () {
263
275
  var updatedModules = [];
264
- blockingPromises = [];
265
276
  currentUpdateApplyHandlers = [];
266
277
 
267
278
  return Promise.all(
@@ -298,7 +309,11 @@ module.exports = function () {
298
309
  function hotApply(options) {
299
310
  if (currentStatus !== "ready") {
300
311
  return Promise.resolve().then(function () {
301
- throw new Error("apply() is only allowed in ready status");
312
+ throw new Error(
313
+ "apply() is only allowed in ready status (state: " +
314
+ currentStatus +
315
+ ")"
316
+ );
302
317
  });
303
318
  }
304
319
  return internalApply(options);
@@ -443,15 +443,16 @@ module.exports = function () {
443
443
  ) {
444
444
  promises.push($loadUpdateChunk$(chunkId, updatedModulesList));
445
445
  currentUpdateChunks[chunkId] = true;
446
+ } else {
447
+ currentUpdateChunks[chunkId] = false;
446
448
  }
447
449
  });
448
450
  if ($ensureChunkHandlers$) {
449
451
  $ensureChunkHandlers$.$key$Hmr = function (chunkId, promises) {
450
452
  if (
451
453
  currentUpdateChunks &&
452
- !$hasOwnProperty$(currentUpdateChunks, chunkId) &&
453
- $hasOwnProperty$($installedChunks$, chunkId) &&
454
- $installedChunks$[chunkId] !== undefined
454
+ $hasOwnProperty$(currentUpdateChunks, chunkId) &&
455
+ !currentUpdateChunks[chunkId]
455
456
  ) {
456
457
  promises.push($loadUpdateChunk$(chunkId));
457
458
  currentUpdateChunks[chunkId] = true;
@@ -0,0 +1 @@
1
+ module.exports = require('./').ObjectMatcherRulePlugin;
@@ -0,0 +1 @@
1
+ module.exports = require('./').RuleSetCompiler;
@@ -0,0 +1 @@
1
+ module.exports = require('./').UseEffectRulePlugin;
@@ -8,5 +8,10 @@
8
8
  "webpack/lib/RuntimeGlobals",
9
9
  "webpack/lib/RuntimeModule",
10
10
  "webpack/lib/SingleEntryPlugin",
11
- "webpack/lib/Template"
11
+ "webpack/lib/Template",
12
+ "webpack/lib/rules/BasicEffectRulePlugin",
13
+ "webpack/lib/rules/BasicMatcherRulePlugin",
14
+ "webpack/lib/rules/ObjectMatcherRulePlugin",
15
+ "webpack/lib/rules/RuleSetCompiler",
16
+ "webpack/lib/rules/UseEffectRulePlugin"
12
17
  ]