golem icon indicating copy to clipboard operation
golem copied to clipboard

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

Open ilyaZar opened this issue 2 years ago • 2 comments

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 avatar Mar 24 '23 17:03 ilyaZar

That sounds basically like TidyModules

D3SL avatar Jun 20 '23 14:06 D3SL

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.

ilyaZar avatar Jun 21 '23 07:06 ilyaZar

Done via 5cefbab

ColinFay avatar Aug 08 '24 05:08 ColinFay