Modernise module snippet to moduleServer() + embed teaser gif (#13, #14)#16
Open
VincentGuyader wants to merge 5 commits into
Open
Modernise module snippet to moduleServer() + embed teaser gif (#13, #14)#16VincentGuyader wants to merge 5 commits into
VincentGuyader wants to merge 5 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
moduleServer(): Shiny ≥ 1.5 deprecatedcallModule(). Themodulesnippet now expands to a<name>_ui/<name>_serverpair with the modernmoduleServer(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.man/figures/best_rstudio_snippet.gifand embedded it at the top ofREADME.Rmd/README.md.Test plan
tests/testthat/test-snippet.R: 5 PASS — verifiesinst/snippets.txtreferencesmoduleServer, no longer referencescallModule, keeps thefunction(input, output, session)signature, and exposes${0}inside the server body.Closes #13
Closes #14