mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1237253 - Support define in BrowserLoader; r=jlongster r=jryans
This commit is contained in:
parent
5082deee54
commit
8633136aa0
@ -6,7 +6,7 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./reps/rep-utils");
|
||||
const { Headers } = createFactories(require("./headers"));
|
||||
const { Toolbar, ToolbarButton } = createFactories(require("./reps/toolbar"));
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
|
||||
// Constants
|
||||
const DOM = React.DOM;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./reps/rep-utils");
|
||||
const { TreeView } = createFactories(require("./reps/tree-view"));
|
||||
const { SearchBox } = createFactories(require("./search-box"));
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./reps/rep-utils");
|
||||
const { JsonPanel } = createFactories(require("./json-panel"));
|
||||
const { TextPanel } = createFactories(require("./text-panel"));
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./rep-utils");
|
||||
const { Rep } = createFactories(require("./rep"));
|
||||
const { ObjectBox } = createFactories(require("./object-box"));
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const DOM = React.DOM;
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./rep-utils");
|
||||
const { ObjectBox } = createFactories(require("./object-box"));
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./rep-utils");
|
||||
const { ObjectBox } = createFactories(require("./object-box"));
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const DOM = React.DOM;
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const DOM = React.DOM;
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./rep-utils");
|
||||
const { ObjectBox } = createFactories(require("./object-box"));
|
||||
const { Caption } = createFactories(require("./caption"));
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
|
||||
/**
|
||||
* Create React factories for given arguments.
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
|
||||
// Load all existing rep templates
|
||||
const { Undefined } = require("./undefined");
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./rep-utils");
|
||||
const { ObjectBox } = createFactories(require("./object-box"));
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const DOM = React.DOM;
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const DOM = React.DOM;
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./rep-utils");
|
||||
const { Rep } = createFactories(require("./rep"));
|
||||
const { StringRep } = require("./string");
|
||||
|
@ -9,7 +9,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// Dependencies
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./rep-utils");
|
||||
const { ObjectBox } = createFactories(require("./object-box"));
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
|
||||
const DOM = React.DOM;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
const React = require("react");
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./reps/rep-utils");
|
||||
const { Toolbar, ToolbarButton } = createFactories(require("./reps/toolbar"));
|
||||
const DOM = React.DOM;
|
||||
|
@ -7,9 +7,7 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
// ReactJS
|
||||
const ReactDOM = require("react-dom");
|
||||
|
||||
// RDP Inspector
|
||||
const ReactDOM = require("devtools/client/shared/vendor/react-dom");
|
||||
const { createFactories } = require("./components/reps/rep-utils");
|
||||
const { MainTabbedArea } = createFactories(require("./components/main-tabbed-area"));
|
||||
|
||||
|
@ -16,15 +16,19 @@
|
||||
*
|
||||
* The path mapping uses paths fallback (a feature supported by RequireJS)
|
||||
* See also: http://requirejs.org/docs/api.html#pathsfallbacks
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
require.config({
|
||||
baseUrl: ".",
|
||||
paths: {
|
||||
"react": [
|
||||
"devtools/client/shared/vendor/react": [
|
||||
"resource://devtools/client/shared/vendor/react-dev",
|
||||
"resource://devtools/client/shared/vendor/react"
|
||||
],
|
||||
"react-dom": "resource://devtools/client/shared/vendor/react-dom"
|
||||
"devtools/client/shared/vendor/react-dom":
|
||||
"resource://devtools/client/shared/vendor/react-dom"
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,9 +1,15 @@
|
||||
/* 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/. */
|
||||
"use strict";
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
const loaders = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
|
||||
const { devtools, DevToolsLoader } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { joinURI } = devtools.require("devtools/shared/path");
|
||||
const BROWSER_BASED_DIRS = [
|
||||
"resource://devtools/client/jsonview",
|
||||
"resource://devtools/client/shared/vendor",
|
||||
"resource://devtools/client/shared/components",
|
||||
"resource://devtools/client/shared/redux"
|
||||
@ -54,6 +60,13 @@ function BrowserLoader(baseURI, window) {
|
||||
}
|
||||
|
||||
return require(uri);
|
||||
},
|
||||
globals: {
|
||||
// Make sure 'define' function exists. This allows reusing AMD modules.
|
||||
define: function(callback) {
|
||||
callback(this.require, this.exports, this.module);
|
||||
return this.exports;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
2
devtools/client/shared/vendor/react-dom.js
vendored
2
devtools/client/shared/vendor/react-dom.js
vendored
@ -6,7 +6,7 @@
|
||||
|
||||
// RequireJS
|
||||
} else if (typeof define === "function" && define.amd) {
|
||||
define(['react'], f);
|
||||
define(['devtools/client/shared/vendor/react'], f);
|
||||
|
||||
// <script>
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user