The running phone's CalVer build stamp — YYYY.MM.DD.N — or the empty string when the
bundle asking has no way to know it.
__MICA_VERSION__ is substituted by define at build time. The shell's
vite.config.ts supplies the real stamp. A core: false add-on's bundle
(vite.addon.config.ts) deliberately supplies '' instead, and so does any third-party
bundler that has never heard of the identifier and leaves the fallback here to fire.
Why empty rather than a number: an add-on bundle is compiled once and then loaded by
whatever phone happens to install it, so the host's build version is genuinely not
knowable when the bundle is written. Until MICA-170 the fallback was '1.0.0', which
meant every published add-on read a plausible, confidently wrong version forever — worse
than an absent one, because nothing about it looks like an error. '' is the encoding
this tree already gives to "not a version": lib/semver.ts returns null (not
orderable) for it rather than folding it into "up to date", and the Store's own
{app.version || '1.0.0'} and {#if app.version} call sites already treat a falsy
version as its own case.
So: if (MICA_VERSION) before using it, and read SDK_CONTRACT_VERSION above for the
question "what can I call?" — which is the one an add-on actually has.
The running phone's CalVer build stamp —
YYYY.MM.DD.N— or the empty string when the bundle asking has no way to know it.__MICA_VERSION__is substituted bydefineat build time. The shell'svite.config.tssupplies the real stamp. Acore: falseadd-on's bundle (vite.addon.config.ts) deliberately supplies''instead, and so does any third-party bundler that has never heard of the identifier and leaves the fallback here to fire.Why empty rather than a number: an add-on bundle is compiled once and then loaded by whatever phone happens to install it, so the host's build version is genuinely not knowable when the bundle is written. Until MICA-170 the fallback was
'1.0.0', which meant every published add-on read a plausible, confidently wrong version forever — worse than an absent one, because nothing about it looks like an error.''is the encoding this tree already gives to "not a version":lib/semver.tsreturnsnull(not orderable) for it rather than folding it into "up to date", and the Store's own{app.version || '1.0.0'}and{#if app.version}call sites already treat a falsy version as its own case.So:
if (MICA_VERSION)before using it, and readSDK_CONTRACT_VERSIONabove for the question "what can I call?" — which is the one an add-on actually has.