CodeVetter · Repo Unpack · Extension points
motiondivision/motion
Extension mechanisms exist at subject dispatch, renderer construction, feature loading, and animation scheduling boundaries. The effect API is the clearest public adapter mechanism and already supports GPU integrations. React features are enabled through a shared definition table and supplied as bundles. Development fixture discovery and package export maps provide separate extension surfaces for tests and distribution.
- animate.addEffect/removeEffect expose a subject registry; registration requires test() and read(), removes duplicate registration, and puts the newest effect first in dispatch order.
- createEffect accepts an addValue callback plus optional test/read/step options and returns a callable binding API with get(), flush(), state(), and per-call cleanup.
- threeEffect and vgpuEffect demonstrate adapters that claim subjects, read initial values, and schedule writes in frame.preRender; their implementations are exposed through dedicated motion subpaths.
- React feature extension uses featureProps to derive isEnabled checks; loadFeatures merges supplied feature packages into the existing shared table and writes it back through setFeatureDefinitions.
- createMotionComponent accepts preloaded features, a CreateVisualElement factory, forwardMotionProps, and explicit HTML/SVG type; createDomVisualElement selects HTMLVisualElement or SVGVisualElement.
- LazyMotion supports a direct feature bundle or a promise-returning loader, separates renderer from loaded features, and publishes the renderer and strict flag through LazyContext.
- createProjectionNode injects resize-listener, parent, scroll-measurement, scroll-root, and transform-reset behavior; AsyncMotionValueAnimation separately accepts an element-specific KeyframeResolver.
- New React fixtures plug into eager import.meta.glob discovery by exporting App; React 19 reuses React fixture files, while new public package APIs also require the appropriate export-map targets.