- 
                Notifications
    You must be signed in to change notification settings 
- Fork 115
chore: Add instructions and guidelines for porting features from bslib #2107
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
base: main
Are you sure you want to change the base?
Conversation
For humans and LLMs!
        
          
                scripts/README-porting-from-bslib.md
              
                Outdated
          
        
      |  | ||
| Key patterns: | ||
| - `Tag` objects are immutable by default, use `copy.copy()` if you need to modify | ||
| - Use `tagAppendAttributes()` to add classes/attributes | 
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.
Should probably also add the __init__() based approach?
| - Use `tagAppendAttributes()` to add classes/attributes | |
| - Use `.add_class()`, `.add_style()`, `.attrs` to add CSS classes, styles, and HTML attributes | 
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.
Could you say more about what you mean by the __init__() based approach? (I'm on board with the suggested change, but that seems unrelated unless I'm missing a step.)
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 mean something like it should prefer div(class_ = "foo") to x = div() then x.add_class("foo")
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.
Great idea, thanks!
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
For humans and LLMs!
I used the recent
input_submit_textarea()PRs to seed these guidelines:input_submit_textarea()input element rstudio/bslib#1204input_submit_textarea()andupdate_submit_textarea()#2099