2015-09-28 14:33:20 +03:00
|
|
|
/* 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/. */
|
2016-03-18 08:26:53 +03:00
|
|
|
/* global requirejs */
|
|
|
|
|
|
|
|
"use strict";
|
2015-09-28 14:33:20 +03:00
|
|
|
|
2017-11-28 18:28:21 +03:00
|
|
|
// Send readyState change notification event to the window. It's useful for tests.
|
|
|
|
JSONView.readyState = "loading";
|
|
|
|
window.dispatchEvent(new CustomEvent("AppReadyStateChange"));
|
|
|
|
|
2018-06-28 11:43:02 +03:00
|
|
|
// Services is required in the Reps bundle but can't be loaded in the json-viewer.
|
|
|
|
// Since it's only used for the ObjectInspector, that the json-viewer does not use, we
|
|
|
|
// can mock it. The mock should be removed when we un-bundle reps, (i.e. land individual
|
|
|
|
// files instead of a big bundle).
|
|
|
|
define("ServicesMock", () => ({ appinfo: {} }));
|
|
|
|
|
2015-09-28 14:33:20 +03:00
|
|
|
/**
|
|
|
|
* RequireJS configuration for JSON Viewer.
|
|
|
|
*
|
2017-06-03 21:58:00 +03:00
|
|
|
* ReactJS library is shared among DevTools. The minified (production) version
|
|
|
|
* of the library is always available, and is used by default.
|
2015-09-28 14:33:20 +03:00
|
|
|
*
|
|
|
|
* In order to use the developer version you need to specify the following
|
|
|
|
* in your .mozconfig (see also bug 1181646):
|
|
|
|
* ac_add_options --enable-debug-js-modules
|
|
|
|
*
|
2016-01-15 16:15:28 +03:00
|
|
|
* React module ID is using exactly the same (relative) path as the rest
|
|
|
|
* of the code base, so it's consistent and modules can be easily reused.
|
2015-09-28 14:33:20 +03:00
|
|
|
*/
|
|
|
|
require.config({
|
2017-06-08 12:52:46 +03:00
|
|
|
baseUrl: "resource://devtools-client-jsonview/",
|
2015-09-28 14:33:20 +03:00
|
|
|
paths: {
|
2017-06-08 12:52:46 +03:00
|
|
|
"devtools/client/jsonview": "resource://devtools-client-jsonview",
|
|
|
|
"devtools/client/shared": "resource://devtools-client-shared",
|
2016-10-19 20:20:49 +03:00
|
|
|
"devtools/shared": "resource://devtools/shared",
|
2017-06-03 21:58:00 +03:00
|
|
|
"devtools/client/shared/vendor/react": JSONView.debugJsModules
|
2017-06-08 12:52:46 +03:00
|
|
|
? "resource://devtools-client-shared/vendor/react-dev"
|
2017-09-14 15:32:06 +03:00
|
|
|
: "resource://devtools-client-shared/vendor/react",
|
|
|
|
"devtools/client/shared/vendor/react-dom": JSONView.debugJsModules
|
|
|
|
? "resource://devtools-client-shared/vendor/react-dom-dev"
|
|
|
|
: "resource://devtools-client-shared/vendor/react-dom",
|
2017-11-03 16:34:41 +03:00
|
|
|
"devtools/client/shared/vendor/react-prop-types": JSONView.debugJsModules
|
|
|
|
? "resource://devtools-client-shared/vendor/react-prop-types-dev"
|
|
|
|
: "resource://devtools-client-shared/vendor/react-prop-types",
|
2018-02-07 19:31:57 +03:00
|
|
|
"devtools/client/shared/vendor/react-dom-test-utils": JSONView.debugJsModules
|
|
|
|
? "resource://devtools-client-shared/vendor/react-dom-test-utils-dev"
|
|
|
|
: "resource://devtools-client-shared/vendor/react-dom-test-utils",
|
2018-06-28 11:43:02 +03:00
|
|
|
Services: "resource://devtools-client-shared/vendor/react-prop-types",
|
|
|
|
},
|
|
|
|
map: {
|
|
|
|
"*": {
|
|
|
|
Services: "ServicesMock",
|
|
|
|
},
|
2015-09-28 14:33:20 +03:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
// Load the main panel module
|
|
|
|
requirejs(["json-viewer"]);
|