Skip to content
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

register_widget() should be deprecated #127

Open
schloerke opened this issue Jan 10, 2024 · 0 comments
Open

register_widget() should be deprecated #127

schloerke opened this issue Jan 10, 2024 · 0 comments

Comments

@schloerke
Copy link
Collaborator

Given #119, register_widget() does not follow the Shiny rendering pattern.

Current (inside server body):

    map = create_map(layout=ipywidgets.Layout(width="100%", height="100%"))
    map_widget = register_widget("map", map)
    map_widget # do stuff

Proposed:

    map_val = create_map(layout=ipywidgets.Layout(width="100%", height="100%"))

    @render_widget
    def map():
        return map_val

	map.widget # do stuff

While the Current approach is tighter and requires less lines, calling a register method doesn't tell me that it's going to be rendered to the UI.

With more render methods with full typing in the near future, I'd recommend that register_widget be deprecated in favor of the standard Shiny approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant