Skip to content

Conversation

@wch
Copy link
Collaborator

@wch wch commented Feb 1, 2022

  • ShinySession -> Session
  • ShinyApp -> App
  • reactives submodule -> reactive
  • Move UI components to ui_toolkit submodule
  • ReactiveVal -> shiny.reactive.Value
  • ReactiveValues -> shiny.reactive.Values
  • input["x"] -> input.x (and can still use input["x"])
  • input.x -> input.x()
  • Add input and output to server function
  • output("foo") -> output() (infer name from def foo)
  • Add render_text
  • Always require render function for output()
  • observe -> shiny.reactive.effect ?
  • reactive -> shiny.reactive.calc ?
  • Rename reactive.Values to shiny.session.Inputs (and also export as shiny.inputs)

Stuff for the future, in other PRs:

  • Add support for if "n" not in input: and maybe if not input.n:
  • Make Inputs read-only.
  • Figure out good pattern for declaring types for Inputs. Maybe class MyInputs(Inputs):?
  • Add class for input IDs, so that ns() isn't necessary?
  • Move render_* functions to render. submodule?
  • Magically type input IDs?

I've also updated the example myapp to reflect the new API: https://github.com/rstudio/prism/blob/api-change/examples/myapp/app.py
(Before merging, I'll update all examples.)

@session.output("plot")
@render_plot(alt="A histogram")
@output("plot")
@shiny.render_plot(alt="A histogram")
Copy link
Collaborator

@cpsievert cpsievert Feb 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels slightly verbose/inconsistent to me, perhaps it could be @render.plot(...)?

@wch wch marked this pull request as ready for review February 3, 2022 01:13
@wch wch merged commit d344306 into main Feb 3, 2022
@wch wch deleted the api-change branch February 3, 2022 22:38
@wch wch mentioned this pull request Feb 4, 2022
@cpsievert cpsievert mentioned this pull request Feb 9, 2022
4 tasks
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

Successfully merging this pull request may close these issues.

3 participants