Changelog
stackcallr 0.3.0
New features
-
call_tree_dir()reads R6 classes. Each method is a node namedClass$method, withinitializeshown asClass$new.Class$new(),self$m(),private$m(),super$m(), andx$m()on a localx <- Class$new()are followed. Methods can be roots (root = "ModInputs$ui"). Withmodules_only, a class whose methods callNS()ormoduleServer()counts as a module.
stackcallr 0.2.1
Bug fixes
-
call_tree_dir()andcall_tree_app()no longer draw an edge when a parameter or local variable shares a function’s name. Infunction(savings_rate) income * savings_rate, the baresavings_raterefers to the argument, not thesavings_rate()function. Calls in call position (savings_rate()) still count.
stackcallr 0.2.0
New features
call_tree_dir()andcall_tree_app()gainmax_depth(levels shown belowroot),prune(drop a function and its whole subtree, without splicing its children up), andkeep(regular expressions; keep matching functions with their subtrees plus the path fromrootto them).call_tree_dir()gainsinclude_ns: calls to functions exported by the named packages are shown as nodes, nested as written, soshinyApp(ui = app_ui, server = app_server)puts both functions undershinyApp.call_tree_dir()gainsinclude_defaults: whenTRUE, calls in default argument values (function(dir = util_dir())) are included.call_tree_dir()warns when a function is defined more than once inpath, naming each function and its files.
Breaking changes
- With
modules_only = TRUE, the functionsrootcalls directly (such asapp_ui()andapp_server()) are now kept, so UI and server modules stay grouped under them. Deeper non-module functions are still spliced out.
Earlier changes
call_stack(),call_tree_dir(), andcall_tree_app()gain anexcludeargument: a character vector of function names to drop from the tree (for example a logging helper that appears under every node). A dropped function’s children are spliced up into its place.call_tree_dir()no longer errors on files with a top-level namespaced call such asutils::globalVariables(...).
stackcallr 0.1.0
New features
New
call_tree_dir()builds the call tree of every function defined in a directory of.Rfiles, by parsing them without loading or running any of it. Works on a package’sR/directory or a Shiny app’s source before it’s installed.New
call_tree_app()builds the same kind of tree from a running Shiny app, by inspecting ashiny.appobj’s server function and its enclosing environment at runtime.Both functions gain a
modules_onlyargument that prunes the tree torootplus functions that callNS()/moduleServer()(Shiny modules). A dropped wrapper function’s children are spliced up into its parent’s position, so a real module reached only through a non-module wrapper stays visible.call_tree_app()detects theShinyAppHandlereturned byshiny::startApp()(shiny >= 1.14.0) and errors with an explanation, since that handle is a runtime control object with no reference back to the app’s UI or server for inspection.
Documentation
- New vignette, “Shiny module trees” (
vignette("shiny-modules", package = "stackcallr")), coveringcall_tree_dir()andcall_tree_app().