angular/devtools/projects/protocol
hawkgs b5fc949840 fix(devtools): MessageBus.on return type (#62898)
It appears that the intent is to return an unlisten function when `on` is called. The message bus implementations indicate that. However, the `MessageBus` abstract class returns `void` instead.

Change to `on: () => void`.

PR Close #62898
2025-07-31 09:16:15 +00:00
..
src fix(devtools): MessageBus.on return type (#62898) 2025-07-31 09:16:15 +00:00
BUILD.bazel build: remove ts_project_interop infrastructure (#62908) 2025-07-31 09:12:58 +00:00
index.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
README.md docs: update the Angular DevTools auto-generated READMEs (#45884) 2022-05-05 15:29:27 -07:00
tslint.json refactor(devtools): prepare codebase for migration to angular/angular repo 2021-11-21 20:23:18 -05:00

Angular DevTools Communication Protocol

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.

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

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.

An example is:

  1. We request the state of the component tree
  2. We update the state
  3. We request the state of the properties of a particular component

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.