Commit fbf2850
authored
Move shinylive from app type to runtime strategy (#10)
* Rewrite vignettes for the shinylive-as-strategy API
* Make shinylive a runtime strategy and autodetect app_type
Collapses app_type to the language (r-shiny, py-shiny) and moves
shinylive from the app-type axis to runtime_strategy alongside
bundled, system, auto-download, and container. All five strategies
are legal with both languages.
- detect_app_type() autodetects from app.R, ui.R + server.R, or
app.py; export() / app_check() treat app_type = NULL as autodetect.
- runtime_strategy defaults to "shinylive" when unset.
- Legacy r-shinylive / py-shinylive values still accepted with a
cli::cli_warn of class shinyelectron_deprecated_app_type and
translated to the canonical language plus "shinylive" strategy.
Pairing a legacy type with a non-shinylive strategy errors.
- Multi-app suites honor per-app runtime_strategy in the YAML; the
apps manifest carries the resolved per-app strategy and the
Electron shell's backend router reads it before falling back.
- Config schema: build.type may be omitted (autodetect); validator
accepts "shinylive"; init_config() writes a template with type
commented out.
- Drops validate_runtime_strategy_for_app_type and the SHINYLIVE /
NATIVE / ALL_APP_TYPES constants. R_TYPES / PY_TYPES collapse to
single-element vectors.
Tests cover detection rules, the shim's warning class, the
conflict error, legacy -> canonical mapping, mixed-strategy
multi-app suites, and snapshots of the detector's three abort
messages. NEWS.md folds the change into the 0.2.0 entry.
* Add diagrams for runtime strategies, signing, container, config
Adds twelve new SVGs and refreshes the runtime-decision tree to cover
the strategy comparison, the per-strategy ships/launch/running diagrams,
config overview, container anatomy and image sources, the launch flow,
and the two signing diagrams.
* Polish strategy and configuration vignettes for shinylive-as-strategy
* Wire splash and preloader options through to the lifecycle window
splash.enabled, splash.duration, splash.background, preloader.background,
and preloader.style are now consumed by lifecycle.html. The splash state
is gated by splash.enabled (false opens directly to the preloader), the
splash.duration value caps a setTimeout that delays the next state until
the minimum elapses, and the body background swaps to preloader.background
on first transition. preloader.style toggles spinner / bar / dots
indicators above the message via mustache sections.
Drops splash.width, splash.height, preloader.enabled, and
lifecycle.splash_min_duration from the schema (they were validated but
never read), tightens menu.template's accepted values to default and
minimal, and updates init_config()'s YAML template to match.
Adds tests covering defaults, fallback behaviour for the new background
overrides, mutually-exclusive style flags, and validator behaviour.
* Render auto-updater booleans as valid JavaScript
Whisker prints R booleans as TRUE / FALSE (uppercase), which is invalid
JavaScript. Replace direct {{auto_download}} / {{auto_install}} interpolation
with mustache section equivalents that emit lowercase true / false.
* Rename Advanced Features vignette to Customizations and add diagrams
Reframes the vignette around the three knobs that wrap the Shiny content
in a desktop build: the lifecycle window, the system tray, and the
application menu. Six new annotated SVGs (lifecycle phases, splash
anatomy, tray anatomy, tray button matrix, menu templates, preloader
styles) replace what used to be prose-only descriptions.
Updates the navbar entry, articles list, and cross-link from the
Auto Updates vignette to point at the new file.
* Pass over Security Considerations vignette
Reframes the intro around the three places desktop Shiny apps can break
(shell, app code, release path), reads the webPreferences block live
from inst/electron/shared/main.js so it stays in sync, fixes container
claims (default images run as root, /app is always mounted), and adds
labelled R / Python examples for parameterised shell commands.
Trims the security-trust-boundary diagram so the arrow heads sit at the
edges of the destination boxes instead of overshooting into them.
* Pass over Node.js Management vignette
Reframes the intro around why R / Python users want a local install,
fixes the cache path (lives under rappdirs::user_cache_dir, not
~/.shinyelectron), corrects the resolution rule (highest semver wins
regardless of install order), and adds a sentence about the Node.js
22.0.0 minimum required by Electron 41.
* Pass over Troubleshooting vignette and add phase map diagram
Reframes the intro around the three failure phases (install, build,
runtime), moves "Reading sitrep results in code" up to sit with the
diagnostic functions, drops redundant "Covers:" bullet lists that
duplicated the function table, and renames "Migrating from the old API"
to "Deprecation warnings" to match how readers actually arrive there.
Adds a three-column SVG that maps each phase to its sitrep function and
the top errors users hit there, so readers can scan once and jump to
the relevant section.
Fixes the Slow Builds (Windows) instruction to point at the real cache
path via cache_dir() instead of the non-existent ~/.shinyelectron.
* Refactor GitHub Actions vignette around the bundled template
The vignette now reads the env-vars block live from
inst/templates/github-actions-build.yml via a small helper, so the
documented values cannot drift from what shinyelectron ships. The long
hand-rolled "Build it from scratch" workflow is replaced with a pointer
to the template (system.file plus the GitHub URL) and a short tour of
what the template builds.
The aspirational coatless-actions/shiny-to-electron quickstart is moved
to a "Coming soon" section since the action does not have a published
release yet; the URL is also corrected (it was pointing at the singular
coatless-action org, which 404s).
Bumps GitHub Actions version pins to match the latest stable releases:
actions/checkout@v6, actions/cache@v5, actions/download-artifact@v8,
softprops/action-gh-release@v3.
* Update NEWS.md for 0.2.0 customization wiring and doc pass
* Fix R CMD check failures on the runtime-strategy branch
The dist_has_platform_artifact roxygen block had absorbed an unattached
"Build for target platforms" docblock for the next function down, so
\usage listed only output_dir and p while \arguments documented
platform / arch / verbose. Splits the two roxygen blocks so each
function has its own and regenerates the .Rd files.
The "export defaults runtime_strategy to shinylive when NULL" test
mocked build_electron_app but not convert_app_to_shinylive, so the
shinylive conversion still ran and pulled on pkgcache, which complains
that R_USER_CACHE_DIR is unset under R CMD check. Adds a matching
mockery::stub for convert_app_to_shinylive; the test now exercises only
the strategy-resolution path it was meant to cover.1 parent d07b3d4 commit fbf2850
90 files changed
Lines changed: 5747 additions & 2782 deletions
File tree
- R
- man
- figures
- tests/testthat
- _snaps
- vignettes
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | | - | |
| 20 | + | |
16 | 21 | | |
17 | | - | |
| 22 | + | |
18 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
25 | 48 | | |
26 | 49 | | |
27 | 50 | | |
| |||
31 | 54 | | |
32 | 55 | | |
33 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
34 | 69 | | |
35 | 70 | | |
36 | 71 | | |
| |||
66 | 101 | | |
67 | 102 | | |
68 | 103 | | |
| 104 | + | |
| 105 | + | |
69 | 106 | | |
70 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
71 | 111 | | |
72 | 112 | | |
73 | 113 | | |
74 | 114 | | |
75 | 115 | | |
76 | | - | |
77 | | - | |
78 | 116 | | |
79 | 117 | | |
80 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
75 | 96 | | |
76 | 97 | | |
77 | 98 | | |
78 | 99 | | |
79 | 100 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 101 | + | |
83 | 102 | | |
84 | 103 | | |
85 | 104 | | |
86 | 105 | | |
87 | 106 | | |
88 | | - | |
| 107 | + | |
89 | 108 | | |
90 | 109 | | |
91 | 110 | | |
| |||
114 | 133 | | |
115 | 134 | | |
116 | 135 | | |
117 | | - | |
| 136 | + | |
118 | 137 | | |
119 | 138 | | |
120 | 139 | | |
| |||
123 | 142 | | |
124 | 143 | | |
125 | 144 | | |
126 | | - | |
| 145 | + | |
127 | 146 | | |
128 | 147 | | |
129 | 148 | | |
| |||
153 | 172 | | |
154 | 173 | | |
155 | 174 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
163 | 193 | | |
164 | 194 | | |
165 | 195 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | 196 | | |
179 | 197 | | |
180 | | - | |
| 198 | + | |
181 | 199 | | |
182 | 200 | | |
183 | 201 | | |
184 | 202 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
188 | 206 | | |
189 | | - | |
| 207 | + | |
190 | 208 | | |
191 | 209 | | |
192 | 210 | | |
193 | | - | |
| 211 | + | |
194 | 212 | | |
195 | 213 | | |
196 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
38 | 51 | | |
39 | 52 | | |
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
43 | | - | |
| 56 | + | |
44 | 57 | | |
45 | 58 | | |
46 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 44 | + | |
52 | 45 | | |
53 | 46 | | |
54 | 47 | | |
55 | 48 | | |
56 | 49 | | |
57 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
| |||
74 | 71 | | |
75 | 72 | | |
76 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | | - | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
54 | | - | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
61 | 71 | | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| |||
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
122 | | - | |
| 133 | + | |
| 134 | + | |
123 | 135 | | |
124 | 136 | | |
125 | 137 | | |
| |||
0 commit comments