Skip to content

Latest commit

 

History

History
384 lines (329 loc) · 48.1 KB

CHANGELOG.md

File metadata and controls

384 lines (329 loc) · 48.1 KB

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.2.0 (2023-02-09)

Features

2.1.0 (2023-02-07)

Bug Fixes

Features

2.0.0 (2023-02-04)

Bug Fixes

Code Refactoring

Features

Reverts

BREAKING CHANGES

  • remove legacy package
  • change names of timing and interpolation functions

TweenFunction is now called InterpolationFunction. Individual functions are now called [type]Lerp instead of [type]Tween. For instance: colorTween is now colorLerp.

InterpolationFunction is now called TimingFunction. This name is better aligned with the CSS spec.

  • change to import paths

See the migration guide for more info.

  • change the way scenes are imported

Scene files no longer need to follow the pattern: [name].scene.tsx. When importing scenes in the project file, a dedicated ?scene query param should be used:

import example from './scenes/example?scene';

export default new Project({
  name: 'project',
  scenes: [example],
});
  • change the overall structure of a project

vite and @motion-canvas/vite-plugin packages are now required to build a project:

npm i -D vite @motion-canvas/vite-plugin

The following vite.config.ts file needs to be created in the root of the project:

import {defineConfig} from 'vite';
import motionCanvas from '@motion-canvas/vite-plugin';

export default defineConfig({
  plugins: [motionCanvas()],
});

Types exposed by Motion Canvas are no longer global. An additional motion-canvas.d.ts file needs to be created in the src directory:

/// <reference types="@motion-canvas/core/project" />

Finally, the bootstrap function no longer exists. Project files should export an instance of the Project class instead:

import {Project} from '@motion-canvas/core/lib';

import example from './scenes/example.scene';

export default new Project({
  name: 'project',
  scenes: [example],
  // same options as in bootstrap() are available:
* Animator.inferTweenFunction now returns deepTween,
which does not work exactly as before, though should be a viable
replacement in most cases.
* `scene.transition()` has been replaced by `useTransition`

Any use of slide transition must be updated from
```ts
yield* scene.transition(slideTransition());

to

yield* slideTranstion();

Any transitions must be rewritten to utilize useTransition.

  • Konva patches are not imported by default

Projects using KonvaScenes should import the patches manually at the very top of the file project:

import '@motion-canvas/core/lib/patches'
// ...
bootstrap(...);

getset import path has changed:

import {getset} from '@motion-canvas/core/lib/decorators/getset';
  • change the type exported by scene files

Scene files need to export a special SceneDescription object instead of a simple generator function.

  • change event naming convention

The names of all public events now use the following pattern: "on[WhatHappened]". Example: "onValueChanged".

  • change how images are imported

By default, importing images will now return their urls instead of a SpriteData object. This behavior can be adjusted using the ?img and ?anim queries.

  • change time events API
  • waitFor and waitUntil were moved

They should be imported from @motion-canvas/core/lib/flow.