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

As a dev, I want to create template files for R6 classes [FR] #1008

Open
ilyaZar opened this issue Mar 24, 2023 · 2 comments
Open

As a dev, I want to create template files for R6 classes [FR] #1008

ilyaZar opened this issue Mar 24, 2023 · 2 comments
Labels
enhancement New feature or request WIP 🏃‍♀️

Comments

@ilyaZar
Copy link
Contributor

ilyaZar commented Mar 24, 2023

Quick helper in the spirit of add_XXX
Create R6 boilerplate in a new file

Describe the solution you'd like
add_r6() with same interface as add_fct() and add_utils

R6 comes with shiny and is thus already a dependency for golem, so the feature does not need "real" additional dependencies.

The overall usefulness though is difficult to asses for me, it would certainly be beneficial when creating R6 classes for exchanging data between modules.

@ilyaZar ilyaZar added the enhancement New feature or request label Mar 24, 2023
ilyaZar added a commit to ilyaZar/golem that referenced this issue Mar 24, 2023
Works exactly the same as add_fct() and add_utils().

- add argument 'r6' to add_module()
- add add_r6() helper function calling add_r_files with slightly different parameters
- adjust append_roxygen_comment() to create R6 template
- add man files and NAMESPACE exports
ilyaZar added a commit to ilyaZar/golem that referenced this issue May 25, 2023
Works exactly the same as add_fct() and add_utils().

- add argument 'r6' to add_module()
- add add_r6() helper function calling add_r_files with slightly different parameters
- adjust append_roxygen_comment() to create R6 template
- add man files and NAMESPACE exports
@D3SL
Copy link

D3SL commented Jun 20, 2023

That sounds basically like TidyModules

@ilyaZar
Copy link
Contributor Author

ilyaZar commented Jun 21, 2023

hi @D3SL I think tidymodules is more of a framework that suggests a specific style for usining R6 and (adjusted) modules when developing shiny apps.

Sometimes using basic R6 classes (without a fully fledged framework) can have merit on its own. For example, this is suggested in https://engineering-shiny.org/common-app-caveats.html?q=r6#using-r6-as-data-storage and https://youtu.be/fo4eiwGE6bw as a useful development pattern in some cases.

Thus, this FR only asks for a quick boilerplate generator in the style of the already available add_module() or add_function() to help users to speed things up whenever they frequently make use of R6.

ColinFay pushed a commit that referenced this issue Nov 17, 2023
Works exactly the same as add_fct() and add_utils().

- add argument 'r6' to add_module()
- add add_r6() helper function calling add_r_files with slightly different parameters
- adjust append_roxygen_comment() to create R6 template
- add man files and NAMESPACE exports
ColinFay pushed a commit that referenced this issue Nov 17, 2023
Works exactly the same as add_fct() and add_utils().

- add argument 'r6' to add_module()
- add add_r6() helper function calling add_r_files with slightly different parameters
- adjust append_roxygen_comment() to create R6 template
- add man files and NAMESPACE exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WIP 🏃‍♀️
Projects
None yet
Development

No branches or pull requests

3 participants