-
Notifications
You must be signed in to change notification settings - Fork 58
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
Shiny API v2 - modern aliases for Shiny UI/output functions #1077
Draft
gadenbuie
wants to merge
24
commits into
main
Choose a base branch
from
feat/shiny-api-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
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.
Could bslib provide modern aliases for Shiny UI functions? This PR aims to answer that question by starting with aliases for Shiny functions that have also been ported to Shiny for Python, using naming conventions that are familiar to tidyverse users and consistent with the Shiny for Python API (these are generall well-aligned).
In addition to helping to nudge naming conventions away from camel case, this PR will also help give bslib some flexibility in providing its own implementations of these inputs. This will make it easier for bslib to eventually provide inputs tailored to specific Bootstrap versions or to provide alternate implementations that fix Shiny issues that are relevant to bslib but harder to address in Shiny directly.
To that last point, there are some deviations from core Shiny in this PR:
id
is used instead ofinputId
oroutputId
.session
is not the first argument of theupdate_*()
functions, instead it's the last....
are added in many places, generally following Shiny for Python's*
placement. This matches practical usage and makes it easier for us to adjust function signatures in the future.input_action_button()
andinput_action_link()
, making it possible to usebsicon::bs_icon()
and others.Remaining work:
App demo/test