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

Code snippets and helper functions #10

Open
xni7 opened this issue Jan 29, 2020 · 2 comments
Open

Code snippets and helper functions #10

xni7 opened this issue Jan 29, 2020 · 2 comments

Comments

@xni7
Copy link
Collaborator

xni7 commented Jan 29, 2020

Related to the Add-in issue:

  • code snippet for scaffolding tidymodules class object
  • helper functions like golem::add_module() to construct module classes.
  • integration with {golem}?
@m-l-1
Copy link
Collaborator

m-l-1 commented Feb 19, 2020

@xni7 I am tempted to do that temporary but that add_module function should definitely be added to the {golem} package when we reach CRAN.

@D3SL
Copy link

D3SL commented Aug 31, 2020

As someone who's tried to use golem before I'd recommend not making it mandatory. I could never get it to work even after pulling my hair out for a week even though there was nothing wrong with the app itself. Imho I can't see the use of it, if you're deploying an app at scale odds are your company already has an internal SVN or the like.

That aside tidymodules looks like exactly what I'd been hoping for. I've tried to brute force shiny into heavily interactive CRUD work and it's a nightmare, even if you modularize it still turns into a hairball with tons of ctrl+f between the UI and server sections.

If I understand things right then in the most basic use case all someone needs to define are: Class name, input port, output port, UI element, and server element. And of those the UI and Server elements are pretty much the code straight from your existing app.r only with the addition of updating the output port in the server element, right?

So it sounds like you could make a wrapper for building very basic modules that works basically like Shiny itself does:

makeTidyModule(

input=list(
          name = "seed",
          description = "random number seed",
          sample = 123
),

output= list(
          name = "number",
          description = "Random number",
          sample = 123
),

ui = function(){},

server=function(){}

)

Essentially an souped up version of glue to let people fill in the basic vital sections without being scared by the extra syntax of defining a class.

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

No branches or pull requests

3 participants