PERF004: large-view
View has more than max-components components
| Code | PERF004 |
| Name | large-view |
| Category | Performance (PERF) |
| Default severity | info |
| Enabled by default | no |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports a view with more than max-components components (the root
container included).
Why is this bad?
Section titled “Why is this bad?”Every component is a property tree on the gateway and a set of DOM elements in each session that shows the view. Very large views load slowly, use memory per session and are hard to change. Repeated parts are better as an embedded view or a flex repeater.
Example
Section titled “Example”A view with 600 labels and LEDs laid out by hand.
Use instead: one small view per repeated element, shown by a flex repeater over a list of parameters.
Options
Section titled “Options”max-components(default300): the largest allowed number of components.
Option reference
Section titled “Option reference”Set in [rules.PERF004] of iglint.toml (or [tool.iglint.rules.PERF004] in pyproject.toml).
| Option | Type | Default | Description |
|---|---|---|---|
max-components |
integer | 300 |
Largest allowed number of components in a view. |
Generated from the rule metadata by iglint generate-docs; iglint rule PERF004 prints the same page in the terminal. Source: docs/rules/PERF004.md.