Skip to content

Refactor component_benchmark #37445

@wagnermaciel

Description

@wagnermaciel

Context

There are a few changes that need to be made to the component_benchmark macro. The

🚀 Desired changes

Relevant Package

This feature request is for @angular/dev-infra-private-builds

Change List

  • Asset injection
  • Better error handling
  • More nuanced static asset args

Describe the solution you'd like

Asset injection

This deals with the issue of providing a theme to a page. The components team would like to be able to provide a theme as a label to component_benchmark and have those styles be applied to the default index.html.

I will complete this description once I have a conversation with @devversion.

Better error handling

Currently there aren't any descriptive errors provided when component_benchmark is used improperly.

In particular, there is no explicit error message for when assets are provided without an index.html, which results in no index.html since the default one is provided as a default through the assets arg.

More nuanced static asset args

The way that static assets are provided can be improved upon by allowing more specific and commonly provided static assets to be their own args. Right now if you want to provide a single static asset you must also provide your own index.html and cannot use the default one.

Specifically, it would make sense to add an arg to separate index.html from assets.

Describe alternatives you've considered

Asset Injection

  • Use genrule to create styles.css so that you can use the transitive styles.css.
  • Provide a theme through a components stylesUrls and setting the component's view encapsulation to none.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: dev-infraIssues related to Angular's own dev infra (build, test, CI, releasing)refactoringIssue that involves refactoring or code-cleanup

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions