* Calling `runApp("app.R")` ignored options passed into `shinyApp()`
Fixes#1942.
This was caused by shinyAppDir_appR (which was called by shinyAppDir
and shinyAppFile, which were called when runApp() was used with either
no args or a path) dropping shinyApp() options on the floor.
Fixing this was not as simple as not dropping those options. Before
this commit, the app.R file was not invoked until after the host and
port options (possibly others) were already finalized. This commit
changes the effective sequence of events during startup.
- Calling shinyAppFile() or shinyAppDir() that points to a single-file
app, now causes the app.R file to be sourced immediately; previously,
sourcing would happen only at onStart(). (Honestly, the new behavior
seems less surprising anyway.)
- The support files (R/*.R) for app.R were sourced during onStart. I've
moved this so that the support files are sourced right before app.R
is, and re-sourced every time app.R reloads.
* Code review feedback
* Code review feedback: improve test
* Roxygenize
* isTempPath is now isTemp, simplified semantics
- Now requires both the path and temp dir to exist
- isTemp(tempdir()) is now false
- Doesn't matter if it's files or directories
* Fix tests under R 3.4 and earlier
* fix comment
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
* master: (63 commits)
Use getStyle() to support old browsers
safe-guard against NA values
make shiny.useragg an unofficial option that takes priority over quartz
smaller bump in version
update news and add to comment
Wrap styles in reactive() so that calling getCurrentOutputInfo() doesn't always invalidate
Use is_available() more widely and remove unneeded complexity in check_suggested()
comments
generalize internal is_installed and use it in startPNG()
Remove reference to helper-load.R that's no longer there
Minor updates to shinyAppTemplate docs
code review with Winston
default to FALSE for now
let showtext know about the resolution
Pass check
Rollback the custom device arg (may come later) in favor of a shiny.useragg option
Auto values aren't resolved until plot time, so if we see one, resolve it
change device bg default only if the thematic option is set
somehow messed up rebase
missed passing device in renderCachedPlot()
...
* loadSupport(): fix global.R support, run global.R in appropriate dir
* loadSupport(): Use withr::with_dir, fix global.R-related tests
* shiny.autoload.r: Ensure dir set to appDir before sourcing R/ files
* Use file.path.ci() to ensure case-insensitive filesystem compat in loadSupport() and findEnclosingApp()
* loadSupport(): Ensure proper source order of R/ files
* loadSupport(): Clarify test
* Improve makeMask comment
* Added skeleton function and example
* Refinements to app template
* Template update
* Rename tests/shinytests/ to tests/shinytest/
* App template updates
* mask creation: clean up, document, and align with rlang::new_data_mask()
* Revert minor in mock session
* Document/fix mock session $setEnv() and $setReturned() behavior
* document
* simplify buildMask()
* minor
* simplify buildMask()
* simplify buildMask()
* add 12_counter test app to exercise runTests + testServer
* Add appobj test
* WIP loadSuppor for apps passed to testServer
* Revert "WIP loadSuppor for apps passed to testServer"
This reverts commit 2d519aca15.
* Found and fixed app obj lifecycle methods that testServer was not exercising when applicable
* Rename 12_counter to 12_template
* Rename utils.R to sort.R
* Updates from code review
* Move 12_template to app_template dir
* Add informative comments
* Simplify mask building, default app to "." in testServer()
* testServer(): Error when arguments provided to a server function
* Fix tests; don't default autoload to FALSE if not found
* Use withr::with_options in one particularly confusing shiny.autoload.r-related test
* testServer(): if app is a path, and not an app, walk up dirs until an app is found
* Fix tests on Windows - rprojroot uses winslash='/'
* testServer(): raise findEnclosingApp() call
* Add library(shiny) to top of test app
* document
* Use require(shiny) in testServer() it works without library(shiny)
* Revert "testServer(): raise findEnclosingApp() call"
This reverts commit 5801dee2a4.
* document
* loadSupport(): appDir now defaults to . and findEnclosingApp() occurs
* loadSupport() and testServer(): default app/appDir to NULL
* Remove sketchy test involving detach()
* Move findEnclosingApp() to utils.R
* Dropped rprojroot dep and moved findEnclosingApp() to utils
* Better error message
* findEnclosingApp(): Fix case when root is an app
Co-authored-by: trestletech <jeff.allen@trestletechnology.net>
Co-authored-by: Winston Chang <winston@stdout.org>