-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Question]: Support in shinyframewroks vscode extension #1455
Comments
I like the idea @davidrsch. All resources are in teal's documentation page. There are links which might redirect you to other related packages. What do you envision? Sort of a visual manager or providing code snippets/suggestions? |
The extension functions as a visual manager, making it easy (just two or three clicks) for developers to perform actions like creating an app, adding modules, or executing certain features. From the examples I’ve seen, teal apps are often contained within a single app.R file, which requires in-file modifications—a functionality I haven’t implemented yet. It would be extremely helpful if you could clarify what each action should do or point me to any existing functionality that achieves a similar result:
|
To create a teal app you need to have a list of modules you'd like to use within an app. Probably you don't want to "Create a module" but "add a module" from some list. To create a module, you'd need to write ui and server functions just like you do with normal shiny module. This is why I think you prefer to start with "add a module" to include for example |
Do you, by any chance, have defined standards for organizing teal apps in a modularized format using multiple files? Something similar to:
With this structure, the "Create App" functionality would generate the folder layout and initial files, while "Add Module" would create a new module_X.R file inside the app/modules/ directory. If no such standard exists, I think the example shown in the teal module documentation could be a good starting point to define the features for adding modules and structuring apps. |
@davidrsch This is an interesting idea worth consideration (to have an teal::init function based on the files structure). Teal limitation doesn't stop you from building teal::init(
data = source("data.R"),
modules = source("modules.R"),
filter = source("filter.R")
) |> shiny::runApp()
Where library(teal.code)
teal_data() |> eval_code(readLines("path/to/script/with/data.R"))
do.call(
teal::modules,
lapply(list.files(path = "modules/", pattern = "\\.R$"), source) # file is expected to return a module
) |
If it’s okay with you, for now, I’ll proceed with implementing the functionalities using the single-file approach. The goal of the extension is to assist Shiny developers in working with the framework while adhering to the current standards, making it useful for both new and experienced users who may be more familiar with this format. If, after consideration, you decide to introduce standards for a multiple-file structure, I’d be happy to update the extension to support it. |
Example content for the
Any suggestions to make it more comprehensive are welcome! |
What is your question?
Hello,
I am working on a VSCode extension that aims to bring some of the capabilities of RStudio addins to Shiny developers using VSCode and Positron. You can check it out on the repository, VSCode Marketplace, and Open VSX Registry.
The extension currently supports several R frameworks:
I would like to expand support to include teal, leprechaun, and some Python frameworks like tapyr. If you know of any other frameworks that should be added, please let me know!
Regarding teal, I haven’t worked with this framework before, so your help would be greatly appreciated. The extension offers three main features: "Create App", "Create Module", and "Addins". It would be helpful if you could point me to resources or documentation on how to implement "Create App" and "Create Module" for this framework, and share any suggestions on which features should be included under "Addins".
Thank you for your time and assistance!
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: