[WIP] Use devtools-reps-0.19.0#4915
Conversation
0ecce42 to
6cc0e63
Compare
|
This is looking good @nchevobbe. Nice work w/ |
|
Also: photon colors ! |
|
Here's the "flashing" issue I talked you about @jasonLaster : Basically, it's the time we have to wait for properties to be loaded. This is a big case here since we target document, which has a lot of things. |
|
Okay so yeah, just tested the same case in Nightly, and we do have this latency on document, the only thing being we don't show anything until we have all properties loaded. |
|
@nchevobbe i don't mind delaying showing the preview. It should be snappy on most objects. I suppose we could also try some animations too. Perhaps there's something fun we could do with animating the yellow highlight? dunno |
|
okay, nice |
|
Lets treat the preview loading behavior as a next step. And just focus on getting the tests passing now |
|
Sure, CI is failing because of Flow. Let me fix this now |
|
Erf, at this point, we would break preview for React and Immutable https://github.com/devtools-html/debugger.html/pull/4915/files#diff-2e80e25aeaf08281d8427771196d61e1R101 . 😕 @MikeRatcliffe do you think you could have a look and see how we could do thing in the ObjectInspector to autoLoad properties and get them back in some way, so we don't have to change much code for the Preview here ? |
|
@nchevobbe happy to look in a bit |
|
Did a quick look
|
|
When we are trying to preview
Not sure why it is unmounted at this point. |
|
Okay, I guess we need some ObjectInspector changes here |
|
source tree is now fixed. I think the error about setState is when we hover quickly a variable and then mouseleave. |
160e7ef to
e8c4c79
Compare
48e7ee4 to
53d8d7a
Compare
|
@jasonLaster The popup is working just like before now, but i did not tested the React and Immutable cases. This is based on firefox-devtools/devtools-core#884, which will probably be in a 0.19.0 reps package. There is also a minor styling issue (see firefox-devtools/devtools-core#886) |
codehag
left a comment
There was a problem hiding this comment.
looks quite good! a couple of comments regarding type annotation
|
|
||
| let DebuggerClient; | ||
|
|
||
| function createObjectClient(grip: Object) { |
There was a problem hiding this comment.
could we use the Grip type here from flow-typed/debugger-html? https://github.com/devtools-html/debugger.html/blob/master/flow-typed/debugger-html.js#L235
| } = this.props; | ||
| const root = createNode(null, expression, expression, { value }); | ||
|
|
||
| if (!nodeIsPrimitive(root) && value.actor && !loadedObjects[value.actor]) { |
There was a problem hiding this comment.
before, the value was potentially null -- is that no longer the case? maybe we can type this?
| expression, | ||
| loadObjectProperties, | ||
| loadedObjects | ||
| } = this.props; |
There was a problem hiding this comment.
The function has changed to componentWillMount, so this.props will be representing the previous props. do we want to use this.props or nextProps?
|
|
||
| getChildren(root: Object, getObjectProperties: Function) { | ||
| const actors = {}; | ||
| getChildren(root: Object) { |
There was a problem hiding this comment.
There was a problem hiding this comment.
it is, thanks for pointing to the type
| @@ -103,16 +123,18 @@ export class Popup extends Component<Props> { | |||
| } | |||
|
|
|||
| renderObjectPreview(expression: string, root: Object, extra: Object) { | |||
There was a problem hiding this comment.
also maybe here we can use the node type for root: https://github.com/devtools-html/debugger.html/blob/master/src/utils/sources-tree/types.js#L14
it will need to be moved to a more general type
| // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. | ||
| getObjectEntries={actor => {}} | ||
| loadObjectEntries={grip => {}} | ||
| createObjectClient={grip => createObjectClient(grip)} |
| // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. | ||
| getObjectEntries={actor => {}} | ||
| loadObjectEntries={grip => {}} | ||
| createObjectClient={grip => createObjectClient(grip)} |
| > | ||
| <ObjectInspector | ||
| autoExpandDepth={0} | ||
| createObjectClient={[Function]} |
There was a problem hiding this comment.
its just a code deletion party! hurray!
|
I think everything is working fine now, except:
|
|
i can |
|
Okay, so everything is working now, devtools-reps-0.19.0 has been published, we're in a good place. I'm not sure how to tackle this, should I edit all the tests so they don't rely on this action, but more on the UI ? Something like "wait until this .tree element has more than 1 node" ? That's how it's done in the console, but here it will differ from what the test are doing 🤔 @jasonLaster do you have an idea how I can tackle this without rewriting all the tests ? |
|
yep - lets wait for the dom to have rendered loaded scope variables... |
|
okay, i'm down to 3 mochitests failing. |
|
okay I get it. This means one more change in Reps to fix this :/ |
|
@jasonLaster everything is working now (with firefox-devtools/devtools-core#905), so this PR is good for review. |
Since we don't have the LOAD_OBJECT_PROPERTIES anymore, we need to find other ways to wait for the properties to be loaded in tests.
|
not sure what's going in with retext-spell, but aside from that everything is good (with the pending reps PR). |
|
@nchevobbe you need to add |
wldcordeiro
left a comment
There was a problem hiding this comment.
This is packed with so much good stuff! I'm excited to see this land.
Also, sort the dictionary.
| let DebuggerClient; | ||
|
|
||
| function createObjectClient(grip: Grip) { | ||
| return DebuggerClient.createObjectClient(grip); |
There was a problem hiding this comment.
Mochitest is failing here because the assignment in the onConnect below hadn't happened yet. Should you put a guard in to check if the client isn't undefined?
There was a problem hiding this comment.
I think it was failing because of https://bugzilla.mozilla.org/show_bug.cgi?id=1430799, which now landed in mozilla-central.
Locally, all the mochitest pass with --verify :)
There was a problem hiding this comment.
Ah good to know. I saw the failure complaining about undefined and figured it was some async funkiness. Guess we just need to update the CI image?
There was a problem hiding this comment.
i'm not familiar with this, but if this mean the CI image needs to be updated to pick up mozilla-central changes, then yes :)
There was a problem hiding this comment.
@nchevobbe you can update the .travis.yml w/ the new mc sha
Yes ! Thanks, I fixed it in the PR (and took this opportunity to sort the dictionary as well). |
| node.click(); | ||
| return waitUntil( | ||
| () => objectInspector.querySelectorAll(".node").length !== properties | ||
| ); |
There was a problem hiding this comment.
shouldn't we wait till it is the same?
can we move this to a helper?
There was a problem hiding this comment.
nope, since we expand a node, the result should be that the objectInspector has a different number of nodes
| return new Promise(r => setTimeout(r, 3000000)); | ||
| } | ||
|
|
||
| function getScopeNodeLabel(dbg, index) { |
| ); | ||
| async function waitForLoadedScopes(dbg) { | ||
| await waitUntil(() => findElement(dbg, "scopes")); | ||
| const scopes = findElement(dbg, "scopes"); |
There was a problem hiding this comment.
this can be const scopes = await waitUntil(() => findElement(dbg, "scopes"));
There was a problem hiding this comment.
mh, I'll try, but I looked up the waitUntil function, and it was resolving with true, not the result of the condition.
Though, I did not try what you suggest here, so I will
There was a problem hiding this comment.
this makes test fail because scopes.querySelector is not a function.
This is explained by https://searchfox.org/mozilla-central/rev/2031c0f517185b2bd0e8f6f92f9491b3410c1f7f/devtools/client/framework/test/shared-head.js#453-462 , where waitUntil resolves with true.
There was a problem hiding this comment.
oh, i think we have waitForElement :)
| return waitUntil( | ||
| () => objectInspector.querySelectorAll(".node").length !== properties | ||
| ); | ||
| } |
There was a problem hiding this comment.
Perhaps we can have helpers like this in mochitest/head.js?
async function toggleExpression() {
const objectInspector = findElement(dbg, "expressionNode", index).closest(".object-inspector");
await toggleObjectInspectorNode(dbg, objectInspector);
}
async function toggleObjectInspectorNode(dbg, objectInspector) {
const getNumProperties = () => objectInspector.querySelectorAll(".node").length;
const numProperties = getNumProperties();
node.click();
return waitUntil(() => numProperties !== getNumProperties());
}There was a problem hiding this comment.
yeah, sounds like a good idea
| node.click(); | ||
| return waitUntil( | ||
| () => objectInspector.querySelectorAll(".node").length !== properties | ||
| ); |
There was a problem hiding this comment.
function toggleNode(dbg, index) {
const objectInspector = findElement(dbg, "scopeNode", index).closest(".object-inspector");
return toggleObjectInspectorNode(dbg, objectInspector);
}| const properties = await onLoadItemProperties; | ||
| setPopupObjectProperties(value, properties); | ||
| } | ||
| } |
There was a problem hiding this comment.
this looks like it could be moved to a util in the debugger or reps project.
I'm thinking this because it pulls in a bunch of dependencies and is pretty complicated...
could we move some of this logic to the actions/pause/setupPopup...






Updating to the latest devtools-reps means that we need to change how we instantiate ObjectInspector.
This is a wip because :
devtools-reps-0.17.0 is not published yetI didn't checked the testsThe Popup does not seem to work.Yet, watch expressions and scopes are fine.