webR version string
coatless opened this issue · comments
With the update cadence increasing, it would be good to be able to query the webR
module itself to obtain the current version information, e.g.
webR.version;
This would avoid needing to querying the webr
support package for version information, e.g.
var webRready = await import('https://webr.r-wasm.org/latest/webr.mjs').then(
async ({ WebR }) => {
const webR = new WebR();
await webR.init();
return webR;
}
);
const webRVersion = await webRready.evalRString('as.character(utils::packageVersion("webr"))');
Good idea!
I've reworked how versioning is reported in 3b1e667. Once GHA CI has caught up, it should be possible to access the version of webR using the property webR.version
from JS. I'll try to remember to keep an eye on the results of this change for the next few pushes to main
and tagged releases.
I've set this up so that the version should include the GitHub SHA for development builds hosted at [...]/latest/
.
> webR.version;
< '0.3.3-dev+1298d00'
For tagged releases, this should return a standard version number as expected:
> webR.version;
< '0.3.3'
Note that this is based on the version reported in webR's package.json
, which follows semver. For development versions of webR this will be slightly different to the version of the webr
support package as reported by utils::packageVersion()
due to the differing versioning practices for indicating pre-release versions. They should, however, match for tagged releases of webR.
@georgestagg this is wonderful! Thank you so much. 👍
No worries on the semver
part, Quarto has a similar versioning scheme required for extensions.