-
-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add basic infrastructure for a Context API [PROPOSAL][WIP] #3409
base: main
Are you sure you want to change the base?
Conversation
3448ae5
to
a6631d3
Compare
Looking good. API wise it is good enough as an approach that it is not a breaking change. It seems specific to the render phase, so I would add user-friendly error messages for when users try to access the context outside of render. |
@renancaraujo agree with both! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just like some benchmark of the implication of adding this, other than that I think it looks good!
Benchmark ResultsPackage flame:
Benchmarks provided with 💙 by Dart Benchmark Action. |
(note: I will add a bench specifically about rendering when I have some time. this was just testing the waters with the action) |
Description
The idea is to provide some sort of "context" API for components to share render-time information with indirect descendants.
Use cases can include:
currentCamera
value which is currently handled as a global listPending some benchmarking to confirm it does not increase latency but requesting for comments on the proposed API.
Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?