-
Notifications
You must be signed in to change notification settings - Fork 4
Features & Brainstorming #4
Comments
One of the goals of this issue is to come up with a backlog of tasks which could be done: Things to watch out for
General
Changes to Dojo core modules
Widget Tree + Properties Pane
Performance
Stores
Event Log
|
How is the widget tree rendered?In the interest of documentation and knolwedge sharing, here is my understanding of how the Widget tree (the Dojo 2 DevTools version of the Elements Panel) works end to end in the current implementation. Warning: The current implementation requires the inspectable app to make source code changes, hopefully the knowledge here can take us on a clearer path to avoid having to do that. Overview: The widget tree renders a visual tree-like overview of the rendered VDOM structure. There are three parts to making it work:
It starts from this line of code which the DevTools extension invokes on the inspected page: To make all of this work, the sample app must import the modified First, hooks are put into the code The key part here is The property value is an array of rendered nodes (nodes which were actually rendered into the DOM). Going back to the hooks, they And is what makes This serialization process 'prepares' the rendered DOM into something which can be visually displayed. For example, instead of the object property Now that we've seen how Note: the remaining explanations from this point on applies to any Dojo 2 app which uses State management is set up in the usual way, and this property is exposed to the 💡 Tip:
w(VDom, {
root
}); That VDom widget contains a render implementation like this Lines 90 to 93 in 1fd6c0f
and constructs the necessary widget tree you can see within the extension. |
Learnings from other DevTools ExtensionsReact DevToolsDetails
Page ActionsWhile a DevTools extensions can only appear within the DevTools, it's possible to apply some behaviour to your the extension button next to the browser address bar. The React DevTools highlights red when it detects the current webpage is using an inspectable version of React. The Dojo 2 DevTools extension can follow the same behaviour. The main feature of the React DevTools is a component/widget/element inspector: It closely resembles the native built-in DevTools element inspector. Features include:
This option, when enabled, displays an outline around DOM elements which have updated/rendered during the page lifecycle. The Dojo team have expressed this is a useful feature.
This allows you to paste and execute the function into your console panel. The binding is maintained.
Vue DevToolsDetails
The Vue DevTools extension has a sensible interface and a good UX/DX. Large buttons with lots of spacing, it's all responsive too. Similar to React, it uses page actions to inform you if the current page is inspectable:
This feature requires code changes and is documented here
So when you Right Click on a webpage, you have the option to inspect the Vue component with the Vue DevTools. This is done via the
Couldn't get this feature to work. More Vue DevTools features are shown here: https://medium.com/the-vue-point/whats-new-in-vue-devtools-4-0-9361e75e05d0
Angular DevTools (Named AngularJS Batarang)Details
Angular DevTools had a slightly unintuitive interface + UX.
It provides, what appeared to be, best practice suggestions for application source code which uses Angular.
It shows various lifecycle events with timing information. Ember DevTools (Named Ember Inspector)Details
The Ember DevTools is very feature rich:
So you can see registered and active routes, but also the templates + controllers associated with routes.
It shows rendering events and their timing durations for the application. Kuker DevToolsDetailsKuker works differently, it is a single DevTools frontend for React, Angular, Vue & Vuex, Redux, redux-saga, HTML, Stent, Machina.js, MobX. It's still a Chrome Extension which is part of the DevTools, but it relies on certain application instrumentation As there isn't really a unified way of building a widget/component inspector + corresponding properties pane, various framework developers tend to create their own DevTools, and this project seems help standardise on this. |
Kuker is really just a postMessage message viewer. It looks for the messages to have the property "kuker" set to If you install the Kuker extension, you can see it in action here. I fear Kuker does not have the features we want. We are looking to help the user map the virtual DOM to the DOM and the themes to the actual CSS and right now, I don't see a way to make Kuker do those things. Kuker has a nifty utility function. To use Kuker, your application has to act as what it calls an "emitter" to produce messages that the devtool can receive. In the kuker-emitters, there is a nifty utility function that makes it easy to create an emitter that will work in both a browser and in a Node.js application: https://github.com/krasimir/kuker-emitters/blob/master/src/helpers/createMessenger.js |
I like the idea of using |
That is something which is missing in the other frameworks integrations and it is added to my todo list. Probably will be standardized as a command from the extension to the page. The input of this command should be provided by the emitter in the form of a selector. |
As per dojo/meta#227 - this GitHub issue presents the research made on a Dojo 2 DevTools extension.
This thread specifies the following:
The text was updated successfully, but these errors were encountered: