Bug 1525492 - [release 123] add types to source-maps API (#7846). r=dwalsh
☠☠ backed out by d7e70a8d8b18 ☠ ☠
authorMrigank Krishan <mrigankkrishan@gmail.com>
Tue, 05 Feb 2019 18:24:56 -0800
changeset 457428 43c9893817ab90c1c0357649dae662577e1f0454
parent 457427 f0f2e3a6620bcffa41212cacf848b866842bddff
child 457429 5f647aeba4fda22a90d5dcc0e042f4083ebf0869
push id111727
push userjlaster@mozilla.com
push dateWed, 06 Feb 2019 19:27:21 +0000
treeherdermozilla-inbound@e97ff8f77380 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdwalsh
bugs1525492
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1525492 - [release 123] add types to source-maps API (#7846). r=dwalsh
devtools/client/debugger/new/dist/parser-worker.js
devtools/client/debugger/new/src/utils/bootstrap.js
devtools/client/shared/source-map/index.js
--- a/devtools/client/debugger/new/dist/parser-worker.js
+++ b/devtools/client/debugger/new/dist/parser-worker.js
@@ -23125,80 +23125,103 @@ function mapOriginalExpression(expressio
 /***/ }),
 
 /***/ 3646:
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
 
 
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.stopSourceMapWorker = exports.startSourceMapWorker = exports.isOriginalId = exports.isGeneratedId = exports.generatedToOriginalId = exports.originalToGeneratedId = exports.getOriginalStackFrames = exports.hasMappedSource = exports.clearSourceMaps = exports.applySourceMap = exports.getOriginalSourceText = exports.getLocationScopes = exports.getFileGeneratedRange = exports.getOriginalLocation = exports.getAllGeneratedLocations = exports.getGeneratedLocation = exports.getGeneratedRanges = exports.getOriginalRanges = exports.hasOriginalURL = exports.getOriginalURLs = exports.setAssetRootURL = exports.dispatcher = undefined;
+
+var _utils = __webpack_require__(3652);
+
+Object.defineProperty(exports, "originalToGeneratedId", {
+  enumerable: true,
+  get: function () {
+    return _utils.originalToGeneratedId;
+  }
+});
+Object.defineProperty(exports, "generatedToOriginalId", {
+  enumerable: true,
+  get: function () {
+    return _utils.generatedToOriginalId;
+  }
+});
+Object.defineProperty(exports, "isGeneratedId", {
+  enumerable: true,
+  get: function () {
+    return _utils.isGeneratedId;
+  }
+});
+Object.defineProperty(exports, "isOriginalId", {
+  enumerable: true,
+  get: function () {
+    return _utils.isOriginalId;
+  }
+});
+
+var _devtoolsSourceMap = __webpack_require__(3646);
+
+var self = _interopRequireWildcard(_devtoolsSourceMap);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 const {
-  originalToGeneratedId,
-  generatedToOriginalId,
-  isGeneratedId,
-  isOriginalId
-} = __webpack_require__(3652);
-
-const {
   workerUtils: { WorkerDispatcher }
 } = __webpack_require__(3651);
 
-const dispatcher = new WorkerDispatcher();
-
-const setAssetRootURL = dispatcher.task("setAssetRootURL");
-const getOriginalURLs = dispatcher.task("getOriginalURLs");
-const hasOriginalURL = dispatcher.task("hasOriginalURL");
-const getOriginalRanges = dispatcher.task("getOriginalRanges");
-const getGeneratedRanges = dispatcher.task("getGeneratedRanges", {
-  queue: true
-});
-const getGeneratedLocation = dispatcher.task("getGeneratedLocation", {
-  queue: true
-});
-const getAllGeneratedLocations = dispatcher.task("getAllGeneratedLocations", {
+const dispatcher = exports.dispatcher = new WorkerDispatcher();
+
+const setAssetRootURL = exports.setAssetRootURL = async assetRoot => dispatcher.invoke("setAssetRootURL", assetRoot);
+
+const getOriginalURLs = exports.getOriginalURLs = async generatedSource => dispatcher.invoke("getOriginalURLs", generatedSource);
+
+const hasOriginalURL = exports.hasOriginalURL = async url => dispatcher.invoke("hasOriginalURL", url);
+
+const getOriginalRanges = exports.getOriginalRanges = async (sourceId, url) => dispatcher.invoke("getOriginalRanges", sourceId, url);
+
+const getGeneratedRanges = exports.getGeneratedRanges = async (location, originalSource) => dispatcher.task("getGeneratedRanges", {
   queue: true
-});
-const getOriginalLocation = dispatcher.task("getOriginalLocation");
-const getFileGeneratedRange = dispatcher.task("getFileGeneratedRange");
-const getLocationScopes = dispatcher.task("getLocationScopes");
-const getOriginalSourceText = dispatcher.task("getOriginalSourceText");
-const applySourceMap = dispatcher.task("applySourceMap");
-const clearSourceMaps = dispatcher.task("clearSourceMaps");
-const hasMappedSource = dispatcher.task("hasMappedSource");
-const getOriginalStackFrames = dispatcher.task("getOriginalStackFrames");
-
-module.exports = {
-  originalToGeneratedId,
-  generatedToOriginalId,
-  isGeneratedId,
-  isOriginalId,
-  hasMappedSource,
-  getOriginalURLs,
-  hasOriginalURL,
-  getOriginalRanges,
-  getGeneratedRanges,
-  getGeneratedLocation,
-  getAllGeneratedLocations,
-  getOriginalLocation,
-  getFileGeneratedRange,
-  getLocationScopes,
-  getOriginalSourceText,
-  applySourceMap,
-  clearSourceMaps,
-  getOriginalStackFrames,
-  startSourceMapWorker(url, assetRoot) {
-    dispatcher.start(url);
-    setAssetRootURL(assetRoot);
-  },
-  stopSourceMapWorker: dispatcher.stop.bind(dispatcher)
-};
+})(location, originalSource);
+
+const getGeneratedLocation = exports.getGeneratedLocation = async (location, originalSource) => dispatcher.task("getGeneratedLocation", { queue: true })(location, originalSource);
+
+const getAllGeneratedLocations = exports.getAllGeneratedLocations = async (location, originalSource) => dispatcher.task("getAllGeneratedLocations", { queue: true })(location, originalSource);
+
+const getOriginalLocation = exports.getOriginalLocation = async (location, options = {}) => dispatcher.invoke("getOriginalLocation", location, options);
+
+const getFileGeneratedRange = exports.getFileGeneratedRange = async originalSource => dispatcher.invoke("getFileGeneratedRange", originalSource);
+
+const getLocationScopes = exports.getLocationScopes = dispatcher.task("getLocationScopes");
+
+const getOriginalSourceText = exports.getOriginalSourceText = async originalSource => dispatcher.invoke("getOriginalSourceText", originalSource);
+
+const applySourceMap = exports.applySourceMap = async (generatedId, url, code, mappings) => dispatcher.invoke("applySourceMap", generatedId, url, code, mappings);
+
+const clearSourceMaps = exports.clearSourceMaps = async () => dispatcher.invoke("clearSourceMaps");
+
+const hasMappedSource = exports.hasMappedSource = async location => dispatcher.invoke("hasMappedSource", location);
+
+const getOriginalStackFrames = exports.getOriginalStackFrames = async generatedLocation => dispatcher.invoke("getOriginalStackFrames", generatedLocation);
+
+const startSourceMapWorker = exports.startSourceMapWorker = (url, assetRoot) => {
+  dispatcher.start(url);
+  setAssetRootURL(assetRoot);
+};
+const stopSourceMapWorker = exports.stopSourceMapWorker = dispatcher.stop.bind(dispatcher);
+
+exports.default = self;
 
 /***/ }),
 
 /***/ 3651:
 /***/ (function(module, exports, __webpack_require__) {
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
--- a/devtools/client/debugger/new/src/utils/bootstrap.js
+++ b/devtools/client/debugger/new/src/utils/bootstrap.js
@@ -17,16 +17,17 @@ import * as parser from "../workers/pars
 
 import configureStore from "../actions/utils/create-store";
 import reducers from "../reducers";
 import * as selectors from "../selectors";
 import App from "../components/App";
 import { asyncStore, prefs } from "./prefs";
 
 import type { Panel } from "../client/firefox/types";
+import typeof SourceMaps from "../../packages/devtools-source-map/src";
 
 function renderPanel(component, store) {
   const root = document.createElement("div");
   root.className = "launchpad-root theme-body";
   root.style.setProperty("flex", "1");
   const mount = document.querySelector("#mount");
   if (!mount) {
     return;
@@ -36,17 +37,17 @@ function renderPanel(component, store) {
   ReactDOM.render(
     React.createElement(Provider, { store }, React.createElement(component)),
     root
   );
 }
 
 export function bootstrapStore(
   client: any,
-  sourceMaps: Object,
+  sourceMaps: SourceMaps,
   panel: Panel,
   initialState: Object
 ) {
   const createStore = configureStore({
     log: prefs.logging || isTesting(),
     timing: isDevelopment(),
     makeThunkArgs: (args, state) => {
       return { ...args, client, sourceMaps, panel };
--- a/devtools/client/shared/source-map/index.js
+++ b/devtools/client/shared/source-map/index.js
@@ -414,80 +414,103 @@ function isSlowBuffer (obj) {
 /***/ }),
 
 /***/ 3646:
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
 
 
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.stopSourceMapWorker = exports.startSourceMapWorker = exports.isOriginalId = exports.isGeneratedId = exports.generatedToOriginalId = exports.originalToGeneratedId = exports.getOriginalStackFrames = exports.hasMappedSource = exports.clearSourceMaps = exports.applySourceMap = exports.getOriginalSourceText = exports.getLocationScopes = exports.getFileGeneratedRange = exports.getOriginalLocation = exports.getAllGeneratedLocations = exports.getGeneratedLocation = exports.getGeneratedRanges = exports.getOriginalRanges = exports.hasOriginalURL = exports.getOriginalURLs = exports.setAssetRootURL = exports.dispatcher = undefined;
+
+var _utils = __webpack_require__(3652);
+
+Object.defineProperty(exports, "originalToGeneratedId", {
+  enumerable: true,
+  get: function () {
+    return _utils.originalToGeneratedId;
+  }
+});
+Object.defineProperty(exports, "generatedToOriginalId", {
+  enumerable: true,
+  get: function () {
+    return _utils.generatedToOriginalId;
+  }
+});
+Object.defineProperty(exports, "isGeneratedId", {
+  enumerable: true,
+  get: function () {
+    return _utils.isGeneratedId;
+  }
+});
+Object.defineProperty(exports, "isOriginalId", {
+  enumerable: true,
+  get: function () {
+    return _utils.isOriginalId;
+  }
+});
+
+var _devtoolsSourceMap = __webpack_require__(3646);
+
+var self = _interopRequireWildcard(_devtoolsSourceMap);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 const {
-  originalToGeneratedId,
-  generatedToOriginalId,
-  isGeneratedId,
-  isOriginalId
-} = __webpack_require__(3652);
-
-const {
   workerUtils: { WorkerDispatcher }
 } = __webpack_require__(3651);
 
-const dispatcher = new WorkerDispatcher();
+const dispatcher = exports.dispatcher = new WorkerDispatcher();
+
+const setAssetRootURL = exports.setAssetRootURL = async assetRoot => dispatcher.invoke("setAssetRootURL", assetRoot);
+
+const getOriginalURLs = exports.getOriginalURLs = async generatedSource => dispatcher.invoke("getOriginalURLs", generatedSource);
 
-const setAssetRootURL = dispatcher.task("setAssetRootURL");
-const getOriginalURLs = dispatcher.task("getOriginalURLs");
-const hasOriginalURL = dispatcher.task("hasOriginalURL");
-const getOriginalRanges = dispatcher.task("getOriginalRanges");
-const getGeneratedRanges = dispatcher.task("getGeneratedRanges", {
-  queue: true
-});
-const getGeneratedLocation = dispatcher.task("getGeneratedLocation", {
+const hasOriginalURL = exports.hasOriginalURL = async url => dispatcher.invoke("hasOriginalURL", url);
+
+const getOriginalRanges = exports.getOriginalRanges = async (sourceId, url) => dispatcher.invoke("getOriginalRanges", sourceId, url);
+
+const getGeneratedRanges = exports.getGeneratedRanges = async (location, originalSource) => dispatcher.task("getGeneratedRanges", {
   queue: true
-});
-const getAllGeneratedLocations = dispatcher.task("getAllGeneratedLocations", {
-  queue: true
-});
-const getOriginalLocation = dispatcher.task("getOriginalLocation");
-const getFileGeneratedRange = dispatcher.task("getFileGeneratedRange");
-const getLocationScopes = dispatcher.task("getLocationScopes");
-const getOriginalSourceText = dispatcher.task("getOriginalSourceText");
-const applySourceMap = dispatcher.task("applySourceMap");
-const clearSourceMaps = dispatcher.task("clearSourceMaps");
-const hasMappedSource = dispatcher.task("hasMappedSource");
-const getOriginalStackFrames = dispatcher.task("getOriginalStackFrames");
+})(location, originalSource);
+
+const getGeneratedLocation = exports.getGeneratedLocation = async (location, originalSource) => dispatcher.task("getGeneratedLocation", { queue: true })(location, originalSource);
+
+const getAllGeneratedLocations = exports.getAllGeneratedLocations = async (location, originalSource) => dispatcher.task("getAllGeneratedLocations", { queue: true })(location, originalSource);
+
+const getOriginalLocation = exports.getOriginalLocation = async (location, options = {}) => dispatcher.invoke("getOriginalLocation", location, options);
 
-module.exports = {
-  originalToGeneratedId,
-  generatedToOriginalId,
-  isGeneratedId,
-  isOriginalId,
-  hasMappedSource,
-  getOriginalURLs,
-  hasOriginalURL,
-  getOriginalRanges,
-  getGeneratedRanges,
-  getGeneratedLocation,
-  getAllGeneratedLocations,
-  getOriginalLocation,
-  getFileGeneratedRange,
-  getLocationScopes,
-  getOriginalSourceText,
-  applySourceMap,
-  clearSourceMaps,
-  getOriginalStackFrames,
-  startSourceMapWorker(url, assetRoot) {
-    dispatcher.start(url);
-    setAssetRootURL(assetRoot);
-  },
-  stopSourceMapWorker: dispatcher.stop.bind(dispatcher)
+const getFileGeneratedRange = exports.getFileGeneratedRange = async originalSource => dispatcher.invoke("getFileGeneratedRange", originalSource);
+
+const getLocationScopes = exports.getLocationScopes = dispatcher.task("getLocationScopes");
+
+const getOriginalSourceText = exports.getOriginalSourceText = async originalSource => dispatcher.invoke("getOriginalSourceText", originalSource);
+
+const applySourceMap = exports.applySourceMap = async (generatedId, url, code, mappings) => dispatcher.invoke("applySourceMap", generatedId, url, code, mappings);
+
+const clearSourceMaps = exports.clearSourceMaps = async () => dispatcher.invoke("clearSourceMaps");
+
+const hasMappedSource = exports.hasMappedSource = async location => dispatcher.invoke("hasMappedSource", location);
+
+const getOriginalStackFrames = exports.getOriginalStackFrames = async generatedLocation => dispatcher.invoke("getOriginalStackFrames", generatedLocation);
+
+const startSourceMapWorker = exports.startSourceMapWorker = (url, assetRoot) => {
+  dispatcher.start(url);
+  setAssetRootURL(assetRoot);
 };
+const stopSourceMapWorker = exports.stopSourceMapWorker = dispatcher.stop.bind(dispatcher);
+
+exports.default = self;
 
 /***/ }),
 
 /***/ 3651:
 /***/ (function(module, exports, __webpack_require__) {
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this