Intelligently deduplicating rules for function values
Open
complexity:high
enhancement
idea
- Dominant language
- JavaScript
- Stars
- 7.1k
- Forks
- 386
- PR merge metrics
- No merged PRs in 30d
Description
In case where a property `{width: () => 10}` is used for many elements, we currently generate many rules, despite the fact that the value is always the same. We can optimize that.
```js
// Lets say we have rule "a" and rule "b"
// Their initial value is the same.
a.width = 10
b.width = 10
// We can generate one rule and use both classes:
.a, .b {
width: 10
}
// Now "b" changes:
b.width = 20
// We remove the class "b" from the initial rule:
.a {
width: 10
}
// We create a new rule with the new value for b:
.b {
width: 20
}
Contributor guide
Assessment
This issue has not been assessed yet.