feat: Choose asset version at export #91
Merged
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.
Adds a new
assets_version
argument toexport()
that then propagates throughout the export process. This makes it possible to useshinylive::export()
with asset versions other than the one currently used by default in the package.The primary use case was to allow me to use the 0.4.1 assets even though the package is currently tied to 0.3.0. I used this to be able to use the preview version of shinylive with the wasm package library before it was officially tied to the package.
With this change
assets_version()
reports the current default version used by the package. Users may either setassets_version
when callingexport()
or they may use theSHINYLIVE_ASSETS_VERSION
envvar to achieve the same thing. The envvar is necessary for CI environments where it's easy to set this variable but hard to provide a version to the right function call, which is hidden from the user inside a GitHub workflow.Note that setting
assets_version
is enough,assets_ensure()
will find the require assets version and download it as necessary.We don't currently do minimum version checking; in the future we would still update the default assets version used by the package. If we ever have a breaking change where the
r-shinylive
package would be incompatible with older versions, we could include a version check in a central place, probably inassets_ensure()
.