Load the package with pkgload instead of devtools - #1
Merged
Conversation
shinylive scans app.R for dependencies, so devtools::load_all() pulled devtools and its 46 package import tree into the wasm bundle. That is 14.8 MB and 47 extra serial downloads before the app can start, none of which do anything useful in a browser. devtools::load_all() is a thin wrapper around pkgload::load_all(), so this is a direct swap. pkgload costs 6 packages and 1.2 MB. Net saving is 41 packages and 13.6 MB off first load.
ashbaldry
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
app.R used devtools::load_all(). shinylive scans app.R when working out what to bundle, so devtools and its 46 package import tree ended up in the wasm payload every visitor downloads.
That is 14.8 MB and 47 extra downloads. webR fetches packages one at a time over synchronous XHR, so the round trips cost as much as the bytes. None of it is usable in a browser anyway.
devtools::load_all() is a thin wrapper around pkgload::load_all(), so this is a straight swap. pkgload brings 6 packages and 1.2 MB. Net saving is 41 packages and 13.6 MB off first load.
Note that library(dtlgdemo) does not work here. The package is not in the wasm repo, so the app relies on loading from bundled source.
Measured against the packages currently served from the live site.