diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentUsingHooksIndirectly.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentUsingHooksIndirectly.js
new file mode 100644
index 0000000000000..6925712d17c7c
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentUsingHooksIndirectly.js
@@ -0,0 +1,45 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Component = Component;
+
+var _react = _interopRequireWildcard(require("react"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/**
+ * 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
+ */
+function Component() {
+ const countState = (0, _react.useState)(0);
+ const count = countState[0];
+ const setCount = countState[1];
+ const darkMode = useIsDarkMode();
+ const [isDarkMode] = darkMode;
+ (0, _react.useEffect)(() => {// ...
+ }, []);
+
+ const handleClick = () => setCount(count + 1);
+
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, "Dark mode? ", isDarkMode), /*#__PURE__*/_react.default.createElement("div", null, "Count: ", count), /*#__PURE__*/_react.default.createElement("button", {
+ onClick: handleClick
+ }, "Update count"));
+}
+
+function useIsDarkMode() {
+ const darkModeState = (0, _react.useState)(false);
+ const [isDarkMode] = darkModeState;
+ (0, _react.useEffect)(function useEffectCreate() {// Here is where we may listen to a "theme" event...
+ }, []);
+ return [isDarkMode, () => {}];
+}
+//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentUsingHooksIndirectly.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentUsingHooksIndirectly.js.map
new file mode 100644
index 0000000000000..4d9e81529d3d7
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentUsingHooksIndirectly.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["ComponentUsingHooksIndirectly.js"],"names":["Component","countState","count","setCount","darkMode","useIsDarkMode","isDarkMode","handleClick","darkModeState","useEffectCreate"],"mappings":";;;;;;;AASA;;;;;;AATA;;;;;;;;AAWO,SAASA,SAAT,GAAqB;AAC1B,QAAMC,UAAU,GAAG,qBAAS,CAAT,CAAnB;AACA,QAAMC,KAAK,GAAGD,UAAU,CAAC,CAAD,CAAxB;AACA,QAAME,QAAQ,GAAGF,UAAU,CAAC,CAAD,CAA3B;AAEA,QAAMG,QAAQ,GAAGC,aAAa,EAA9B;AACA,QAAM,CAACC,UAAD,IAAeF,QAArB;AAEA,wBAAU,MAAM,CACd;AACD,GAFD,EAEG,EAFH;;AAIA,QAAMG,WAAW,GAAG,MAAMJ,QAAQ,CAACD,KAAK,GAAG,CAAT,CAAlC;;AAEA,sBACE,yEACE,yDAAiBI,UAAjB,CADF,eAEE,qDAAaJ,KAAb,CAFF,eAGE;AAAQ,IAAA,OAAO,EAAEK;AAAjB,oBAHF,CADF;AAOD;;AAED,SAASF,aAAT,GAAyB;AACvB,QAAMG,aAAa,GAAG,qBAAS,KAAT,CAAtB;AACA,QAAM,CAACF,UAAD,IAAeE,aAArB;AAEA,wBAAU,SAASC,eAAT,GAA2B,CACnC;AACD,GAFD,EAEG,EAFH;AAIA,SAAO,CAACH,UAAD,EAAa,MAAM,CAAE,CAArB,CAAP;AACD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport React, {useEffect, useState} from 'react';\n\nexport function Component() {\n const countState = useState(0);\n const count = countState[0];\n const setCount = countState[1];\n\n const darkMode = useIsDarkMode();\n const [isDarkMode] = darkMode;\n\n useEffect(() => {\n // ...\n }, []);\n\n const handleClick = () => setCount(count + 1);\n\n return (\n <>\n
Dark mode? {isDarkMode}
\n
Count: {count}
\n \n >\n );\n}\n\nfunction useIsDarkMode() {\n const darkModeState = useState(false);\n const [isDarkMode] = darkModeState;\n\n useEffect(function useEffectCreate() {\n // Here is where we may listen to a \"theme\" event...\n }, []);\n\n return [isDarkMode, () => {}];\n}\n"]}}]}
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithCustomHook.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithCustomHook.js
new file mode 100644
index 0000000000000..e326d7a4962d5
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithCustomHook.js
@@ -0,0 +1,41 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Component = Component;
+
+var _react = _interopRequireWildcard(require("react"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/**
+ * 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
+ */
+function Component() {
+ const [count, setCount] = (0, _react.useState)(0);
+ const isDarkMode = useIsDarkMode();
+ (0, _react.useEffect)(() => {// ...
+ }, []);
+
+ const handleClick = () => setCount(count + 1);
+
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, "Dark mode? ", isDarkMode), /*#__PURE__*/_react.default.createElement("div", null, "Count: ", count), /*#__PURE__*/_react.default.createElement("button", {
+ onClick: handleClick
+ }, "Update count"));
+}
+
+function useIsDarkMode() {
+ const [isDarkMode] = (0, _react.useState)(false);
+ (0, _react.useEffect)(function useEffectCreate() {// Here is where we may listen to a "theme" event...
+ }, []);
+ return isDarkMode;
+}
+//# sourceMappingURL=ComponentWithCustomHook.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithCustomHook.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithCustomHook.js.map
new file mode 100644
index 0000000000000..420fcfb556063
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithCustomHook.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["ComponentWithCustomHook.js"],"names":["Component","count","setCount","isDarkMode","useIsDarkMode","handleClick","useEffectCreate"],"mappings":";;;;;;;AASA;;;;;;AATA;;;;;;;;AAWO,SAASA,SAAT,GAAqB;AAC1B,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoB,qBAAS,CAAT,CAA1B;AACA,QAAMC,UAAU,GAAGC,aAAa,EAAhC;AAEA,wBAAU,MAAM,CACd;AACD,GAFD,EAEG,EAFH;;AAIA,QAAMC,WAAW,GAAG,MAAMH,QAAQ,CAACD,KAAK,GAAG,CAAT,CAAlC;;AAEA,sBACE,yEACE,yDAAiBE,UAAjB,CADF,eAEE,qDAAaF,KAAb,CAFF,eAGE;AAAQ,IAAA,OAAO,EAAEI;AAAjB,oBAHF,CADF;AAOD;;AAED,SAASD,aAAT,GAAyB;AACvB,QAAM,CAACD,UAAD,IAAe,qBAAS,KAAT,CAArB;AAEA,wBAAU,SAASG,eAAT,GAA2B,CACnC;AACD,GAFD,EAEG,EAFH;AAIA,SAAOH,UAAP;AACD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport React, {useEffect, useState} from 'react';\n\nexport function Component() {\n const [count, setCount] = useState(0);\n const isDarkMode = useIsDarkMode();\n\n useEffect(() => {\n // ...\n }, []);\n\n const handleClick = () => setCount(count + 1);\n\n return (\n <>\n
Dark mode? {isDarkMode}
\n
Count: {count}
\n \n >\n );\n}\n\nfunction useIsDarkMode() {\n const [isDarkMode] = useState(false);\n\n useEffect(function useEffectCreate() {\n // Here is where we may listen to a \"theme\" event...\n }, []);\n\n return isDarkMode;\n}\n"]}}]}
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithExternalCustomHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithExternalCustomHooks.js
new file mode 100644
index 0000000000000..05aedb938b715
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithExternalCustomHooks.js
@@ -0,0 +1,26 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Component = Component;
+
+var _react = _interopRequireDefault(require("react"));
+
+var _useTheme = _interopRequireDefault(require("./useTheme"));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * 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
+ */
+function Component() {
+ const theme = (0, _useTheme.default)();
+ return /*#__PURE__*/_react.default.createElement("div", null, "theme: ", theme);
+}
+//# sourceMappingURL=ComponentWithExternalCustomHooks.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithExternalCustomHooks.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithExternalCustomHooks.js.map
new file mode 100644
index 0000000000000..b4dbf9e15ec16
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithExternalCustomHooks.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["ComponentWithExternalCustomHooks.js"],"names":["Component","theme"],"mappings":";;;;;;;AASA;;AACA;;;;AAVA;;;;;;;;AAYO,SAASA,SAAT,GAAqB;AAC1B,QAAMC,KAAK,GAAG,wBAAd;AAEA,sBAAO,qDAAaA,KAAb,CAAP;AACD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport React from 'react';\nimport useTheme from './useTheme';\n\nexport function Component() {\n const theme = useTheme();\n\n return
theme: {theme}
;\n}\n"]}}]}
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithMultipleHooksPerLine.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithMultipleHooksPerLine.js
new file mode 100644
index 0000000000000..c657f3eb54551
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithMultipleHooksPerLine.js
@@ -0,0 +1,30 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Component = Component;
+
+var _react = require("react");
+
+/**
+ * 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
+ */
+const A = /*#__PURE__*/(0, _react.createContext)(1);
+const B = /*#__PURE__*/(0, _react.createContext)(2);
+
+function Component() {
+ const a = (0, _react.useContext)(A);
+ const b = (0, _react.useContext)(B); // prettier-ignore
+
+ const c = (0, _react.useContext)(A),
+ d = (0, _react.useContext)(B); // eslint-disable-line one-var
+
+ return a + b + c + d;
+}
+//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithMultipleHooksPerLine.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithMultipleHooksPerLine.js.map
new file mode 100644
index 0000000000000..31ecd2d51adb3
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithMultipleHooksPerLine.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["ComponentWithMultipleHooksPerLine.js"],"names":["A","B","Component","a","b","c","d"],"mappings":";;;;;;;AASA;;AATA;;;;;;;;AAWA,MAAMA,CAAC,gBAAG,0BAAc,CAAd,CAAV;AACA,MAAMC,CAAC,gBAAG,0BAAc,CAAd,CAAV;;AAEO,SAASC,SAAT,GAAqB;AAC1B,QAAMC,CAAC,GAAG,uBAAWH,CAAX,CAAV;AACA,QAAMI,CAAC,GAAG,uBAAWH,CAAX,CAAV,CAF0B,CAI1B;;AACA,QAAMI,CAAC,GAAG,uBAAWL,CAAX,CAAV;AAAA,QAAyBM,CAAC,GAAG,uBAAWL,CAAX,CAA7B,CAL0B,CAKkB;;AAE5C,SAAOE,CAAC,GAAGC,CAAJ,GAAQC,CAAR,GAAYC,CAAnB;AACD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport {createContext, useContext} from 'react';\n\nconst A = createContext(1);\nconst B = createContext(2);\n\nexport function Component() {\n const a = useContext(A);\n const b = useContext(B);\n\n // prettier-ignore\n const c = useContext(A), d = useContext(B); // eslint-disable-line one-var\n\n return a + b + c + d;\n}\n"]}}]}
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithNestedHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithNestedHooks.js
new file mode 100644
index 0000000000000..3cfed69078a8c
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithNestedHooks.js
@@ -0,0 +1,28 @@
+"use strict";
+
+/**
+ * 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
+ */
+const {
+ useMemo,
+ useState
+} = require('react');
+
+function Component(props) {
+ const InnerComponent = useMemo(() => () => {
+ const [state] = useState(0);
+ return state;
+ });
+ props.callback(InnerComponent);
+ return null;
+}
+
+module.exports = {
+ Component
+};
+//# sourceMappingURL=ComponentWithNestedHooks.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithNestedHooks.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithNestedHooks.js.map
new file mode 100644
index 0000000000000..d73452228759f
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ComponentWithNestedHooks.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["ComponentWithNestedHooks.js"],"names":["useMemo","useState","require","Component","props","InnerComponent","state","callback","module","exports"],"mappings":";;AAAA;;;;;;;;AAQA,MAAM;AAACA,EAAAA,OAAD;AAAUC,EAAAA;AAAV,IAAsBC,OAAO,CAAC,OAAD,CAAnC;;AAEA,SAASC,SAAT,CAAmBC,KAAnB,EAA0B;AACxB,QAAMC,cAAc,GAAGL,OAAO,CAAC,MAAM,MAAM;AACzC,UAAM,CAACM,KAAD,IAAUL,QAAQ,CAAC,CAAD,CAAxB;AAEA,WAAOK,KAAP;AACD,GAJ6B,CAA9B;AAKAF,EAAAA,KAAK,CAACG,QAAN,CAAeF,cAAf;AAEA,SAAO,IAAP;AACD;;AAEDG,MAAM,CAACC,OAAP,GAAiB;AAACN,EAAAA;AAAD,CAAjB","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\nconst {useMemo, useState} = require('react');\n\nfunction Component(props) {\n const InnerComponent = useMemo(() => () => {\n const [state] = useState(0);\n\n return state;\n });\n props.callback(InnerComponent);\n\n return null;\n}\n\nmodule.exports = {Component};\n"]}}]}
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ContainingStringSourceMappingURL.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ContainingStringSourceMappingURL.js
new file mode 100644
index 0000000000000..0fc2c078ca125
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ContainingStringSourceMappingURL.js
@@ -0,0 +1,29 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Component = Component;
+
+var _react = _interopRequireWildcard(require("react"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/**
+ * 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
+ */
+// ?sourceMappingURL=([^\s'"]+)/gm
+function Component() {
+ const [count, setCount] = (0, _react.useState)(0);
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", null, "You clicked ", count, " times"), /*#__PURE__*/_react.default.createElement("button", {
+ onClick: () => setCount(count + 1)
+ }, "Click me"));
+}
+//# sourceMappingURL=ContainingStringSourceMappingURL.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ContainingStringSourceMappingURL.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ContainingStringSourceMappingURL.js.map
new file mode 100644
index 0000000000000..7b95325ab1794
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ContainingStringSourceMappingURL.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["ContainingStringSourceMappingURL.js"],"names":["Component","count","setCount"],"mappings":";;;;;;;AASA;;;;;;AATA;;;;;;;;AAWA;AAEO,SAASA,SAAT,GAAqB;AAC1B,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoB,qBAAS,CAAT,CAA1B;AAEA,sBACE,uDACE,wDAAgBD,KAAhB,WADF,eAEE;AAAQ,IAAA,OAAO,EAAE,MAAMC,QAAQ,CAACD,KAAK,GAAG,CAAT;AAA/B,gBAFF,CADF;AAMD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport React, {useState} from 'react';\n\n// ?sourceMappingURL=([^\\s'\"]+)/gm\n\nexport function Component() {\n const [count, setCount] = useState(0);\n\n return (\n
\n
You clicked {count} times
\n \n
\n );\n}\n"]}}]}
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/Example.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/Example.js
new file mode 100644
index 0000000000000..19134738824bc
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/Example.js
@@ -0,0 +1,28 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Component = Component;
+
+var _react = _interopRequireWildcard(require("react"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/**
+ * 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
+ */
+function Component() {
+ const [count, setCount] = (0, _react.useState)(0);
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", null, "You clicked ", count, " times"), /*#__PURE__*/_react.default.createElement("button", {
+ onClick: () => setCount(count + 1)
+ }, "Click me"));
+}
+//# sourceMappingURL=Example.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/Example.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/Example.js.map
new file mode 100644
index 0000000000000..16875ee93d815
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/Example.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["Example.js"],"names":["Component","count","setCount"],"mappings":";;;;;;;AASA;;;;;;AATA;;;;;;;;AAWO,SAASA,SAAT,GAAqB;AAC1B,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoB,qBAAS,CAAT,CAA1B;AAEA,sBACE,uDACE,wDAAgBD,KAAhB,WADF,eAEE;AAAQ,IAAA,OAAO,EAAE,MAAMC,QAAQ,CAACD,KAAK,GAAG,CAAT;AAA/B,gBAFF,CADF;AAMD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport React, {useState} from 'react';\n\nexport function Component() {\n const [count, setCount] = useState(0);\n\n return (\n
\n
You clicked {count} times
\n \n
\n );\n}\n"]}}]}
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/InlineRequire.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/InlineRequire.js
new file mode 100644
index 0000000000000..388aeda62b308
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/InlineRequire.js
@@ -0,0 +1,21 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Component = Component;
+
+/**
+ * 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
+ */
+function Component() {
+ const [count] = require('react').useState(0);
+
+ return count;
+}
+//# sourceMappingURL=InlineRequire.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/InlineRequire.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/InlineRequire.js.map
new file mode 100644
index 0000000000000..fb426f5709cf8
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/InlineRequire.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["InlineRequire.js"],"names":["Component","count","require","useState"],"mappings":";;;;;;;AAAA;;;;;;;;AASO,SAASA,SAAT,GAAqB;AAC1B,QAAM,CAACC,KAAD,IAAUC,OAAO,CAAC,OAAD,CAAP,CAAiBC,QAAjB,CAA0B,CAA1B,CAAhB;;AAEA,SAAOF,KAAP;AACD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nexport function Component() {\n const [count] = require('react').useState(0);\n\n return count;\n}\n"]}}]}
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ToDoList.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ToDoList.js
new file mode 100644
index 0000000000000..a6eb863b661ff
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ToDoList.js
@@ -0,0 +1,106 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ListItem = ListItem;
+exports.List = List;
+
+var React = _interopRequireWildcard(require("react"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/**
+ * 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
+ */
+function ListItem({
+ item,
+ removeItem,
+ toggleItem
+}) {
+ const handleDelete = (0, React.useCallback)(() => {
+ removeItem(item);
+ }, [item, removeItem]);
+ const handleToggle = (0, React.useCallback)(() => {
+ toggleItem(item);
+ }, [item, toggleItem]);
+ return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("button", {
+ onClick: handleDelete
+ }, "Delete"), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
+ checked: item.isComplete,
+ onChange: handleToggle,
+ type: "checkbox"
+ }), ' ', item.text));
+}
+
+function List(props) {
+ const [newItemText, setNewItemText] = (0, React.useState)('');
+ const [items, setItems] = (0, React.useState)([{
+ id: 1,
+ isComplete: true,
+ text: 'First'
+ }, {
+ id: 2,
+ isComplete: true,
+ text: 'Second'
+ }, {
+ id: 3,
+ isComplete: false,
+ text: 'Third'
+ }]);
+ const [uid, setUID] = (0, React.useState)(4);
+ const handleClick = (0, React.useCallback)(() => {
+ if (newItemText !== '') {
+ setItems([...items, {
+ id: uid,
+ isComplete: false,
+ text: newItemText
+ }]);
+ setUID(uid + 1);
+ setNewItemText('');
+ }
+ }, [newItemText, items, uid]);
+ const handleKeyPress = (0, React.useCallback)(event => {
+ if (event.key === 'Enter') {
+ handleClick();
+ }
+ }, [handleClick]);
+ const handleChange = (0, React.useCallback)(event => {
+ setNewItemText(event.currentTarget.value);
+ }, [setNewItemText]);
+ const removeItem = (0, React.useCallback)(itemToRemove => setItems(items.filter(item => item !== itemToRemove)), [items]);
+ const toggleItem = (0, React.useCallback)(itemToToggle => {
+ // Dont use indexOf()
+ // because editing props in DevTools creates a new Object.
+ const index = items.findIndex(item => item.id === itemToToggle.id);
+ setItems(items.slice(0, index).concat({ ...itemToToggle,
+ isComplete: !itemToToggle.isComplete
+ }).concat(items.slice(index + 1)));
+ }, [items]);
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h1", null, "List"), /*#__PURE__*/React.createElement("input", {
+ type: "text",
+ placeholder: "New list item...",
+ value: newItemText,
+ onChange: handleChange,
+ onKeyPress: handleKeyPress
+ }), /*#__PURE__*/React.createElement("button", {
+ disabled: newItemText === '',
+ onClick: handleClick
+ }, /*#__PURE__*/React.createElement("span", {
+ role: "img",
+ "aria-label": "Add item"
+ }, "Add")), /*#__PURE__*/React.createElement("ul", null, items.map(item => /*#__PURE__*/React.createElement(ListItem, {
+ key: item.id,
+ item: item,
+ removeItem: removeItem,
+ toggleItem: toggleItem
+ }))));
+}
+//# sourceMappingURL=ToDoList.js.map
\ No newline at end of file
diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ToDoList.js.map b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ToDoList.js.map
new file mode 100644
index 0000000000000..af4b94acaccb1
--- /dev/null
+++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/ToDoList.js.map
@@ -0,0 +1 @@
+{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":3,"sources":["ToDoList.js"],"names":["ListItem","item","removeItem","toggleItem","handleDelete","handleToggle","isComplete","text","List","props","newItemText","setNewItemText","items","setItems","id","uid","setUID","handleClick","handleKeyPress","event","key","handleChange","currentTarget","value","itemToRemove","filter","itemToToggle","index","findIndex","slice","concat","map"],"mappings":";;;;;;;;AASA;;;;;;AATA;;;;;;;;AAYO,SAASA,QAAT,CAAkB;AAACC,EAAAA,IAAD;AAAOC,EAAAA,UAAP;AAAmBC,EAAAA;AAAnB,CAAlB,EAAkD;AACvD,QAAMC,YAAY,GAAG,uBAAY,MAAM;AACrCF,IAAAA,UAAU,CAACD,IAAD,CAAV;AACD,GAFoB,EAElB,CAACA,IAAD,EAAOC,UAAP,CAFkB,CAArB;AAIA,QAAMG,YAAY,GAAG,uBAAY,MAAM;AACrCF,IAAAA,UAAU,CAACF,IAAD,CAAV;AACD,GAFoB,EAElB,CAACA,IAAD,EAAOE,UAAP,CAFkB,CAArB;AAIA,sBACE,6CACE;AAAQ,IAAA,OAAO,EAAEC;AAAjB,cADF,eAEE,gDACE;AACE,IAAA,OAAO,EAAEH,IAAI,CAACK,UADhB;AAEE,IAAA,QAAQ,EAAED,YAFZ;AAGE,IAAA,IAAI,EAAC;AAHP,IADF,EAKK,GALL,EAMGJ,IAAI,CAACM,IANR,CAFF,CADF;AAaD;;AAEM,SAASC,IAAT,CAAcC,KA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d,IADD,CADH,CAdF,CADF;AA2BD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport * as React from 'react';\nimport {Fragment, useCallback, useState} from 'react';\n\nexport function ListItem({item, removeItem, toggleItem}) {\n const handleDelete = useCallback(() => {\n removeItem(item);\n }, [item, removeItem]);\n\n const handleToggle = useCallback(() => {\n toggleItem(item);\n }, [item, toggleItem]);\n\n return (\n