Skip to content
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions shiny/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import shiny

from . import __version__, _autoreload, _hostenv, _static, _utils
from ._hostenv import is_workbench
from ._docstring import no_example
from ._typing_extensions import NotRequired, TypedDict
from .bookmark._bookmark_state import shiny_bookmarks_folder_name
Expand Down Expand Up @@ -331,6 +332,14 @@ def run_app(

log_config: dict[str, Any] = copy.deepcopy(uvicorn.config.LOGGING_CONFIG)

# Workaround for nginx/uvicorn issue within Workbench
# https://github.com/rstudio/rstudio-pro/issues/7368#issuecomment-2918016088
deflate_args: DeflateArgs = {}
if is_workbench():
deflate_args = {
"ws_per_message_deflate": False,
}

if reload_dirs is None:
reload_dirs = []
if app_dir is not None:
Expand Down Expand Up @@ -412,6 +421,7 @@ def run_app(
# Don't allow shiny to use uvloop!
# https://github.com/posit-dev/py-shiny/issues/1373
loop="asyncio",
**deflate_args, # pyright: ignore[reportArgumentType]
**reload_args, # pyright: ignore[reportArgumentType]
**kwargs,
)
Expand Down Expand Up @@ -713,6 +723,10 @@ class ReloadArgs(TypedDict):
reload_dirs: NotRequired[list[str]]


class DeflateArgs(TypedDict):
ws_per_message_deflate: NotRequired[bool]


# Check that the version of rsconnect supports Shiny Express; can be removed in the
# future once this version of rsconnect is widely used. The dependency on "packaging"
# can also be removed then, because it is only used here. (Added 2024-03)
Expand Down
Loading