From fe636ae265a070835caf3f0174a5067c64fb09ed Mon Sep 17 00:00:00 2001 From: Hongbin Li Date: Sun, 9 Aug 2026 23:03:23 -0700 Subject: [PATCH] chore(core): drop the unused VOS_VERSION constant from compiled output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every compiled module opened `initVos` with `const VOS_VERSION = ;` and nothing ever read it — not the runtime, not the bridge, not any consumer. Removing the emit also retires the `version` local that existed only to interpolate into it. The config's `version` field is untouched and still load-bearing: it is the discriminator `migrateConfig` reads to upgrade older configs, and a required field on `vosConfigJsonSchema`. --- .changeset/drop-dead-vos-version.md | 5 +++++ packages/core/src/compiler/compileVosConfig.ts | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .changeset/drop-dead-vos-version.md diff --git a/.changeset/drop-dead-vos-version.md b/.changeset/drop-dead-vos-version.md new file mode 100644 index 0000000..36048ea --- /dev/null +++ b/.changeset/drop-dead-vos-version.md @@ -0,0 +1,5 @@ +--- +'@vosjs/core': patch +--- + +Drop the unused `VOS_VERSION` constant from compiled output. Every compiled module opened by declaring `const VOS_VERSION = ;` inside `initVos`, and nothing ever read it — not the runtime, not the bridge, not any consumer. The config's `version` field keeps its real job as the `migrateConfig` discriminator; only the dead emit goes. diff --git a/packages/core/src/compiler/compileVosConfig.ts b/packages/core/src/compiler/compileVosConfig.ts index 6e90add..0a505c1 100644 --- a/packages/core/src/compiler/compileVosConfig.ts +++ b/packages/core/src/compiler/compileVosConfig.ts @@ -74,8 +74,6 @@ export function compileVosConfig( throw new Error(`Invalid VosConfigJson:\n${issues}`) } - const version = result.data.version - // Detect which addons are actually needed by scanning function strings const detectedAddons = detectRequiredAddons(config) // Declarative gltf objects need the loader even though no function string @@ -222,7 +220,6 @@ ${utilEntries} export const initVos = async (container, deps) => { - const VOS_VERSION = ${version}; const { THREE, gsap, resolution } = deps; // Input data exposed as ctx.data (runtime deps.data overrides baked config.data; never undefined).