@@ -36,19 +36,27 @@ jobs:
3636 - name : Export Shinylive app
3737 shell : Rscript {0}
3838 run : |
39- # ── Pin shiny to pre-otel version ──
40- # otel (OpenTelemetry) became a hard Import of shiny in 1.12.0,
41- # but otel is not yet available as a WebAssembly binary on
42- # repo.r-wasm.org. shinylive resolves deps from the LOCAL
43- # library, so the installed shiny's otel dep causes a download
44- # failure. Pin to the last CRAN release without otel.
45- #
46- # TODO: Remove this pin once otel appears at
47- # http://repo.r-wasm.org/bin/emscripten/contrib/4.4/PACKAGES
39+ # ── Use dev shinylive for R 4.5 WASM support ──
40+ # CRAN shinylive 0.3.0 targets webR R 4.4.1.
41+ # The dev version (0.3.0.9000) targets R 4.5.1, where:
42+ # - otel is available on repo.r-wasm.org
43+ # - R-universe has a fixed TreeTools (no RCurl dep)
44+ # TODO: Switch back to CRAN shinylive once 0.4.0 ships.
45+ remotes::install_github("posit-dev/r-shinylive", quiet = TRUE)
4846
47+ # ── Install TreeTools and TreeDist from R-universe ──
48+ # repo.r-wasm.org has TreeTools 2.0.0 (still imports RCurl) for
49+ # both R 4.4 and 4.5. R-universe has 2.2.0.9001 (RCurl moved to
50+ # Suggests) compiled for R 4.5. Setting Repository to the
51+ # R-universe URL makes shinylive fetch the WASM binary from there.
52+ # Similarly, installing TreeDist from R-universe avoids the version
53+ # mismatch warning (local dev != WASM 2.9.2 on repo.r-wasm.org).
54+ # TODO: Remove once TreeTools >= 2.2.0 and TreeDist >= 2.13.0
55+ # are on CRAN and r-wasm.org has rebuilt them.
4956 install.packages(
50- "https://cran.r-project.org/src/contrib/Archive/shiny/shiny_1.11.1.tar.gz",
51- repos = NULL, type = "source"
57+ c("TreeTools", "TreeDist"),
58+ repos = c("https://ms609.r-universe.dev",
59+ "https://cloud.r-project.org")
5260 )
5361
5462 # ── Work around shinylive bug (coatless/quarto-webr#228) ──
@@ -94,18 +102,16 @@ jobs:
94102 )
95103
96104 # ── Export ──
97- if (!requireNamespace("shinylive", quietly = TRUE)) {
98- install.packages("shinylive")
99- }
100105 tryCatch(
101106 shinylive::export(appdir = app_dir, destdir = "docs/app"),
102107 error = function(e) {
103108 msg <- conditionMessage(e)
104109 message("\n===== shinylive::export() failed =====")
105110 message(msg)
106- message("This is often caused by a dependency that is not")
107- message("available as a WebAssembly binary. Check:")
108- message(" http://repo.r-wasm.org/bin/emscripten/contrib/4.4/PACKAGES")
111+ message("This is often caused by a dependency not available")
112+ message("as a WebAssembly binary. Check both:")
113+ message(" https://repo.r-wasm.org/bin/emscripten/contrib/4.5/PACKAGES")
114+ message(" https://ms609.r-universe.dev/bin/emscripten/contrib/4.5/PACKAGES")
109115 stop(e)
110116 }
111117 )
0 commit comments