-
-
Notifications
You must be signed in to change notification settings - Fork 978
feat: Add a Render Context API #3409
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
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) |
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.
Merge eet
512a6b4
to
2d808ae
Compare
4ed136b
to
098dc20
Compare
@renancaraujo I changed the name - but any idea how I could add a message if |
I think this is something we can handle by docs instead. So that we mention in both the dartdocs and the docs on the site that it should only be called from within the render-loop. I doubt many end-users will use the render context directly anyways? |
@spydon agreed. all concerns addressed, should we merge then? |
🚢-eeeeet!! |
Description
This provides a "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 listChecklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?