firefox-devtools / firefox-devtools/profiler
In the marker schema, support label templates with conditional behavior depending on whether a field is present
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
We have custom code for the FileIO marker's `tableLabel`:
https://github.com/firefox-devtools/profiler/blob/c1957108f1570a4c4eae498de5a5e8bf9ff2cd7d/src/profile-logic/marker-schema.js#L307-L315
Mostly what's happening is that some fields are optional, and those fields shouldn't be surrounded by brackets or separated by spaces or dashes if they're not present.
It would be nice if we could achieve the same result with some extensions to the label template syntax.
A similar request was made in the past by @fqueze, when he wanted to share the same schema for these two markers, to reduce code duplication at the schema declaration: https://share.firefox.dev/4fWgc0B
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-861)
Contributor guide
Assessment
This issue has not been assessed yet.