-
Notifications
You must be signed in to change notification settings - Fork 99
Use a renderer generator to create sync/async render methods with full typing #621
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… to be used as a decorator
…d to `value_fn(meta=)`
* main: Add E2E tests for accordion and autoresize (#601) Add card test (#622) Add sidebar test (#631) Make card fullscreen icon a tooltip (#632) Pull in changes from rstudio/bslib#697 and rstudio/bslib#699 Changelog tweak. Followup to #629 Add experimental tooltip methods and example apps (#629) Use `blib::bs_theme(5,"shiny")` for py-shiny theme (#624) Rename shiny/examples to shiny/api-examples (and X/examples to X/api-examples) (#627) Make --app-path work with app file argument (#598) Don't eval example code block Fix example code blocks (#626) Annotation export example (#584) Add todo list example (#603)
…or better control
…lass and verify that the render fn was called
…erloaded method renaming to work
…ke overloads manually Before, one of the overloads was being made with input type `P`. This expands to `(*P.args, **P.kwargs) -> ...`. Given our restrictions, `P.args` is equal to `*` and therefore is not in the function signature. However, we need `*` to be there to allow for `_fn` to be passed in the other overloads. In the case of `text` renderer, the function was being defined as a `Callable` whose args where `P`. This evaluated to no arguments. As a decorator, it needs to accept an argument of the function. This is incompatible. However, with overloads, the overloaded functions can not really agree with each other as long as they agree with the base method. This allows us to "define" a dedorator who does not take an argument. I find the function name to be too important to give up. Pursuing returning types and the renderer function for users to make overloads manually.
wch
requested changes
Aug 2, 2023
wch
requested changes
Aug 7, 2023
Also move `RenderFunction` methods into `shiny.render._deprecated`
…sted value fn to renderers
…]`); Expose `render_value_fn(value_fn)`
wch
approved these changes
Aug 10, 2023
Co-authored-by: Winston Chang <[email protected]>
schloerke
added a commit
that referenced
this pull request
Aug 10, 2023
* main: (26 commits) Use a renderer generator to create sync/async render methods with full typing (#621) docs: Add Tooltip section in experimental (#673) Bump version to 0.5.1 Add missing sidebar stylesheet dep (#667) GitHub action cleanup (#662) Add a triage label to issues created by non-maintainers (#647) Bump version to 0.5.0.9000 Model score example (#650) Fix malformed changelog entry Update CHANGELOG.md for data frame filters (#654) Bump version to 0.5.0 Allow ui.update_slider to handle non-numeric values (#649) Add updated path to examples (#645) Bump griffe version Update README Fix jumpy cursor in numeric filter (#640) Build API docs (#633) Pyright: ignore docs dir Filtering feature for data grid/table (#592) Add E2E tests for accordion and autoresize (#601) ...
schloerke
added a commit
that referenced
this pull request
Aug 10, 2023
* main: (40 commits) Use a renderer generator to create sync/async render methods with full typing (#621) docs: Add Tooltip section in experimental (#673) Bump version to 0.5.1 Add missing sidebar stylesheet dep (#667) GitHub action cleanup (#662) Add a triage label to issues created by non-maintainers (#647) Bump version to 0.5.0.9000 Model score example (#650) Fix malformed changelog entry Update CHANGELOG.md for data frame filters (#654) Bump version to 0.5.0 Allow ui.update_slider to handle non-numeric values (#649) Add updated path to examples (#645) Bump griffe version Update README Fix jumpy cursor in numeric filter (#640) Build API docs (#633) Pyright: ignore docs dir Filtering feature for data grid/table (#592) Add E2E tests for accordion and autoresize (#601) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A renderer author can now supply a value that will render a value (
value_fn
) given the result of the user.Example given
render.text
:Previous definition for
render.text
(w/ docs removed for fair comparison)Render methods converted:
text
plot
image
table
ui
Questions
render.plot()
... Plot variable calls are afterself._fn()
has been called. Is this ok? (Previously they were before)@overload
ed function name?Ex renderer used in testing:
With expectations: