MotionScript

@motion-script/core


@motion-script/core / PrecompCache

Interface: PrecompCache

Defined in: runtime/precompisition.ts:273

A host-provided store of previously-measured scene passes, letting an unchanged scene skip its build pass entirely.

The host owns both storage and validity: entries handed to get are assumed to already have been checked against whatever the pass depended on (scene source and its imports, project config, referenced assets, engine version). Precomp cannot make that judgement — it has no idea what a scene's source looks like — so it trusts what it is given and simply records fresh passes back via put.

See @motion-script/vite-plugin, which implements this over a project-local .motion-script/precomp.json and validates by re-hashing each entry's recorded source dependencies.

Methods

get()

get(sceneKey): ScenePrecomp | undefined

Defined in: runtime/precompisition.ts:275

A previously-stored pass for sceneKey, already validated, or undefined.

Parameters

sceneKey

string

Returns

ScenePrecomp | undefined


put()

put(sceneKey, precomp): void

Defined in: runtime/precompisition.ts:277

Record a freshly-measured pass. Only called for scenes that built cleanly.

Parameters

sceneKey

string

precomp

ScenePrecomp

Returns

void