Files
TheRock/rocm-systems/projects/rocprofiler-sdk/external/perfetto/docs/contributing/ui-development.md
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

2.3 KiB

UI development

Some tips to get started with the UI development:

Development environment

If you're looking for an IDE to write the TypeScript code, Visual Studio Code works well out of the box. WebStorm or IntelliJ Idea Ultimate (Community does not have JavaScript/TypeScript support) also work really well. The code is located in the ui folder.

Working with devserver

See Build Instructions page for the details about starting the local development server.

The devserver has a live reload functionality: once you make a change in TypeScript files, the resulting code will be recompiled and the page is going to reload automatically. By default, this logic uses a timeout in order to prevent successive reloads on rapid changes. This logic can be disabled via development-only "Rapid live reload" flag in the UI. Disabling it will reload the page earlier, at the cost of sometimes making multiple reloads in a row.

Mithril components

Perfetto UI uses the Mithril library for rendering the interface. The majority of the components in the codebase use class components. When Mithril is imported via m alias (as it is usually done in the codebase), the class component should extend m.ClassComponent, which has an optional generic parameter allowing the component to take inputs. The entry point of class components is a view method, returning a tree of virtual DOM elements to be rendered when the component is present on the page.

Component state

Local state of components can reside in class members and accessed directly in methods via accessing this. State that is shared across different components is stored in the State class definition, and should be modified via implementing a new action in src/common/actions.ts. A new field added to State should be initialized in src/common/empty_state.ts.

There are restrictions on whan can be used in the global state: plain JS objects are OK, but class instances are not (this limitation is due to state serialization: the state should be a valid JSON object). If storing class instances (like Map and Set data structures) is necessary, these can be stored in the NonSerializableState portion of the state, that is omitted from saving into JSON objects.