angular/devtools/projects/protocol/README.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
1.1 KiB
Markdown
Raw Normal View History

# Angular DevTools Communication Protocol
2020-01-27 18:40:18 +00:00
Angular DevTools injects scripts in the user application page that interact with the framework debugging APIs. The injected scripts interact with the extension via message passing using a statically typed protocol.
2020-01-27 18:40:18 +00:00
This subdirectory contains:
- Declaration of a statically typed message bus
- Implementation of priority aware message bus
- Interfaces that declare the messages exchanged between the extension and the page
2020-01-27 18:40:18 +00:00
We use the `PriorityAwareMessageBus` to ensure that certain messages have higher priority than others. Because of the asynchronous nature of the property exchange there's a risk that a message response may overwrite the result from a more recent response.
2020-01-27 18:40:18 +00:00
An example is:
1. We request the state of the component tree
1. We update the state
1. We request the state of the properties of a particular component
2020-01-27 18:40:18 +00:00
We don't have guarantees that the response of 1. will arrive before the response of 3. Often the response of 1. is larger and might be delivered after 3. In such a case, it may contain the application state prior to the update and override the state update we received from 3.