Add handling for config object in JsonML
Categories
(DevTools :: Framework, enhancement)
Tracking
(firefox111 fixed)
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: sebo, Assigned: sebo)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 4 obsolete files)
Custom formatters allow to define a special JsonML structure to pass configuration objects.
This happens by defining "object"
as tag name and an object with an object
property and an optional config
property as a second parameter.
So there needs to be a way to handle such object references.
Sebastian
Assignee | ||
Comment 1•2 years ago
|
||
Here's a simple example for a custom formatter with an configuration object.
Sebastian
Comment 2•2 years ago
|
||
Comment 3•2 years ago
|
||
Thanks sebo,
I played with the provided example and pushed an implementation prototype: https://phabricator.services.mozilla.com/D152518
So unlike I said during previous meeting, we don't have to send a reference to the client
The idea is that after calling body
, we look into the result to see if any item has an "object"
type.
For those, we then create an ObjectActor
((let's call it oa2
)), on which we call customFormatterHeader
, passing it the config
object (which we store on oa2._customFormatterConfig
) and we replace the "object"
item by the result of the call to customFormatterHeader
.
Then, when oa2.customFormatterBody
is called, we call the body
hook with with oa2._customFormatterConfig
, and that should give us all we need.
I couldn't validate that it works properly as I'm facing some issue when calling structuredClone
on the body result (probably because there's some reference to some object, or something else)
As a result, I couldn't check that the JsonMl rep would handle this properly, but the rough idea is here.
Comment 4•2 years ago
|
||
So I've been playing a bit more with this, and I think we might not use the ObjectInspector
to render JsonML; the JsonML body will only be a single JsonMl item, which in turn will hold some JsonMl items (or strings).
With the ObjectInspector, we consider the body to be a node, and so it would be tricky to have its children being nodes as well.
We might turn JsonMl into a more capable component which will manage its own state, which will only consist in being able to retrieve and display the body (we can use useState
I think if we want to keep JsonMl
a simple function)
The body will in turn render its items using JsonMl
, which will be able to handle their body, and so on
So we'd always avoid using ObjectInspector (tweaking https://searchfox.org/mozilla-central/rev/d5edb4a4538657b7d691a41c00e6796a19ade6e7/devtools/client/shared/components/object-inspector/utils/index.js#26-30), and we'll make JsonMl display the arrow and call the hook on click.
Furthermore, this will align more with what Chrome does, as we won't use any of the ObjectInspector styling (e.g. for the indent), and let the custom formatters handle everything.
What do you think sebo, does that make sense?
Assignee | ||
Comment 5•2 years ago
|
||
It sounds reasonable to me to separate the rendering of JsonML from the ObjectInspector. Though it also sounds like it may share a few logics with it like the expansion handling.
I need to play around with that idea and see what I can come up with. I'll come back to you on that.
Sebastian
Assignee | ||
Comment 6•2 years ago
|
||
Assignee | ||
Comment 7•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 8•2 years ago
|
||
Depends on D160175
Comment 9•2 years ago
|
||
Comment on attachment 9303577 [details]
Bug 1764443 - Added option to makeSideeffectFreeDebugger() to skip checking effectful offsets. r=nchevobbe
Revision D162151 was moved to bug 1801040. Setting attachment 9303577 [details] to obsolete.
Comment 10•2 years ago
|
||
Comment on attachment 9298205 [details]
Bug 1764443 - Replaced ObjectInspector handling for custom formatter output by separate one. r=nchevobbe
Revision D159166 was moved to bug 1801045. Setting attachment 9298205 [details] to obsolete.
Updated•2 years ago
|
Comment 11•2 years ago
|
||
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Comment 13•2 years ago
|
||
Backed out for causing xpcshell failures on test_threadlifetime-02.js and test_objectgrips-21.js.
there is also this failed TV job:
Failure log for TV
[task 2023-01-26T09:54:55.062Z] 09:54:55 INFO - TEST-START | devtools/server/tests/xpcshell/test_threadlifetime-02.js
[task 2023-01-26T09:59:55.069Z] 09:59:55 WARNING - TEST-UNEXPECTED-TIMEOUT | devtools/server/tests/xpcshell/test_threadlifetime-02.js | Test timed out
[task 2023-01-26T09:59:55.069Z] 09:59:55 INFO - TEST-INFO took 300000ms
[task 2023-01-26T09:59:55.069Z] 09:59:55 INFO - >>>>>>>
[task 2023-01-26T09:59:55.069Z] 09:59:55 INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2023-01-26T09:59:55.069Z] 09:59:55 INFO - (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2023-01-26T09:59:55.069Z] 09:59:55 INFO - (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2023-01-26T09:59:55.070Z] 09:59:55 INFO - running event loop
[task 2023-01-26T09:59:55.071Z] 09:59:55 INFO - devtools/server/tests/xpcshell/test_threadlifetime-02.js | Starting
[task 2023-01-26T09:59:55.071Z] 09:59:55 INFO - (xpcshell/head.js) | test pending (2)
[task 2023-01-26T09:59:55.072Z] 09:59:55 INFO - PID 9900 | >>> Run thread front test against a regular DevToolsServer
[task 2023-01-26T09:59:55.072Z] 09:59:55 INFO - (xpcshell/head.js) | test run_next_test 0 finished (2)
[task 2023-01-26T09:59:55.072Z] 09:59:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_threadlifetime-02.js | - 3 == 3
[task 2023-01-26T09:59:55.073Z] 09:59:55 INFO - PID 9900 | DBG-TEST: :0: error: IndexedDB UnknownErr: ActorsParent.cpp:563
[task 2023-01-26T09:59:55.073Z] 09:59:55 INFO - PID 9900 | DBG-TEST: head_dbg.js observed a console message: IndexedDB UnknownErr: ActorsParent.cpp:563
[task 2023-01-26T09:59:55.074Z] 09:59:55 INFO - "CONSOLE_MESSAGE: (error) [JavaScript Error: "IndexedDB UnknownErr: ActorsParent.cpp:563"]"
[task 2023-01-26T09:59:55.076Z] 09:59:55 INFO - PID 9900 | console.error: "Error when attaching target:" (void 0)
[task 2023-01-26T09:59:55.076Z] 09:59:55 INFO - PID 9900 | console.error: "Error while calling actor 'console's method 'startListeners'" "can't access property \\"timing\\", window.performance is undefined"
[task 2023-01-26T09:59:55.077Z] 09:59:55 INFO - PID 9900 | console.error: (new TypeError("can't access property \\"timing\\", window.performance is undefined", "resource://devtools/server/actors/webconsole/listeners/document-events.js", 116))
[task 2023-01-26T09:59:55.078Z] 09:59:55 INFO - PID 9900 | console.error: "Failed to start [document-event] legacy listener for target server0.conn0.windowGlobalTarget2" (new Error("Protocol error (TypeError): can't access property \\"timing\\", window.performance is undefined from: server0.conn0.consoleActor4 (resource://devtools/server/actors/webconsole/listeners/document-events.js:116:18)", "resource://devtools/shared/protocol/Front.js", 383))
[task 2023-01-26T09:59:55.078Z] 09:59:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_threadlifetime-02.js | - Thread front is attached - "attached" == "attached"
[task 2023-01-26T09:59:55.079Z] 09:59:55 INFO - PID 9900 | Waiting for pause.
[task 2023-01-26T09:59:55.079Z] 09:59:55 INFO - (xpcshell/head.js) | test pending (2)
[task 2023-01-26T09:59:55.080Z] 09:59:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_threadlifetime-02.js | - "undefined" == "undefined"
[task 2023-01-26T09:59:55.080Z] 09:59:55 INFO - PID 9900 | Waiting for pause.
[task 2023-01-26T09:59:55.081Z] 09:59:55 INFO - PID 9900 | Resuming thread.
[task 2023-01-26T09:59:55.082Z] 09:59:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_threadlifetime-02.js | - "server0.conn0.obj9" == "server0.conn0.obj9"
[task 2023-01-26T09:59:55.082Z] 09:59:55 INFO - PID 9900 | console.error: "Error while calling actor 'obj's method 'release'" "can't access property \\"isThreadLifetimePool\\", this.hooks is null"
[task 2023-01-26T09:59:55.083Z] 09:59:55 INFO - PID 9900 | console.error: (new TypeError("can't access property \\"isThreadLifetimePool\\", this.hooks is null", "resource://devtools/server/actors/pause-scoped.js", 88))
[task 2023-01-26T09:59:55.084Z] 09:59:55 INFO - Unexpected exception Error: Protocol error (TypeError): can't access property "isThreadLifetimePool", this.hooks is null from: server0.conn0.obj9 (resource://devtools/server/actors/pause-scoped.js:88:9) at resource://devtools/shared/protocol/Front.js:383
[task 2023-01-26T09:59:55.084Z] 09:59:55 INFO - onPacket/<@resource://devtools/shared/protocol/Front.js:383:31
[task 2023-01-26T09:59:55.085Z] 09:59:55 INFO - DevTools RDP*request@resource://devtools/shared/protocol/Front.js:300:14
[task 2023-01-26T09:59:55.086Z] 09:59:55 INFO - generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:47:19
[task 2023-01-26T09:59:55.087Z] 09:59:55 INFO - generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:76:19
[task 2023-01-26T09:59:55.087Z] 09:59:55 INFO - @/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_threadlifetime-02.js:38:20
[task 2023-01-26T09:59:55.088Z] 09:59:55 INFO - enter@resource://devtools/server/actors/utils/event-loop.js:82:18
[task 2023-01-26T09:59:55.089Z] 09:59:55 INFO - _pauseAndRespond@resource://devtools/server/actors/thread.js:970:29
[task 2023-01-26T09:59:55.089Z] 09:59:55 INFO - onDebuggerStatement@resource://devtools/server/actors/thread.js:1915:17
[task 2023-01-26T09:59:55.090Z] 09:59:55 INFO - stopMe@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_threadlifetime-02.js line 62 > eval:4:11
[task 2023-01-26T09:59:55.090Z] 09:59:55 INFO - @/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_threadlifetime-02.js line 62 > eval:6:15
[task 2023-01-26T09:59:55.091Z] 09:59:55 INFO - @/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_threadlifetime-02.js line 62 > eval:7:9
[task 2023-01-26T09:59:55.092Z] 09:59:55 INFO - evaluateTestCode@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_threadlifetime-02.js:62:12
[task 2023-01-26T09:59:55.092Z] 09:59:55 INFO - packet<@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_threadlifetime-02.js:13:29
[task 2023-01-26T09:59:55.093Z] 09:59:55 INFO - run@/builds/worker/workspace/build/tests/xpcshell/head.js:807:9
[task 2023-01-26T09:59:55.093Z] 09:59:55 INFO - _do_main@/builds/worker/workspace/build/tests/xpcshell/head.js:238:6
[task 2023-01-26T09:59:55.094Z] 09:59:55 INFO - _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:585:5
[task 2023-01-26T09:59:55.094Z] 09:59:55 INFO - @-e:1:1
[task 2023-01-26T09:59:55.095Z] 09:59:55 INFO - exiting test
[task 2023-01-26T09:59:55.095Z] 09:59:55 INFO - <<<<<<<
[task 2023-01-26T09:59:55.096Z] 09:59:55 INFO - xpcshell return code: None
[task 2023-01-26T09:59:55.096Z] 09:59:55 INFO - devtools/server/tests/xpcshell/test_threadlifetime-02.js | Process still running after test!
[task 2023-01-26T09:59:55.097Z] 09:59:55 INFO - TEST-START | devtools/server/tests/xpcshell/test_objectgrips-21.js
[task 2023-01-26T10:04:55.096Z] 10:04:55 WARNING - TEST-UNEXPECTED-TIMEOUT | devtools/server/tests/xpcshell/test_objectgrips-21.js | Test timed out
[task 2023-01-26T10:04:55.097Z] 10:04:55 INFO - TEST-INFO took 300010ms
[task 2023-01-26T10:04:55.097Z] 10:04:55 INFO - >>>>>>>
[task 2023-01-26T10:04:55.098Z] 10:04:55 INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2023-01-26T10:04:55.098Z] 10:04:55 INFO - (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2023-01-26T10:04:55.098Z] 10:04:55 INFO - (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2023-01-26T10:04:55.098Z] 10:04:55 INFO - running event loop
[task 2023-01-26T10:04:55.098Z] 10:04:55 INFO - devtools/server/tests/xpcshell/test_objectgrips-21.js | Starting
[task 2023-01-26T10:04:55.099Z] 10:04:55 INFO - (xpcshell/head.js) | test pending (2)
[task 2023-01-26T10:04:55.100Z] 10:04:55 INFO - PID 9921 | >>> Run thread front test against a regular DevToolsServer
[task 2023-01-26T10:04:55.100Z] 10:04:55 INFO - (xpcshell/head.js) | test run_next_test 0 finished (2)
[task 2023-01-26T10:04:55.100Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - 3 == 3
[task 2023-01-26T10:04:55.101Z] 10:04:55 INFO - PID 9921 | DBG-TEST: :0: error: IndexedDB UnknownErr: ActorsParent.cpp:563
[task 2023-01-26T10:04:55.101Z] 10:04:55 INFO - PID 9921 | DBG-TEST: head_dbg.js observed a console message: IndexedDB UnknownErr: ActorsParent.cpp:563
[task 2023-01-26T10:04:55.101Z] 10:04:55 INFO - "CONSOLE_MESSAGE: (error) [JavaScript Error: "IndexedDB UnknownErr: ActorsParent.cpp:563"]"
[task 2023-01-26T10:04:55.101Z] 10:04:55 INFO - PID 9921 | console.error: "Error when attaching target:" (void 0)
[task 2023-01-26T10:04:55.102Z] 10:04:55 INFO - PID 9921 | console.error: "Error while calling actor 'console's method 'startListeners'" "can't access property \\"timing\\", window.performance is undefined"
[task 2023-01-26T10:04:55.102Z] 10:04:55 INFO - PID 9921 | console.error: (new TypeError("can't access property \\"timing\\", window.performance is undefined", "resource://devtools/server/actors/webconsole/listeners/document-events.js", 116))
[task 2023-01-26T10:04:55.102Z] 10:04:55 INFO - PID 9921 | console.error: "Failed to start [document-event] legacy listener for target server0.conn0.windowGlobalTarget2" (new Error("Protocol error (TypeError): can't access property \\"timing\\", window.performance is undefined from: server0.conn0.consoleActor4 (resource://devtools/server/actors/webconsole/listeners/document-events.js:116:18)", "resource://devtools/shared/protocol/Front.js", 383))
[task 2023-01-26T10:04:55.103Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Thread front is attached - "attached" == "attached"
[task 2023-01-26T10:04:55.103Z] 10:04:55 INFO - PID 9921 | Waiting for pause.
[task 2023-01-26T10:04:55.103Z] 10:04:55 INFO - (xpcshell/head.js) | test pending (2)
[task 2023-01-26T10:04:55.104Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - The grip has the proper class. - "DeadObject" === "DeadObject"
[task 2023-01-26T10:04:55.104Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Check preview presence. - true === true
[task 2023-01-26T10:04:55.105Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Check presence of own string properties. - false === false
[task 2023-01-26T10:04:55.105Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - The property does not exist. - "undefined" deepEqual "undefined"
[task 2023-01-26T10:04:55.106Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Check presence of own symbol properties. - false === false
[task 2023-01-26T10:04:55.107Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Got the right prototype type. - "null" deepEqual "null"
[task 2023-01-26T10:04:55.107Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Check presence of own string properties. - false === false
[task 2023-01-26T10:04:55.108Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - The property does not exist. - "undefined" deepEqual "undefined"
[task 2023-01-26T10:04:55.108Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Check presence of own string properties. - false === false
[task 2023-01-26T10:04:55.109Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - The property does not exist. - "undefined" deepEqual "undefined"
[task 2023-01-26T10:04:55.110Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Got the right property descriptor. - {"configurable":false,"writable":false,"enumerable":false,"value":"TypeError"} deepEqual {"configurable":false,"writable":false,"enumerable":false,"value":"TypeError"}
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Check presence of own symbol properties. - false === false
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Got the right symbol property descriptor. - {"configurable":false,"writable":false,"enumerable":false,"value":"TypeError"} deepEqual {"configurable":false,"writable":false,"enumerable":false,"value":"TypeError"}
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - TEST-PASS | devtools/server/tests/xpcshell/test_objectgrips-21.js | - Got the right prototype type. - "null" deepEqual "null"
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - PID 9921 | console.error: "Error while calling actor 'obj's method 'release'" "can't access property \\"isThreadLifetimePool\\", this.hooks is null"
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - PID 9921 | console.error: (new TypeError("can't access property \\"isThreadLifetimePool\\", this.hooks is null", "resource://devtools/server/actors/pause-scoped.js", 88))
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - Unexpected exception Error: Protocol error (TypeError): can't access property "isThreadLifetimePool", this.hooks is null from: server0.conn0.obj11 (resource://devtools/server/actors/pause-scoped.js:88:9) at resource://devtools/shared/protocol/Front.js:383
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - onPacket/<@resource://devtools/shared/protocol/Front.js:383:31
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - DevTools RDP*request@resource://devtools/shared/protocol/Front.js:300:14
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:47:19
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:76:19
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - test_unsafe_grips@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_objectgrips-21.js:280:23
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - enter@resource://devtools/server/actors/utils/event-loop.js:82:18
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - _pauseAndRespond@resource://devtools/server/actors/thread.js:970:29
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - onDebuggerStatement@resource://devtools/server/actors/thread.js:1915:17
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - stopMe@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_objectgrips-21.js line 215 > eval:2:7
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - @/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_objectgrips-21.js line 235 > eval:1:7
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - test_unsafe_grips/packet<@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_objectgrips-21.js:235:22
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - run@/builds/worker/workspace/build/tests/xpcshell/head.js:807:9
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - _do_main@/builds/worker/workspace/build/tests/xpcshell/head.js:238:6
[task 2023-01-26T10:04:55.113Z] 10:04:55 INFO - _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:585:5
[task 2023-01-26T10:04:55.114Z] 10:04:55 INFO - @-e:1:1
[task 2023-01-26T10:04:55.114Z] 10:04:55 INFO - exiting test
[task 2023-01-26T10:04:55.114Z] 10:04:55 INFO - <<<<<<<
[task 2023-01-26T10:04:55.114Z] 10:04:55 INFO - xpcshell return code: None
[task 2023-01-26T10:04:55.114Z] 10:04:55 INFO - devtools/server/tests/xpcshell/test_objectgrips-21.js | Process still running after test!
[task 2023-01-26T10:04:55.114Z] 10:04:55 INFO - TEST-START | netwerk/test/unit/test_http3_early_hint_listener.js
Updated•2 years ago
|
Updated•2 years ago
|
Comment 14•2 years ago
|
||
last version of the patch seems to have fixed the failures (https://treeherder.mozilla.org/jobs?repo=try&revision=3f41cf7f225f57d5a8ed514d28b118c05fb37e70)
Comment 15•2 years ago
|
||
Comment 16•2 years ago
|
||
bugherder |
Description
•