From 98c49b0fe80e361110b45822c5d1ad136c76b33d Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Fri, 20 Aug 2021 17:48:19 -0400 Subject: [PATCH] [DevTools] Keep query params in extracted source map urls --- .../external/ComponentUsingHooksIndirectly.js | 2 +- .../external/ComponentWithCustomHook.js | 2 +- .../ComponentWithExternalCustomHooks.js | 2 +- .../ComponentWithMultipleHooksPerLine.js | 2 +- .../external/ComponentWithNestedHooks.js | 2 +- .../ContainingStringSourceMappingURL.js | 2 +- .../__compiled__/external/Example.js | 2 +- .../__compiled__/external/InlineRequire.js | 2 +- .../__compiled__/external/ToDoList.js | 2 +- .../ComponentUsingHooksIndirectly.js | 2 +- .../ComponentWithCustomHook.js | 2 +- .../ComponentWithExternalCustomHooks.js | 2 +- .../ComponentWithMultipleHooksPerLine.js | 2 +- .../ComponentWithNestedHooks.js | 2 +- .../ContainingStringSourceMappingURL.js | 2 +- .../external/fb-sources-extended/Example.js | 2 +- .../fb-sources-extended/InlineRequire.js | 2 +- .../external/fb-sources-extended/ToDoList.js | 2 +- .../ComponentUsingHooksIndirectly.js | 2 +- .../index-map/ComponentWithCustomHook.js | 2 +- .../ComponentWithExternalCustomHooks.js | 2 +- .../ComponentWithMultipleHooksPerLine.js | 2 +- .../index-map/ComponentWithNestedHooks.js | 2 +- .../ContainingStringSourceMappingURL.js | 2 +- .../fb-sources-extended/index-map/Example.js | 2 +- .../index-map/InlineRequire.js | 2 +- .../fb-sources-extended/index-map/ToDoList.js | 2 +- .../fb-sources-extended/index-map/index.js | 2 +- .../fb-sources-extended/index-map/useTheme.js | 2 +- .../external/fb-sources-extended/index.js | 2 +- .../external/fb-sources-extended/useTheme.js | 2 +- .../ComponentUsingHooksIndirectly.js | 2 +- .../index-map/ComponentWithCustomHook.js | 2 +- .../ComponentWithExternalCustomHooks.js | 2 +- .../ComponentWithMultipleHooksPerLine.js | 2 +- .../index-map/ComponentWithNestedHooks.js | 2 +- .../ContainingStringSourceMappingURL.js | 2 +- .../external/index-map/Example.js | 2 +- .../external/index-map/InlineRequire.js | 2 +- .../external/index-map/ToDoList.js | 2 +- .../__compiled__/external/index-map/index.js | 2 +- .../external/index-map/useTheme.js | 2 +- .../__source__/__compiled__/external/index.js | 2 +- .../ComponentUsingHooksIndirectly.js | 2 +- .../ComponentWithCustomHook.js | 2 +- .../ComponentWithExternalCustomHooks.js | 2 +- .../ComponentWithMultipleHooksPerLine.js | 2 +- .../ComponentWithNestedHooks.js | 2 +- .../ContainingStringSourceMappingURL.js | 2 +- .../react-sources-extended/Example.js | 2 +- .../react-sources-extended/InlineRequire.js | 2 +- .../react-sources-extended/ToDoList.js | 2 +- .../ComponentUsingHooksIndirectly.js | 2 +- .../index-map/ComponentWithCustomHook.js | 2 +- .../ComponentWithExternalCustomHooks.js | 2 +- .../ComponentWithMultipleHooksPerLine.js | 2 +- .../index-map/ComponentWithNestedHooks.js | 2 +- .../ContainingStringSourceMappingURL.js | 2 +- .../index-map/Example.js | 2 +- .../index-map/InlineRequire.js | 2 +- .../index-map/ToDoList.js | 2 +- .../react-sources-extended/index-map/index.js | 2 +- .../index-map/useTheme.js | 2 +- .../external/react-sources-extended/index.js | 2 +- .../react-sources-extended/useTheme.js | 2 +- .../__compiled__/external/useTheme.js | 2 +- .../src/__tests__/parseHookNames-test.js | 10 +++++- .../src/__tests__/updateMockSourceMaps.js | 18 ++++++---- .../src/parseHookNames/parseHookNames.js | 33 ++++++++++++------- 69 files changed, 109 insertions(+), 84 deletions(-) diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentUsingHooksIndirectly.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentUsingHooksIndirectly.js index 6925712d17c7c..fd8c1cdadf353 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentUsingHooksIndirectly.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentUsingHooksIndirectly.js @@ -42,4 +42,4 @@ function useIsDarkMode() { }, []); return [isDarkMode, () => {}]; } -//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map \ No newline at end of file +//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithCustomHook.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithCustomHook.js index a5f54607fdd37..e9441c46a4016 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithCustomHook.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithCustomHook.js @@ -48,4 +48,4 @@ function useFoo() { foo: true }; } -//# sourceMappingURL=ComponentWithCustomHook.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithCustomHook.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithExternalCustomHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithExternalCustomHooks.js index 05aedb938b715..2a3f24cad9105 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithExternalCustomHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithExternalCustomHooks.js @@ -23,4 +23,4 @@ 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 +//# sourceMappingURL=ComponentWithExternalCustomHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithMultipleHooksPerLine.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithMultipleHooksPerLine.js index c657f3eb54551..e569ffa7d8501 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithMultipleHooksPerLine.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithMultipleHooksPerLine.js @@ -27,4 +27,4 @@ function Component() { return a + b + c + d; } -//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithNestedHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithNestedHooks.js index 3cfed69078a8c..ec85bcad867e3 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithNestedHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ComponentWithNestedHooks.js @@ -25,4 +25,4 @@ function Component(props) { module.exports = { Component }; -//# sourceMappingURL=ComponentWithNestedHooks.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithNestedHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ContainingStringSourceMappingURL.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ContainingStringSourceMappingURL.js index 0fc2c078ca125..ffa5f98aeaf9f 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ContainingStringSourceMappingURL.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ContainingStringSourceMappingURL.js @@ -26,4 +26,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=ContainingStringSourceMappingURL.js.map \ No newline at end of file +//# sourceMappingURL=ContainingStringSourceMappingURL.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/Example.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/Example.js index 19134738824bc..2ab9daad9b7b8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/Example.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/Example.js @@ -25,4 +25,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=Example.js.map \ No newline at end of file +//# sourceMappingURL=Example.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/InlineRequire.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/InlineRequire.js index 388aeda62b308..b9b234f86bdb8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/InlineRequire.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/InlineRequire.js @@ -18,4 +18,4 @@ function Component() { return count; } -//# sourceMappingURL=InlineRequire.js.map \ No newline at end of file +//# sourceMappingURL=InlineRequire.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ToDoList.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ToDoList.js index a6eb863b661ff..d506efef47697 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ToDoList.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/ToDoList.js @@ -103,4 +103,4 @@ function List(props) { toggleItem: toggleItem })))); } -//# sourceMappingURL=ToDoList.js.map \ No newline at end of file +//# sourceMappingURL=ToDoList.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentUsingHooksIndirectly.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentUsingHooksIndirectly.js index 6925712d17c7c..fd8c1cdadf353 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentUsingHooksIndirectly.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentUsingHooksIndirectly.js @@ -42,4 +42,4 @@ function useIsDarkMode() { }, []); return [isDarkMode, () => {}]; } -//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map \ No newline at end of file +//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithCustomHook.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithCustomHook.js index a5f54607fdd37..e9441c46a4016 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithCustomHook.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithCustomHook.js @@ -48,4 +48,4 @@ function useFoo() { foo: true }; } -//# sourceMappingURL=ComponentWithCustomHook.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithCustomHook.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithExternalCustomHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithExternalCustomHooks.js index 05aedb938b715..2a3f24cad9105 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithExternalCustomHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithExternalCustomHooks.js @@ -23,4 +23,4 @@ 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 +//# sourceMappingURL=ComponentWithExternalCustomHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithMultipleHooksPerLine.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithMultipleHooksPerLine.js index c657f3eb54551..e569ffa7d8501 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithMultipleHooksPerLine.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithMultipleHooksPerLine.js @@ -27,4 +27,4 @@ function Component() { return a + b + c + d; } -//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithNestedHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithNestedHooks.js index 3cfed69078a8c..ec85bcad867e3 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithNestedHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ComponentWithNestedHooks.js @@ -25,4 +25,4 @@ function Component(props) { module.exports = { Component }; -//# sourceMappingURL=ComponentWithNestedHooks.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithNestedHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ContainingStringSourceMappingURL.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ContainingStringSourceMappingURL.js index 0fc2c078ca125..ffa5f98aeaf9f 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ContainingStringSourceMappingURL.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ContainingStringSourceMappingURL.js @@ -26,4 +26,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=ContainingStringSourceMappingURL.js.map \ No newline at end of file +//# sourceMappingURL=ContainingStringSourceMappingURL.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/Example.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/Example.js index 19134738824bc..2ab9daad9b7b8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/Example.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/Example.js @@ -25,4 +25,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=Example.js.map \ No newline at end of file +//# sourceMappingURL=Example.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/InlineRequire.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/InlineRequire.js index 388aeda62b308..b9b234f86bdb8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/InlineRequire.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/InlineRequire.js @@ -18,4 +18,4 @@ function Component() { return count; } -//# sourceMappingURL=InlineRequire.js.map \ No newline at end of file +//# sourceMappingURL=InlineRequire.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ToDoList.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ToDoList.js index a6eb863b661ff..d506efef47697 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ToDoList.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/ToDoList.js @@ -103,4 +103,4 @@ function List(props) { toggleItem: toggleItem })))); } -//# sourceMappingURL=ToDoList.js.map \ No newline at end of file +//# sourceMappingURL=ToDoList.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentUsingHooksIndirectly.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentUsingHooksIndirectly.js index 6925712d17c7c..fd8c1cdadf353 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentUsingHooksIndirectly.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentUsingHooksIndirectly.js @@ -42,4 +42,4 @@ function useIsDarkMode() { }, []); return [isDarkMode, () => {}]; } -//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map \ No newline at end of file +//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithCustomHook.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithCustomHook.js index a5f54607fdd37..e9441c46a4016 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithCustomHook.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithCustomHook.js @@ -48,4 +48,4 @@ function useFoo() { foo: true }; } -//# sourceMappingURL=ComponentWithCustomHook.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithCustomHook.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithExternalCustomHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithExternalCustomHooks.js index 05aedb938b715..2a3f24cad9105 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithExternalCustomHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithExternalCustomHooks.js @@ -23,4 +23,4 @@ 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 +//# sourceMappingURL=ComponentWithExternalCustomHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithMultipleHooksPerLine.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithMultipleHooksPerLine.js index c657f3eb54551..e569ffa7d8501 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithMultipleHooksPerLine.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithMultipleHooksPerLine.js @@ -27,4 +27,4 @@ function Component() { return a + b + c + d; } -//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithNestedHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithNestedHooks.js index 3cfed69078a8c..ec85bcad867e3 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithNestedHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ComponentWithNestedHooks.js @@ -25,4 +25,4 @@ function Component(props) { module.exports = { Component }; -//# sourceMappingURL=ComponentWithNestedHooks.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithNestedHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ContainingStringSourceMappingURL.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ContainingStringSourceMappingURL.js index 0fc2c078ca125..ffa5f98aeaf9f 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ContainingStringSourceMappingURL.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ContainingStringSourceMappingURL.js @@ -26,4 +26,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=ContainingStringSourceMappingURL.js.map \ No newline at end of file +//# sourceMappingURL=ContainingStringSourceMappingURL.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/Example.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/Example.js index 19134738824bc..2ab9daad9b7b8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/Example.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/Example.js @@ -25,4 +25,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=Example.js.map \ No newline at end of file +//# sourceMappingURL=Example.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/InlineRequire.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/InlineRequire.js index 388aeda62b308..b9b234f86bdb8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/InlineRequire.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/InlineRequire.js @@ -18,4 +18,4 @@ function Component() { return count; } -//# sourceMappingURL=InlineRequire.js.map \ No newline at end of file +//# sourceMappingURL=InlineRequire.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ToDoList.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ToDoList.js index a6eb863b661ff..d506efef47697 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ToDoList.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/ToDoList.js @@ -103,4 +103,4 @@ function List(props) { toggleItem: toggleItem })))); } -//# sourceMappingURL=ToDoList.js.map \ No newline at end of file +//# sourceMappingURL=ToDoList.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/index.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/index.js index a0f706b19fbaf..d2e5621699875 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/index.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/index.js @@ -86,4 +86,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 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; } -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/useTheme.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/useTheme.js index 95bb454253ec3..5cabcdde5f6dd 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/useTheme.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index-map/useTheme.js @@ -24,4 +24,4 @@ function useTheme() { (0, _react.useDebugValue)(theme); return theme; } -//# sourceMappingURL=useTheme.js.map \ No newline at end of file +//# sourceMappingURL=useTheme.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index.js index a0f706b19fbaf..d2e5621699875 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/index.js @@ -86,4 +86,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 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; } -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/useTheme.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/useTheme.js index 95bb454253ec3..5cabcdde5f6dd 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/useTheme.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/fb-sources-extended/useTheme.js @@ -24,4 +24,4 @@ function useTheme() { (0, _react.useDebugValue)(theme); return theme; } -//# sourceMappingURL=useTheme.js.map \ No newline at end of file +//# sourceMappingURL=useTheme.js.map?foo=bar¶m=some_value \ No newline at end of file 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 index 6925712d17c7c..fd8c1cdadf353 100644 --- 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 @@ -42,4 +42,4 @@ function useIsDarkMode() { }, []); return [isDarkMode, () => {}]; } -//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map \ No newline at end of file +//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map?foo=bar¶m=some_value \ 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 index a5f54607fdd37..e9441c46a4016 100644 --- 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 @@ -48,4 +48,4 @@ function useFoo() { foo: true }; } -//# sourceMappingURL=ComponentWithCustomHook.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithCustomHook.js.map?foo=bar¶m=some_value \ 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 index 05aedb938b715..2a3f24cad9105 100644 --- 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 @@ -23,4 +23,4 @@ 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 +//# sourceMappingURL=ComponentWithExternalCustomHooks.js.map?foo=bar¶m=some_value \ 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 index c657f3eb54551..e569ffa7d8501 100644 --- 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 @@ -27,4 +27,4 @@ function Component() { return a + b + c + d; } -//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map?foo=bar¶m=some_value \ 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 index 3cfed69078a8c..ec85bcad867e3 100644 --- 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 @@ -25,4 +25,4 @@ function Component(props) { module.exports = { Component }; -//# sourceMappingURL=ComponentWithNestedHooks.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithNestedHooks.js.map?foo=bar¶m=some_value \ 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 index 0fc2c078ca125..ffa5f98aeaf9f 100644 --- 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 @@ -26,4 +26,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=ContainingStringSourceMappingURL.js.map \ No newline at end of file +//# sourceMappingURL=ContainingStringSourceMappingURL.js.map?foo=bar¶m=some_value \ 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 index 19134738824bc..2ab9daad9b7b8 100644 --- 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 @@ -25,4 +25,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=Example.js.map \ No newline at end of file +//# sourceMappingURL=Example.js.map?foo=bar¶m=some_value \ 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 index 388aeda62b308..b9b234f86bdb8 100644 --- 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 @@ -18,4 +18,4 @@ function Component() { return count; } -//# sourceMappingURL=InlineRequire.js.map \ No newline at end of file +//# sourceMappingURL=InlineRequire.js.map?foo=bar¶m=some_value \ 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 index a6eb863b661ff..d506efef47697 100644 --- 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 @@ -103,4 +103,4 @@ function List(props) { toggleItem: toggleItem })))); } -//# sourceMappingURL=ToDoList.js.map \ No newline at end of file +//# sourceMappingURL=ToDoList.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/index.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/index.js index a0f706b19fbaf..d2e5621699875 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/index.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/index.js @@ -86,4 +86,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 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; } -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/useTheme.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/useTheme.js index 95bb454253ec3..5cabcdde5f6dd 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/useTheme.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index-map/useTheme.js @@ -24,4 +24,4 @@ function useTheme() { (0, _react.useDebugValue)(theme); return theme; } -//# sourceMappingURL=useTheme.js.map \ No newline at end of file +//# sourceMappingURL=useTheme.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index.js index a0f706b19fbaf..d2e5621699875 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/index.js @@ -86,4 +86,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 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; } -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentUsingHooksIndirectly.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentUsingHooksIndirectly.js index 6925712d17c7c..fd8c1cdadf353 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentUsingHooksIndirectly.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentUsingHooksIndirectly.js @@ -42,4 +42,4 @@ function useIsDarkMode() { }, []); return [isDarkMode, () => {}]; } -//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map \ No newline at end of file +//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithCustomHook.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithCustomHook.js index a5f54607fdd37..e9441c46a4016 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithCustomHook.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithCustomHook.js @@ -48,4 +48,4 @@ function useFoo() { foo: true }; } -//# sourceMappingURL=ComponentWithCustomHook.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithCustomHook.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithExternalCustomHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithExternalCustomHooks.js index 05aedb938b715..2a3f24cad9105 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithExternalCustomHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithExternalCustomHooks.js @@ -23,4 +23,4 @@ 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 +//# sourceMappingURL=ComponentWithExternalCustomHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithMultipleHooksPerLine.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithMultipleHooksPerLine.js index c657f3eb54551..e569ffa7d8501 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithMultipleHooksPerLine.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithMultipleHooksPerLine.js @@ -27,4 +27,4 @@ function Component() { return a + b + c + d; } -//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithNestedHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithNestedHooks.js index 3cfed69078a8c..ec85bcad867e3 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithNestedHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ComponentWithNestedHooks.js @@ -25,4 +25,4 @@ function Component(props) { module.exports = { Component }; -//# sourceMappingURL=ComponentWithNestedHooks.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithNestedHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ContainingStringSourceMappingURL.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ContainingStringSourceMappingURL.js index 0fc2c078ca125..ffa5f98aeaf9f 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ContainingStringSourceMappingURL.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ContainingStringSourceMappingURL.js @@ -26,4 +26,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=ContainingStringSourceMappingURL.js.map \ No newline at end of file +//# sourceMappingURL=ContainingStringSourceMappingURL.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/Example.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/Example.js index 19134738824bc..2ab9daad9b7b8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/Example.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/Example.js @@ -25,4 +25,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=Example.js.map \ No newline at end of file +//# sourceMappingURL=Example.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/InlineRequire.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/InlineRequire.js index 388aeda62b308..b9b234f86bdb8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/InlineRequire.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/InlineRequire.js @@ -18,4 +18,4 @@ function Component() { return count; } -//# sourceMappingURL=InlineRequire.js.map \ No newline at end of file +//# sourceMappingURL=InlineRequire.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ToDoList.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ToDoList.js index a6eb863b661ff..d506efef47697 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ToDoList.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/ToDoList.js @@ -103,4 +103,4 @@ function List(props) { toggleItem: toggleItem })))); } -//# sourceMappingURL=ToDoList.js.map \ No newline at end of file +//# sourceMappingURL=ToDoList.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentUsingHooksIndirectly.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentUsingHooksIndirectly.js index 6925712d17c7c..fd8c1cdadf353 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentUsingHooksIndirectly.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentUsingHooksIndirectly.js @@ -42,4 +42,4 @@ function useIsDarkMode() { }, []); return [isDarkMode, () => {}]; } -//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map \ No newline at end of file +//# sourceMappingURL=ComponentUsingHooksIndirectly.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithCustomHook.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithCustomHook.js index a5f54607fdd37..e9441c46a4016 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithCustomHook.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithCustomHook.js @@ -48,4 +48,4 @@ function useFoo() { foo: true }; } -//# sourceMappingURL=ComponentWithCustomHook.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithCustomHook.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithExternalCustomHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithExternalCustomHooks.js index 05aedb938b715..2a3f24cad9105 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithExternalCustomHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithExternalCustomHooks.js @@ -23,4 +23,4 @@ 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 +//# sourceMappingURL=ComponentWithExternalCustomHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithMultipleHooksPerLine.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithMultipleHooksPerLine.js index c657f3eb54551..e569ffa7d8501 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithMultipleHooksPerLine.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithMultipleHooksPerLine.js @@ -27,4 +27,4 @@ function Component() { return a + b + c + d; } -//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithMultipleHooksPerLine.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithNestedHooks.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithNestedHooks.js index 3cfed69078a8c..ec85bcad867e3 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithNestedHooks.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ComponentWithNestedHooks.js @@ -25,4 +25,4 @@ function Component(props) { module.exports = { Component }; -//# sourceMappingURL=ComponentWithNestedHooks.js.map \ No newline at end of file +//# sourceMappingURL=ComponentWithNestedHooks.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ContainingStringSourceMappingURL.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ContainingStringSourceMappingURL.js index 0fc2c078ca125..ffa5f98aeaf9f 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ContainingStringSourceMappingURL.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ContainingStringSourceMappingURL.js @@ -26,4 +26,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=ContainingStringSourceMappingURL.js.map \ No newline at end of file +//# sourceMappingURL=ContainingStringSourceMappingURL.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/Example.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/Example.js index 19134738824bc..2ab9daad9b7b8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/Example.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/Example.js @@ -25,4 +25,4 @@ function Component() { onClick: () => setCount(count + 1) }, "Click me")); } -//# sourceMappingURL=Example.js.map \ No newline at end of file +//# sourceMappingURL=Example.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/InlineRequire.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/InlineRequire.js index 388aeda62b308..b9b234f86bdb8 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/InlineRequire.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/InlineRequire.js @@ -18,4 +18,4 @@ function Component() { return count; } -//# sourceMappingURL=InlineRequire.js.map \ No newline at end of file +//# sourceMappingURL=InlineRequire.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ToDoList.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ToDoList.js index a6eb863b661ff..d506efef47697 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ToDoList.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/ToDoList.js @@ -103,4 +103,4 @@ function List(props) { toggleItem: toggleItem })))); } -//# sourceMappingURL=ToDoList.js.map \ No newline at end of file +//# sourceMappingURL=ToDoList.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/index.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/index.js index a0f706b19fbaf..d2e5621699875 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/index.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/index.js @@ -86,4 +86,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 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; } -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/useTheme.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/useTheme.js index 95bb454253ec3..5cabcdde5f6dd 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/useTheme.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index-map/useTheme.js @@ -24,4 +24,4 @@ function useTheme() { (0, _react.useDebugValue)(theme); return theme; } -//# sourceMappingURL=useTheme.js.map \ No newline at end of file +//# sourceMappingURL=useTheme.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index.js index a0f706b19fbaf..d2e5621699875 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/index.js @@ -86,4 +86,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 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; } -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/useTheme.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/useTheme.js index 95bb454253ec3..5cabcdde5f6dd 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/useTheme.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/react-sources-extended/useTheme.js @@ -24,4 +24,4 @@ function useTheme() { (0, _react.useDebugValue)(theme); return theme; } -//# sourceMappingURL=useTheme.js.map \ No newline at end of file +//# sourceMappingURL=useTheme.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/useTheme.js b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/useTheme.js index 95bb454253ec3..5cabcdde5f6dd 100644 --- a/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/useTheme.js +++ b/packages/react-devtools-extensions/src/__tests__/__source__/__compiled__/external/useTheme.js @@ -24,4 +24,4 @@ function useTheme() { (0, _react.useDebugValue)(theme); return theme; } -//# sourceMappingURL=useTheme.js.map \ No newline at end of file +//# sourceMappingURL=useTheme.js.map?foo=bar¶m=some_value \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/__tests__/parseHookNames-test.js b/packages/react-devtools-extensions/src/__tests__/parseHookNames-test.js index a5fe6fb258029..dd500bbfb2eaa 100644 --- a/packages/react-devtools-extensions/src/__tests__/parseHookNames-test.js +++ b/packages/react-devtools-extensions/src/__tests__/parseHookNames-test.js @@ -57,7 +57,15 @@ describe('parseHookNames', () => { }; fetchMock.mockIf(/.+$/, request => { - return requireText(request.url, 'utf8'); + const url = request.url; + const isLoadingExternalSourceMap = /external\/.*\.map/.test(url); + if (isLoadingExternalSourceMap) { + // Assert that url contains correct query params + expect(url.includes('?foo=bar¶m=some_value')).toBe(true); + const fileSystemPath = url.split('?')[0]; + return requireText(fileSystemPath, 'utf8'); + } + return requireText(url, 'utf8'); }); }); diff --git a/packages/react-devtools-extensions/src/__tests__/updateMockSourceMaps.js b/packages/react-devtools-extensions/src/__tests__/updateMockSourceMaps.js index 7af2a949067cc..48ddcbe3907ac 100644 --- a/packages/react-devtools-extensions/src/__tests__/updateMockSourceMaps.js +++ b/packages/react-devtools-extensions/src/__tests__/updateMockSourceMaps.js @@ -97,7 +97,8 @@ function compile(fileName) { // Generate compiled output with external source maps writeFileSync( resolve(externalDir, fileName), - transformed.code + `\n//# sourceMappingURL=${fileName}.map`, + transformed.code + + `\n//# sourceMappingURL=${fileName}.map?foo=bar¶m=some_value`, 'utf8', ); writeFileSync( @@ -167,7 +168,8 @@ function compile(fileName) { // Generate compiled output using external source maps using index map format writeFileSync( resolve(externalIndexMapDir, fileName), - transformed.code + `\n//# sourceMappingURL=${fileName}.map`, + transformed.code + + `\n//# sourceMappingURL=${fileName}.map?foo=bar¶m=some_value`, 'utf8', ); writeFileSync( @@ -242,7 +244,8 @@ function compile(fileName) { ); writeFileSync( resolve(externalFbSourcesExtendedDir, fileName), - transformed.code + `\n//# sourceMappingURL=${fileName}.map`, + transformed.code + + `\n//# sourceMappingURL=${fileName}.map?foo=bar¶m=some_value`, 'utf8', ); writeFileSync( @@ -260,7 +263,8 @@ function compile(fileName) { ); writeFileSync( resolve(externalFbSourcesIndexMapExtendedDir, fileName), - transformed.code + `\n//# sourceMappingURL=${fileName}.map`, + transformed.code + + `\n//# sourceMappingURL=${fileName}.map?foo=bar¶m=some_value`, 'utf8', ); writeFileSync( @@ -279,7 +283,8 @@ function compile(fileName) { ); writeFileSync( resolve(externalReactSourcesExtendedDir, fileName), - transformed.code + `\n//# sourceMappingURL=${fileName}.map`, + transformed.code + + `\n//# sourceMappingURL=${fileName}.map?foo=bar¶m=some_value`, 'utf8', ); writeFileSync( @@ -297,7 +302,8 @@ function compile(fileName) { ); writeFileSync( resolve(externalReactSourcesIndexMapExtendedDir, fileName), - transformed.code + `\n//# sourceMappingURL=${fileName}.map`, + transformed.code + + `\n//# sourceMappingURL=${fileName}.map?foo=bar¶m=some_value`, 'utf8', ); writeFileSync( diff --git a/packages/react-devtools-extensions/src/parseHookNames/parseHookNames.js b/packages/react-devtools-extensions/src/parseHookNames/parseHookNames.js index 23364ba68e917..ec7a57a0a7149 100644 --- a/packages/react-devtools-extensions/src/parseHookNames/parseHookNames.js +++ b/packages/react-devtools-extensions/src/parseHookNames/parseHookNames.js @@ -26,7 +26,6 @@ import type {HookNames, LRUCache} from 'react-devtools-shared/src/types'; import type {Thenable} from 'shared/ReactTypes'; import type {SourceConsumer} from '../astUtils'; -const SOURCE_MAP_REGEX = / ?sourceMappingURL=([^\s'"]+)/gm; const MAX_SOURCE_LENGTH = 100_000_000; type AST = mixed; @@ -213,18 +212,20 @@ function extractAndLoadSourceMaps( return; } + const sourceMapRegex = / ?sourceMappingURL=([^\s'"]+)/gm; const runtimeSourceCode = ((hookSourceData.runtimeSourceCode: any): string); - const sourceMappingURLs = runtimeSourceCode.match(SOURCE_MAP_REGEX); - if (sourceMappingURLs == null) { + let sourceMappingURLMatch = sourceMapRegex.exec(runtimeSourceCode); + if (sourceMappingURLMatch == null) { // Maybe file has not been transformed; we'll try to parse it as-is in parseSourceAST(). if (__DEBUG__) { console.log('extractAndLoadSourceMaps() No source map found'); } } else { - for (let i = 0; i < sourceMappingURLs.length; i++) { + const externalSourceMapURLs = []; + while (sourceMappingURLMatch != null) { const {runtimeSourceURL} = hookSourceData; - const sourceMappingURL = sourceMappingURLs[i]; + const sourceMappingURL = sourceMappingURLMatch[1]; const hasInlineSourceMap = sourceMappingURL.indexOf('base64,') >= 0; if (hasInlineSourceMap) { // TODO (named hooks) deduplicate parsing in this branch (similar to fetching in the other branch) @@ -257,19 +258,30 @@ function extractAndLoadSourceMaps( break; } } else { - let url = sourceMappingURLs[i].split('=')[1]; + externalSourceMapURLs.push(sourceMappingURL); + } + + sourceMappingURLMatch = sourceMapRegex.exec(runtimeSourceCode); + } - if (i !== sourceMappingURLs.length - 1) { + const foundInlineSourceMap = + hookSourceData.sourceConsumer != null && + hookSourceData.metadataConsumer != null; + if (!foundInlineSourceMap) { + externalSourceMapURLs.forEach((sourceMappingURL, index) => { + if (index !== externalSourceMapURLs.length - 1) { // Files with external source maps should only have a single source map. // More than one result might indicate an edge case, // like a string in the source code that matched our "sourceMappingURL" regex. // We should just skip over cases like this. console.warn( - `More than one external source map detected in the source file; skipping "${url}"`, + `More than one external source map detected in the source file; skipping "${sourceMappingURL}"`, ); - continue; + return; } + const {runtimeSourceURL} = hookSourceData; + let url = sourceMappingURL; if (!url.startsWith('http') && !url.startsWith('/')) { // Resolve paths relative to the location of the file name const lastSlashIdx = runtimeSourceURL.lastIndexOf('/'); @@ -316,8 +328,7 @@ function extractAndLoadSourceMaps( hookSourceData.sourceConsumer = result?.sourceConsumer ?? null; }), ); - break; - } + }); } } });