Add `yoga::Style::resolve()` for ahead-of-time computed whole style
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18.9k
- Forks
- 1.6k
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
What
We have different adhoc ways of resolving and caching from the user input style. These can often be repeated and expensive (e.g. for edge value resolution), and the APIs exposed for resolution are inconsistent.
We pass that computed style through yoga::calculateLayoutInternal, and try to remove cases where we pass a whole child Yoga node, to make it easier to reason that only layout results are being mutated.
Example
// Precomputes the full style, caching the last computed value for return
// if args match, and style not dirty
auto computedStyle = style.resolve({
.ownerWidth = ownerWidth,
.ownerHeight = ownerHeight,
.viewportWidth = viewportWidth,
.viewportHeight = viewportHeight,
});
References:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the proposed yoga::Style::resolve() API into yoga::calculateLayoutInternal and review the existing ad hoc style-resolution and caching paths. Done means a whole computed style can be resolved ahead of layout, with matching inputs and a clean style reusing the cached result while preserving layout behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100