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

Vignette: shiny as a module #1467

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Vignette: shiny as a module #1467

wants to merge 4 commits into from

Conversation

gogonzo
Copy link
Contributor

@gogonzo gogonzo commented Jan 29, 2025

closes #1450

@gogonzo gogonzo added the core label Jan 29, 2025
Copy link
Contributor

github-actions bot commented Jan 29, 2025

Unit Tests Summary

  1 files   28 suites   11m 6s ⏱️
278 tests 274 ✅ 4 💤 0 ❌
540 runs  536 ✅ 4 💤 0 ❌

Results for commit 58bd91d.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jan 29, 2025

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
module_teal 💔 $129.70$ $+10.23$ $0$ $0$ $0$ $0$
shinytest2-data_summary 💔 $50.83$ $+4.35$ $0$ $0$ $0$ $0$
shinytest2-decorators 💔 $22.86$ $+1.08$ $0$ $0$ $0$ $0$
shinytest2-filter_panel 💔 $41.63$ $+2.03$ $0$ $0$ $0$ $0$
shinytest2-init 💔 $28.19$ $+1.66$ $0$ $0$ $0$ $0$
shinytest2-landing_popup 💔 $46.06$ $+2.16$ $0$ $0$ $0$ $0$
shinytest2-module_bookmark_manager 💔 $36.31$ $+2.47$ $0$ $0$ $0$ $0$
shinytest2-modules 💔 $39.32$ $+1.94$ $0$ $0$ $0$ $0$
shinytest2-reporter 💔 $66.68$ $+2.54$ $0$ $0$ $0$ $0$

Results for commit 462e434

♻️ This comment has been updated with latest results.

Copy link
Contributor

@llrs-roche llrs-roche left a comment

Choose a reason for hiding this comment

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

Looks good some minor comments about wording. Feel free to ignore

vignettes/getting-started-with-teal.Rmd Outdated Show resolved Hide resolved
R/module_session_info.R Outdated Show resolved Hide resolved
vignettes/teal-as-a-module.Rmd Outdated Show resolved Hide resolved
vignettes/teal-as-a-module.Rmd Outdated Show resolved Hide resolved
if (interactive()) {
shinyApp(ui_app, srv_app)
}
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps a final comment on the example would be good. Like describing the differences with a pure teal app from the final end user (or for the app developer: would it work without teal_data() ? )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

describing the differences with a pure teal app from the final end user

What do you mean? Isn't "Unlike init(), this module will not automatically include session info footer" enough?

would it work without teal_data()

No it wouldn't. But what do you think I should add? data, modules and filter arguments are well documented in module_teal.

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean? Isn't "Unlike init(), this module will not automatically include session info footer" enough?

For example, when I created this app, the left panel was not there, this is evident for us but it might not be so for new users or app developers that might not know how it works. I usually struggle with vignettes that don't lower the level and assume the user already knows the package.

would it work without teal_data()

No it wouldn't. But what do you think I should add? data, modules and filter arguments are well documented in module_teal.

The idea behind vignettes in my opinion are to serve as introduction to the user. If this is documented on module_teal we can mention this to redirect the users to the detailed documentation of the function or to other vignettes.

My personal preference is to provide extra guidance than assume the user already knows something and not following through the vignette. But it is hard to set the level required for a vignette. Please feel free to resolve this conversation

Example below shows how to use the Teal module in Shiny app. In the example `srv_teal()` is called with the dynamic
data created in the server of the parent app.

```{r setup}
Copy link
Contributor

@donyunardi donyunardi Jan 29, 2025

Choose a reason for hiding this comment

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

Suggested change
```{r setup}
```{r setup, message = FALSE}

We got message in the vignettes when the library is loaded:
image

Let's hide these messages.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is better to use: suppressPackageStartupMessages(library("teal")) as it makes it evident to the user that there will be some messages on loading the library (and are not caught off guard if the messages appear when on the vignette there are none).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have an opinion about what is better, but if you believe so I probably should change all library(teal) in the package's vignettes.

Copy link
Contributor

@llrs-roche llrs-roche Jan 30, 2025

Choose a reason for hiding this comment

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

I mean for me it is not super critical. On the other side sometimes people is surprised when a certain function appears on their namespace or it is masked by a new loaded package.

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

Successfully merging this pull request may close these issues.

Create Vignette for teal as a module
3 participants