linkedin / linkedin/css-blocks
elision of state
- Dominant language
- TypeScript
- Stars
- 6.3k
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
Many states are static within a template and are used to select a display mode for a given component. In these situations we can statically resolve the selectors during optimization to a single unscoped class that can be merged with other declarations at the global level. Note this is only worth doing if all uses of the root-level state are static. if there's a dynamic use in any location, then there's no point in performing the optimization.
To do this, we have to record what classes and states are applied dynamically during template analysis.
it's possible this can be done by the css-blocks compiler by outputting a class that resolves against other classes/states that the specificity would normally resolve or perhaps this can be done purely by the optimizer.
Contributor guide
Research direction
The issue names no files or tests. Start by tracing template analysis and the optimizer, then compare whether the css-blocks compiler or optimizer should record dynamically applied classes and states. Done means static root-level states can be resolved and merged only when all uses are static, while dynamic uses remain unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, typescript
- Domain
- compilers, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100