angular/devtools
Andres Olivares d26a91fddc refactor(devtools): Use Chrome DevTools Performance extension API (#55805)
This change is a proof of concept of how the new Chrome DevTools
Performance extension API (https://bit.ly/rpp-e11y) can be used to
surface Angular runtime data directly in the Chrome DevTools Performance
panel.

Specifically, it implements the following changes:

1. Use the profiling status notification API to toggle the Timing API:
The notification API is implemented under the
chrome.devtools.performance extension namespace and consits of two
events: ProfilingStarted and ProfilingStopped, dispatched when the
Performance panel has started and stopped recording, respectively. This
API is used to enable the Timings API when the recording has started in
the Performance panel and disable it when recording has stopped.

2. Use the User Timings `detail` field format specification of the
Performance extension API
(https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/User_timing)
to inject data collected by the Angular Profiler into the
Performance panel timeline. Angular Profiler uses several hooks to
measure framework tasks like change detection. With this change, this
measurements are visible in the same context as the runtime data
collected by the browser in the Performance Panel timeline.

Note: to enable the user timings to be collected in the first place, one
needs to open the Angular DevTools panel so that the related artifacts
are loaded in the page. This shortcoming can be fixed in a follow up so
that the extra step isn't necessary.

PR Close #55805
2024-07-31 16:04:52 +00:00
..
cypress refactor(devtools): migrate devtools to prettier formatting (#53945) 2024-01-19 19:09:54 +01:00
docs docs(devtools): update README to be more clear for extension reviewers (#55406) 2024-04-23 13:02:49 -07:00
projects refactor(devtools): Use Chrome DevTools Performance extension API (#55805) 2024-07-31 16:04:52 +00:00
src refactor(devtools): remove git sha stamping from devtools build (#55694) 2024-05-06 16:02:36 -07:00
tools fix(devtools): issue where backendReady race condition causes Angular not detected error (#54805) 2024-03-26 09:19:06 -07:00
.gitignore refactor(devtools): prepare codebase for migration to angular/angular repo 2021-11-21 20:23:18 -05:00
BUILD.bazel refactor(devtools): consolidate devtools global styles into 1 file (#49001) 2023-02-14 20:25:23 +01:00
cypress.json refactor(devtools): bring the angular devtools directory into the root bazel workspace 2022-01-26 16:35:31 -05:00
packages.bzl refactor(devtools): bring the angular devtools directory into the root bazel workspace 2022-01-26 16:35:31 -05:00
README.md docs(devtools): update README to be more clear for extension reviewers (#55406) 2024-04-23 13:02:49 -07:00
styles.scss refactor(devtools): use dark scrollbars in dark mode (#56225) 2024-06-10 13:55:43 -07:00
tsconfig.json fix(devtools): issue where backendReady race condition causes Angular not detected error (#54805) 2024-03-26 09:19:06 -07:00
tsconfig.spec.json fix(devtools): issue where backendReady race condition causes Angular not detected error (#54805) 2024-03-26 09:19:06 -07:00
tslint.json build(devtools): disable the "Rebase PR on target branch" circleci job so that the PR that merges the unrelated history of rangle/angular-devtools can be successfully merged into angular/angular 2022-01-26 16:35:30 -05:00

Angular DevTools

Angular DevTools is a browser DevTools extension for debugging and profiling Angular applications.

Developing Locally

Set up

Follow the instructions below to set up your Angular DevTools development environment. Note that all commands should be executed in the repository root, not devtools/. All file paths are also relative to the repository root.

Debian Linux, MacOS, and Windows via WSL should build successfully. Building natively on Windows without WSL is not supported at the moment.

To set up your development environment, first install the correct version of Node. If you have nvm set up, this can be done with:

nvm install

Second, install Yarn:

npm install -g yarn@1

Third, install NPM dependencies:

yarn --frozen-lockfile

Now you should be ready to build the DevTools extension.

Dev builds

To run the extension in development mode run:

yarn devtools:devserver

You can also run a standalone version of the demo app with:

yarn devtools:devserver:demo-standalone

This would start a development server that you can access on http://localhost:4200. In development, Angular DevTools uses a "development shell." This is different from "chrome shell" in a way, that it runs the user's app in an iframe. DevTools then communicate with the user's app via message passing.

Release builds

You can build the release version of Angular DevTools for either Chrome or Firefox with:

yarn devtools:build:chrome
yarn devtools:build:firefox

Either way, the built extension will be at dist/bin/devtools/projects/shell-browser/src/prodapp.

Installation

For Chrome, you can install the extension from dist/bin/devtools/projects/shell-browser/src/prodapp by following the guide from here.

For Firefox, to load the extension, you can go to the about:debugging page, click the "This Firefox" option and then click the Load Temporary Add-on button. You'll have to select the manifest file in dist/bin/devtools/projects/shell-browser/src/prodapp directly.