Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webR version string #409

Closed
coatless opened this issue Apr 10, 2024 · 2 comments
Closed

webR version string #409

coatless opened this issue Apr 10, 2024 · 2 comments
Labels
feature New feature or request
Milestone

Comments

@coatless
Copy link
Contributor

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"))');
@georgestagg georgestagg added the feature New feature or request label Apr 17, 2024
@georgestagg georgestagg added this to the v0.3.3 milestone Apr 18, 2024
@georgestagg
Copy link
Member

georgestagg commented Apr 23, 2024

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.

@coatless
Copy link
Contributor Author

@georgestagg this is wonderful! Thank you so much. 👍

No worries on the semver part, Quarto has a similar versioning scheme required for extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants