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

On how to index, serve and document latest versions of jslibs #60

Open
oleiade opened this issue Sep 8, 2022 · 0 comments
Open

On how to index, serve and document latest versions of jslibs #60

oleiade opened this issue Sep 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@oleiade
Copy link
Member

oleiade commented Sep 8, 2022

Problem definition

We recently had an internal discussion about a consistent issue that k6 engineers encounter over time when documenting jslibs. When writing the k6 documentation for jslib modules, we generally put together examples relying on specific versions. This means that for every new version, one must remember to update the examples to point to the newer version where relevant.

This is quite error-prone, and those errors could lead us to, in this event, document new features that the version used in the example doesn't offer yet.

Potential solutions

Some potential solutions for that have been discussed:

  1. Having k6-docs (Gatsby) automatically fetch the latest version from this repo's supported.json file, and use it to replace any jslib module import's version.
  2. Have the jslib repo automatically expose the latest published version of modules under a latest version:
import { AWSConfig, S3Client } from 'https://jslib.k6.io/aws/latest/s3.js';

Caveats

Some problems were, however, outlined with both these solutions:

  • with 1. we would probably be able to replace it with the latest version on release. Moreover, we might want to have example keep using older versions under certain circumstances.
  • with 2. if we expose a latest version, then users will allegedly always use that, which defeats the purpose of versioning
  • with both and puts us at risk of breaking their scripts without realizing it.

Follow up

An alternative to the proposed solution could be to use same convention as Deno regarding dependency management.

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

No branches or pull requests

1 participant