SELECT\_FRAME action is then dispatched.
-- loadObjectProperties() – This function is called from the Scopes
- component, which passes the data to the ObjectInspector component as
- a property to display in the variable tree under the Scopes panel.
- This function is also called directly from the ObjectInspector as
- the variable tree is expanded. The function calls the connected
- client to retrieve the values and dispatches the
- LOAD\_OBJECT\_PROPERTIES action.
+- setPopupObjectProperties() – This function is called from the
+ Popup component, which then use this data to pass all the properties from
+ the hovered variable as root nodes of the ObjectInspector component.
+ The function dispatches the SET\_POPUP\_OBJECT\_PROPERTIES action.
## sources
diff --git a/package.json b/package.json
index 15dd1351be..94ee58c596 100644
--- a/package.json
+++ b/package.json
@@ -72,10 +72,10 @@
"babylon": "^6.18.0",
"codemirror": "^5.28.0",
"devtools-components": "^0.0.2",
- "devtools-launchpad": "^0.0.112",
+ "devtools-launchpad": "^0.0.113",
"devtools-linters": "^0.0.4",
"devtools-map-bindings": "^0.3.2",
- "devtools-reps": "^0.12.4",
+ "devtools-reps": "^0.19.0",
"devtools-source-map": "^0.14.7",
"devtools-splitter": "^0.0.6",
"devtools-utils": "^0.0.10",
diff --git a/src/actions/pause/index.js b/src/actions/pause/index.js
index 13ff6034fd..cee7967321 100644
--- a/src/actions/pause/index.js
+++ b/src/actions/pause/index.js
@@ -16,6 +16,6 @@ export { resumed } from "./resumed";
export { continueToHere } from "./continueToHere";
export { breakOnNext } from "./breakOnNext";
export { mapFrames } from "./mapFrames";
-export { loadObjectProperties } from "./loadObjectProperties";
+export { setPopupObjectProperties } from "./setPopupObjectProperties";
export { pauseOnExceptions } from "./pauseOnExceptions";
export { selectFrame } from "./selectFrame";
diff --git a/src/actions/pause/loadObjectProperties.js b/src/actions/pause/setPopupObjectProperties.js
similarity index 62%
rename from src/actions/pause/loadObjectProperties.js
rename to src/actions/pause/setPopupObjectProperties.js
index bdc4148f9a..d4357c14e5 100644
--- a/src/actions/pause/loadObjectProperties.js
+++ b/src/actions/pause/setPopupObjectProperties.js
@@ -4,26 +4,25 @@
// @flow
-import { PROMISE } from "../utils/middleware/promise";
-import { getLoadedObject } from "../../selectors";
+import { getPopupObjectProperties } from "../../selectors";
import type { ThunkArgs } from "../types";
/**
* @memberof actions/pause
* @static
*/
-export function loadObjectProperties(object: any) {
+export function setPopupObjectProperties(object: any, properties: Object) {
return ({ dispatch, client, getState }: ThunkArgs) => {
const objectId = object.actor || object.objectId;
- if (getLoadedObject(getState(), objectId)) {
+ if (getPopupObjectProperties(getState(), object.actor)) {
return;
}
dispatch({
- type: "LOAD_OBJECT_PROPERTIES",
+ type: "SET_POPUP_OBJECT_PROPERTIES",
objectId,
- [PROMISE]: client.getProperties(object)
+ properties
});
};
}
diff --git a/src/actions/types.js b/src/actions/types.js
index 8f0bb15593..f19ffb9bd8 100644
--- a/src/actions/types.js
+++ b/src/actions/types.js
@@ -241,11 +241,9 @@ type PauseAction =
| { type: "COMMAND", value: { type: string }, command: string }
| { type: "SELECT_FRAME", frame: Frame, scopes: Scope[] }
| {
- type: "LOAD_OBJECT_PROPERTIES",
+ type: "SET_POPUP_OBJECT_PROPERTIES",
objectId: string,
- status: string,
- value: Object,
- "@@dispatch/promise": any
+ properties: Object
}
| {
type: "ADD_EXPRESSION",
diff --git a/src/actions/utils/middleware/log.js b/src/actions/utils/middleware/log.js
index eef1cec58b..0785760bf0 100644
--- a/src/actions/utils/middleware/log.js
+++ b/src/actions/utils/middleware/log.js
@@ -6,7 +6,7 @@
import { isTesting } from "devtools-config";
const blacklist = [
- "LOAD_OBJECT_PROPERTIES",
+ "SET_POPUP_OBJECT_PROPERTIES",
"SET_SYMBOLS",
"OUT_OF_SCOPE_LOCATIONS"
];
diff --git a/src/client/firefox.js b/src/client/firefox.js
index 0715fafcab..f37161762c 100644
--- a/src/client/firefox.js
+++ b/src/client/firefox.js
@@ -7,12 +7,20 @@
import { setupCommands, clientCommands } from "./firefox/commands";
import { setupEvents, clientEvents } from "./firefox/events";
import { features } from "../utils/prefs";
+import type { Grip } from "debugger-html";
+let DebuggerClient;
+
+function createObjectClient(grip: Grip) {
+ return DebuggerClient.createObjectClient(grip);
+}
export async function onConnect(connection: any, actions: Object): Object {
const {
tabConnection: { tabTarget, threadClient, debuggerClient }
} = connection;
+ DebuggerClient = debuggerClient;
+
if (!tabTarget || !threadClient || !debuggerClient) {
return { bpClients: {} };
}
@@ -59,4 +67,4 @@ export async function onConnect(connection: any, actions: Object): Object {
return { bpClients };
}
-export { clientCommands, clientEvents };
+export { createObjectClient, clientCommands, clientEvents };
diff --git a/src/components/Editor/Preview/Popup.js b/src/components/Editor/Preview/Popup.js
index 6e4e6a3495..c6ed83c7d7 100644
--- a/src/components/Editor/Preview/Popup.js
+++ b/src/components/Editor/Preview/Popup.js
@@ -8,28 +8,37 @@ import React, { Component } from "react";
import { connect } from "react-redux";
import Reps from "devtools-reps";
-const { REPS: { Rep }, MODE, ObjectInspectorUtils } = Reps;
-const { ObjectInspector } = Reps;
-const { getChildren } = ObjectInspectorUtils;
+const { REPS: { Rep }, MODE, ObjectInspector, ObjectInspectorUtils } = Reps;
+
+const {
+ createNode,
+ getChildren,
+ getValue,
+ nodeIsPrimitive
+} = ObjectInspectorUtils.node;
+const { loadItemProperties } = ObjectInspectorUtils.loadProperties;
import actions from "../../../actions";
-import { getLoadedObjects } from "../../../selectors";
+import { getAllPopupObjectProperties } from "../../../selectors";
import Popover from "../../shared/Popover";
import PreviewFunction from "../../shared/PreviewFunction";
import { markText } from "../../../utils/editor";
import { isReactComponent, isImmutable } from "../../../utils/preview";
import Svg from "../../shared/Svg";
+import { createObjectClient } from "../../../client/firefox";
import "./Popup.css";
import type { EditorRange } from "../../../utils/editor/types";
+import type { Node } from "../../../utils/sources-tree/types";
+type PopupValue = Object | null;
type Props = {
- loadObjectProperties: Object => void,
+ setPopupObjectProperties: (Object, Object) => void,
addExpression: (string, ?Object) => void,
- loadedObjects: Object,
+ popupObjectProperties: Object,
popoverPos: Object,
- value: Object,
+ value: PopupValue,
expression: string,
onClose: () => void,
range: EditorRange,
@@ -44,24 +53,37 @@ export class Popup extends Component