Skip to content

Modernise module snippet to moduleServer() + embed teaser gif (#13, #14)#16

Open
VincentGuyader wants to merge 5 commits into
masterfrom
fix/module-snippet-readme-gif
Open

Modernise module snippet to moduleServer() + embed teaser gif (#13, #14)#16
VincentGuyader wants to merge 5 commits into
masterfrom
fix/module-snippet-readme-gif

Conversation

@VincentGuyader

Copy link
Copy Markdown
Member

Summary

  • Change snippet for modules #14 — module snippet on moduleServer(): Shiny ≥ 1.5 deprecated callModule(). The module snippet now expands to a <name>_ui / <name>_server pair with the modern moduleServer(id, function(input, output, session) {...}) shape. README example aligned. The final tabstop ${0} lands inside the server body so users start typing the module logic right after expansion; ${2} is the UI insertion point.
  • we need to add the gif of "the best rstudio snippet ever" on the README #13 — README teaser: bundled man/figures/best_rstudio_snippet.gif and embedded it at the top of README.Rmd / README.md.

Test plan

  • tests/testthat/test-snippet.R: 5 PASS — verifies inst/snippets.txt references moduleServer, no longer references callModule, keeps the function(input, output, session) signature, and exposes ${0} inside the server body.

Closes #13
Closes #14

…ule (#14)

Shiny 1.5 introduced moduleServer() and deprecated callModule(). Update
the packaged snippet (and the README example) so newly-generated modules
use the supported API. Name the functions <name>_ui / <name>_server and
instantiate them with matching ids.

Adds a regression test asserting the snippet file contains moduleServer
and no longer references callModule.
The previous fix routed ${0} into the UI tagList. Users typing the
snippet expect to land in the server body to write the module logic.
Move ${0} there and use ${2} for the UI insertion point so the Tab
sequence is name -> ui body -> server body.
The previous workflow targeted R 3.6 on ubuntu-16.04 / windows-latest /
macOS-latest, used r-lib/actions@master and ran rcmdcheck with
error_on = 'warning'. ubuntu-16.04 is retired by GitHub Actions runners
and the macOS/windows R 3.6 binaries no longer install. Replace with
the standard r-lib/actions v2 template on ubuntu-latest, error-on
error only.
- actions/checkout v2 -> v4
- r-lib/actions/setup-r @master -> v2
- r-lib/actions/setup-pandoc @master -> v2
- actions/cache v1 -> v4
@VincentGuyader VincentGuyader self-assigned this Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change snippet for modules we need to add the gif of "the best rstudio snippet ever" on the README

1 participant