fastly / js-compute-runtime

JavaScript SDK and runtime for building Fastly Compute applications
https://developer.fastly.com/learning/compute/javascript/
Apache License 2.0
193 stars 26 forks source link

feat: fastly.sdkVersion implementation #776

Closed guybedford closed 1 month ago

guybedford commented 1 month ago

This implements a new fastly.sdkVersion property as well as an equivalent import { sdkVersion } from 'fastly:experimental' version property.

This is immediately useful in the StarlingMonkey builds to be able to easily inspect if we are in a StarlingMonkey build by checking fastly.sdkVersion === 'starlingmonkey-dev', which allows smoothing over any test handling edge cases more easily.

It's included in the types as a hidden property that is experimental. The engine build for the main runtime is set to the next patch version with a -dev suffix.

We will need to ensure we update this definition for each version release.

Resolves https://github.com/fastly/js-compute-runtime/issues/775.

guybedford commented 1 month ago

@elliottt as discussed today, I've renamed this to sdkVersion. Ready for review.