Skip to content

πŸŽ₯ Make videos programmatically with React

`remotion`: Launch `effects` system! (#7488)

Jonny Burgera431828d2e08
diff --git a/packages/core/src/HtmlInCanvas.tsx b/packages/core/src/HtmlInCanvas.tsx
index b018c846fe..8192002b57 100644
--- a/packages/core/src/HtmlInCanvas.tsx
+++ b/packages/core/src/HtmlInCanvas.tsx
@@ -264,7 +264,7 @@ export type HtmlInCanvasProps = Omit<
| 'children'
| 'durationInFrames'
| keyof LayoutAndStyle
- | '_experimentalEffects'
+ | '_remotionInternalEffects'
> &
Omit<
AbsoluteFillLayout,
@@ -277,7 +277,7 @@ export type HtmlInCanvasProps = Omit<
readonly durationInFrames?: number;
readonly width: number;
readonly height: number;
- readonly _experimentalEffects?: EffectsProp;
+ readonly effects?: EffectsProp;
readonly children: React.ReactNode;
readonly onPaint?: HtmlInCanvasOnPaint;
readonly onInit?: HtmlInCanvasOnInit;
@@ -548,7 +548,7 @@ const HtmlInCanvasInner = forwardRef<
{
width,
height,
- _experimentalEffects: effects = [],
+ effects = [],
children,
onPaint,
onInit,
@@ -570,7 +570,7 @@ const HtmlInCanvasInner = forwardRef<
durationInFrames={resolvedDuration}
name={name ?? '<HtmlInCanvas>'}
_experimentalControls={controls}
- _experimentalEffects={memoizedEffectDefinitions}
+ _remotionInternalEffects={memoizedEffectDefinitions}
layout="none"
{...sequenceProps}
>
diff --git a/packages/core/src/Sequence.tsx b/packages/core/src/Sequence.tsx
index 25820cb1b6..dc5ba355b6 100644
--- a/packages/core/src/Sequence.tsx
+++ b/packages/core/src/Sequence.tsx
@@ -53,7 +53,7 @@ export type SequencePropsWithoutDuration = {
readonly showInTimeline?: boolean;
readonly hidden?: boolean;
readonly _experimentalControls?: SequenceControls;
- readonly _experimentalEffects?: readonly EffectDefinition<unknown>[];
+ readonly _remotionInternalEffects?: readonly EffectDefinition<unknown>[];
/**
* @deprecated For internal use only.
*/
@@ -105,7 +105,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
showInTimeline = true,
hidden = false,
_experimentalControls: controls,
- _experimentalEffects,
+ _remotionInternalEffects,
_remotionInternalLoopDisplay: loopDisplay,
_remotionInternalStack: stack,
_remotionInternalPremountDisplay: premountDisplay,
@@ -241,7 +241,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
registerSequence({
type: isMedia.type,
controls: controls ?? null,
- effects: _experimentalEffects ?? [],
+ effects: _remotionInternalEffects ?? [],
displayName: timelineClipName,
doesVolumeChange: isMedia.data.doesVolumeChange,
duration: actualDurationInFrames,
@@ -280,7 +280,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
premountDisplay: premountDisplay ?? null,
postmountDisplay: postmountDisplay ?? null,
controls: controls ?? null,
- effects: _experimentalEffects ?? [],
+ effects: _remotionInternalEffects ?? [],
});
return () => {
unregisterSequence(id);
@@ -303,7 +303,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
postmountDisplay,
env.isStudio,
controls,
- _experimentalEffects,
+ _remotionInternalEffects,
isMedia,
]);
diff --git a/packages/core/src/animated-image/AnimatedImage.tsx b/packages/core/src/animated-image/AnimatedImage.tsx
index cad6d69649..61e47c4757 100644
--- a/packages/core/src/animated-image/AnimatedImage.tsx
+++ b/packages/core/src/animated-image/AnimatedImage.tsx
@@ -227,7 +227,7 @@ const AnimatedImageInner = ({
className,
style,
durationInFrames,
- _experimentalEffects: effects = [],
+ effects = [],
_experimentalControls: controls,
ref,
...sequenceProps
@@ -259,7 +259,7 @@ const AnimatedImageInner = ({
durationInFrames={resolvedDuration}
name="<AnimatedImage>"
_experimentalControls={controls}
- _experimentalEffects={memoizedEffectDefinitions}
+ _remotionInternalEffects={memoizedEffectDefinitions}
{...sequenceProps}
>
<AnimatedImageContent
diff --git a/packages/core/src/animated-image/props.ts b/packages/core/src/animated-image/props.ts
index 56b9e83b9e..79d8b72ba7 100644
--- a/packages/core/src/animated-image/props.ts
+++ b/packages/core/src/animated-image/props.ts
@@ -21,11 +21,11 @@ export type RemotionAnimatedImageProps = {
export type AnimatedImageProps = Omit<
SequenceProps,
- 'children' | 'durationInFrames' | 'layout' | '_experimentalEffects'
+ 'children' | 'durationInFrames' | 'layout' | '_remotionInternalEffects'
> &
RemotionAnimatedImageProps & {
readonly durationInFrames?: number;
- readonly _experimentalEffects?: EffectsProp;
+ readonly effects?: EffectsProp;
};
export type AnimatedImageFillMode = 'contain' | 'cover' | 'fill';
diff --git a/packages/core/src/effects/Solid.tsx b/packages/core/src/effects/Solid.tsx
index 1535be1328..f1ecdce867 100644
--- a/packages/core/src/effects/Solid.tsx
+++ b/packages/core/src/effects/Solid.tsx
@@ -30,7 +30,7 @@ type MandatoryProps = {
type OptionalProps = {
readonly color: string | undefined;
- readonly _experimentalEffects: EffectsProp;
+ readonly effects: EffectsProp;
readonly className: string | undefined;
readonly style: React.CSSProperties | undefined;
};
@@ -73,7 +73,7 @@ const SolidInner: React.FC<
color,
width,
height,
- _experimentalEffects: experimentalEffects = [],
+ effects = [],
className,
style,
overrideId,
@@ -86,7 +86,7 @@ const SolidInner: React.FC<
);
const memoizedEffects = useMemoizedEffects({
- effects: experimentalEffects,
+ effects,
overrideId: overrideId ?? null,
});
@@ -200,7 +200,7 @@ const SolidOuter = forwardRef<
>(
(
{
- _experimentalEffects = [],
+ effects = [],
_experimentalControls: controls,
color,
height,
@@ -218,8 +218,7 @@ const SolidOuter = forwardRef<
) => {
props satisfies Record<string, never>;
- const memoizedEffectDefinitions =
- useMemoizedEffectDefinitions(_experimentalEffects);
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
return (
<Sequence
@@ -228,7 +227,7 @@ const SolidOuter = forwardRef<
hidden={hidden}
showInTimeline={showInTimeline}
_experimentalControls={controls}
- _experimentalEffects={memoizedEffectDefinitions}
+ _remotionInternalEffects={memoizedEffectDefinitions}
durationInFrames={durationInFrames}
name={name ?? '<Solid>'}
// 'stack' is in props
@@ -242,7 +241,7 @@ const SolidOuter = forwardRef<
width={width}
className={className}
style={style}
- _experimentalEffects={_experimentalEffects}
+ effects={effects}
/>
</Sequence>
);
diff --git a/packages/core/src/effects/index.ts b/packages/core/src/effects/index.ts
index 4fef757716..8456dfedf6 100644
--- a/packages/core/src/effects/index.ts
+++ b/packages/core/src/effects/index.ts
@@ -1,4 +1,4 @@
-// Types needed outside core for `_experimentalEffects` / `@remotion/effects/*` typing.
+// Types needed outside core for `effects` / `@remotion/effects` typing.
export type {
EffectDefinitionAndStack,
EffectDescriptor,
diff --git a/packages/core/src/test/solid.test.tsx b/packages/core/src/test/solid.test.tsx
index f8d78b8cae..dbc9a2b602 100644
--- a/packages/core/src/test/solid.test.tsx
+++ b/packages/core/src/test/solid.test.tsx
@@ -82,7 +82,7 @@ test('<Solid> renders without a color', () => {
test('<Solid> accepts an empty effects array', () => {
const {container} = render(
<WrapSequenceContext>
- <Solid color="green" width={64} height={64} _experimentalEffects={[]} />
+ <Solid color="green" width={64} height={64} effects={[]} />
</WrapSequenceContext>,
);
diff --git a/packages/effects/README.md b/packages/effects/README.md
index bde0e261d6..5610e106c6 100644
--- a/packages/effects/README.md
+++ b/packages/effects/README.md
@@ -1,7 +1,7 @@
# @remotion/effects
-Experimental presets for Remotion canvas effect hooks
+Internal presets for Remotion canvas effect hooks.
## Usage
-This is an internal package and has no documentation.
+Presets are exposed via `EffectInternals` only. This package has no public effect documentation yet.
diff --git a/packages/effects/bundle.ts b/packages/effects/bundle.ts
index 8699642875..6f291f7bae 100644
--- a/packages/effects/bundle.ts
+++ b/packages/effects/bundle.ts
@@ -5,13 +5,7 @@ if (process.env.NODE_ENV !== 'production') {
throw new Error('This script must be run using NODE_ENV=production');
}
-const effectEntrypoints = [
- 'src/index.ts',
- 'src/halftone.ts',
- 'src/tint.ts',
- 'src/wave.ts',
- 'src/entrypoints/blur.ts',
-];
+const effectEntrypoints = ['src/index.ts'];
console.time('Generated.');
const output = await build({
@@ -33,14 +27,8 @@ if (!output.success) {
}
for (const file of output.outputs) {
- let str = await file.text();
+ const str = await file.text();
const out = path.join('dist', 'esm', file.path);
-
- // Bun can emit a 0-byte file for `export {}` only; Node needs a real empty module.
- if (path.basename(file.path) === 'index.mjs' && str.trim() === '') {
- str = 'export {};\n';
- }
-
await Bun.write(out, str);
}
diff --git a/packages/effects/package.json b/packages/effects/package.json
index 7cd0a273a7..242d4be033 100644
--- a/packages/effects/package.json
+++ b/packages/effects/package.json
@@ -1,7 +1,7 @@
{
"name": "@remotion/effects",
"version": "4.0.464",
- "description": "Experimental presets for Remotion canvas effect hooks",
+ "description": "Internal presets for Remotion canvas effect hooks",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/esm/index.mjs",
@@ -32,44 +32,8 @@
"module": "./dist/esm/index.mjs",
"import": "./dist/esm/index.mjs"
},
- "./halftone": {
- "types": "./dist/halftone.d.ts",
- "module": "./dist/esm/halftone.mjs",
- "import": "./dist/esm/halftone.mjs"
- },
- "./tint": {
- "types": "./dist/tint.d.ts",
- "module": "./dist/esm/tint.mjs",
- "import": "./dist/esm/tint.mjs"
- },
- "./wave": {
- "types": "./dist/wave.d.ts",
- "module": "./dist/esm/wave.mjs",
- "import": "./dist/esm/wave.mjs"
- },
- "./blur": {
- "types": "./dist/entrypoints/blur.d.ts",
- "module": "./dist/esm/blur.mjs",
- "import": "./dist/esm/blur.mjs"
- },
"./package.json": "./package.json"
},
- "typesVersions": {
- ">=1.0": {
- "halftone": [
- "dist/halftone.d.ts"
- ],
- "tint": [
- "dist/tint.d.ts"
- ],
- "wave": [
- "dist/wave.d.ts"
- ],
- "blur": [
- "dist/entrypoints/blur.d.ts"
- ]
- }
- },
"devDependencies": {
"@remotion/eslint-config-internal": "workspace:*",
"eslint": "catalog:",
diff --git a/packages/effects/src/effect-internals.ts b/packages/effects/src/effect-internals.ts
new file mode 100644
index 0000000000..2a8a46007f
--- /dev/null
+++ b/packages/effects/src/effect-internals.ts
@@ -0,0 +1,11 @@
+import {blur} from './blur/index.js';
+import {halftone} from './halftone.js';
+import {tint} from './tint.js';
+import {wave} from './wave.js';
+
+export const EffectInternals = {
+ blur,
+ halftone,
+ tint,
+ wave,
+} as const;
diff --git a/packages/effects/src/entrypoints/blur.ts b/packages/effects/src/entrypoints/blur.ts
deleted file mode 100644
index 471f0ffe70..0000000000
--- a/packages/effects/src/entrypoints/blur.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import * as blurExports from '../blur/index.js';
-
-export type {BlurParams} from '../blur/index.js';
-
-const {blur} = blurExports;
-
-export {blur};
diff --git a/packages/effects/src/index.ts b/packages/effects/src/index.ts
index cb0ff5c3b5..7a03d864ce 100644
--- a/packages/effects/src/index.ts
+++ b/packages/effects/src/index.ts
@@ -1 +1,5 @@
-export {};
+export {EffectInternals} from './effect-internals.js';
+export type {BlurParams} from './blur/index.js';
+export {halftoneSchema, type HalftoneParams} from './halftone.js';
+export {tintSchema, type TintParams} from './tint.js';
+export {waveSchema, type WaveParams} from './wave.js';
diff --git a/packages/example/e2e/lost-node-path.test.mts b/packages/example/e2e/lost-node-path.test.mts
index 34405c6c82..3cbead284d 100644
--- a/packages/example/e2e/lost-node-path.test.mts
+++ b/packages/example/e2e/lost-node-path.test.mts
@@ -13,16 +13,19 @@ const getSequenceLine = (content: string): number => {
};
const applyIssue7393Refactor = (content: string): string => {
- if (content.includes('const t = tint')) {
+ if (content.includes('const t = EffectInternals.tint')) {
return content;
}
return content
.replace(
- '\tconst experimentalEffects = Internals.useMemoizedEffectDefinitions([',
- "\tconst t = tint({color: 'green', amount: 1});\n\tconst experimentalEffects = Internals.useMemoizedEffectDefinitions([",
+ '\tconst memoizedEffects = Internals.useMemoizedEffectDefinitions([',
+ "\tconst t = EffectInternals.tint({color: 'green', amount: 1});\n\tconst memoizedEffects = Internals.useMemoizedEffectDefinitions([",
)
- .replace("\t\ttint({color: 'green', amount: 1}),", '\t\tt,');
+ .replace(
+ "\t\tEffectInternals.tint({color: 'green', amount: 1}),",
+ '\t\tt,',
+ );
};
const stackAttribution = (line: number) => `LostNodePathRepro.tsx:${line}`;
diff --git a/packages/example/src/AnimatedImage/Effects.tsx b/packages/example/src/AnimatedImage/Effects.tsx
index 422610151d..f8bf48b917 100644
--- a/packages/example/src/AnimatedImage/Effects.tsx
+++ b/packages/example/src/AnimatedImage/Effects.tsx
@@ -1,5 +1,4 @@
-import {blur} from '@remotion/effects/blur';
-import {tint} from '@remotion/effects/tint';
+import {EffectInternals} from '@remotion/effects';
import {StudioInternals} from '@remotion/studio';
import React from 'react';
import {
@@ -34,7 +33,7 @@ const columnStyle: React.CSSProperties = {
};
/**
- * `<AnimatedImage>` with `_experimentalEffects` β€” animated blur + tint.
+ * `<AnimatedImage>` with `effects` β€” animated blur + tint.
* Composition id: `animated-image-effects`.
*/
const Comp: React.FC = () => {
@@ -72,11 +71,11 @@ const Comp: React.FC = () => {
height={IMAGE_SIZE}
fit="contain"
style={{borderRadius: 16}}
- _experimentalEffects={[
- blur({
+ effects={[
+ EffectInternals.blur({
radius: blurRadius,
}),
- tint({
+ EffectInternals.tint({
color: '#41f500',
amount: 0.35,
}),
diff --git a/packages/example/src/EffectsTestbed/EffectsTestbed.tsx b/packages/example/src/EffectsTestbed/EffectsTestbed.tsx
index ed69947dad..558488b3c5 100644
--- a/packages/example/src/EffectsTestbed/EffectsTestbed.tsx
+++ b/packages/example/src/EffectsTestbed/EffectsTestbed.tsx
@@ -1,7 +1,4 @@
-import {blur} from '@remotion/effects/blur';
-import {halftone} from '@remotion/effects/halftone';
-import {tint} from '@remotion/effects/tint';
-import {wave} from '@remotion/effects/wave';
+import {EffectInternals} from '@remotion/effects';
import {LightLeakInternals} from '@remotion/light-leaks';
import {Video} from '@remotion/media';
import {StarburstInternals} from '@remotion/starburst';
@@ -94,8 +91,8 @@ const AnimatedWaveVideo: React.FC = () => {
muted
loop
objectFit="cover"
- _experimentalEffects={[
- wave({
+ effects={[
+ EffectInternals.wave({
amplitude: 22,
wavelength: 180,
evolution,
@@ -118,7 +115,7 @@ const AnimatedLightLeakSolid: React.FC = () => {
height={300}
color="#ff5fa2"
style={tileVideoStyle}
- _experimentalEffects={[
+ effects={[
LightLeakInternals.lightLeak({
seed: 1,
hueShift: 30,
@@ -140,13 +137,13 @@ const AnimatedStackVideo: React.FC = () => {
muted
loop
objectFit="cover"
- _experimentalEffects={[
+ effects={[
StarburstInternals.starburst({
colors: ['#ff5fa2', '#ff0000'],
rays: 12,
}),
- blur({radius: 24}),
- wave({
+ EffectInternals.blur({radius: 24}),
+ EffectInternals.wave({
amplitude: 22,
wavelength: 180,
evolution,
@@ -187,7 +184,7 @@ export const EffectsTestbed: React.FC = () => {
muted
loop
objectFit="cover"
- _experimentalEffects={[tint({color: '#ff5fa2', amount: 0.6})]}
+ effects={[EffectInternals.tint({color: '#ff5fa2', amount: 0.6})]}
/>
</Tile>
<Tile title="halftone" subtitle="circles, dotSize 12, on luminance">
@@ -197,8 +194,8 @@ export const EffectsTestbed: React.FC = () => {
muted
loop
objectFit="cover"
- _experimentalEffects={[
- halftone({
+ effects={[
+ EffectInternals.halftone({
shape: 'circle',
dotSize: 12,
dotSpacing: 12,
@@ -219,7 +216,7 @@ export const EffectsTestbed: React.FC = () => {
muted
loop
objectFit="cover"
- _experimentalEffects={[blur({radius: 24})]}
+ effects={[EffectInternals.blur({radius: 24})]}
/>
</Tile>
<Tile title="solid" subtitle="light leak, progress from frame">
diff --git a/packages/example/src/EffectsTestbed/VideoEffectsFastRefresh.tsx b/packages/example/src/EffectsTestbed/VideoEffectsFastRefresh.tsx
index 2929fb2a51..e041e566a8 100644
--- a/packages/example/src/EffectsTestbed/VideoEffectsFastRefresh.tsx
+++ b/packages/example/src/EffectsTestbed/VideoEffectsFastRefresh.tsx
@@ -1,7 +1,7 @@
/**
* Minimal repro for https://github.com/remotion-dev/remotion/issues/7449
*
- * `<Video>` does not fast-refresh effects when `tint()` params change in code.
+ * `<Video>` does not fast-refresh effects when `EffectInternals.tint()` params change in code.
*
* Repro:
* 1. `cd packages/example && bun run dev`
@@ -11,7 +11,7 @@
* 5. Expected: the video tint updates immediately
* 6. Bug: the canvas keeps the old tint until you seek or remount
*/
-import {tint} from '@remotion/effects/tint';
+import {EffectInternals} from '@remotion/effects';
import {Video} from '@remotion/media';
import React from 'react';
import {AbsoluteFill, Solid, staticFile} from 'remotion';
@@ -105,7 +105,8 @@ export const VideoEffectsFastRefresh: React.FC = () => {
&lt;Video&gt; (bug surface)
</div>
<div>
- tint({`{color: '${TINT_COLOR}', amount: ${TINT_AMOUNT}}`})
+ EffectInternals.tint(
+ {`{color: '${TINT_COLOR}', amount: ${TINT_AMOUNT}}`})
</div>
</div>
<Video
@@ -114,7 +115,7 @@ export const VideoEffectsFastRefresh: React.FC = () => {
muted
loop
objectFit="cover"
- _experimentalEffects={[tint({color: TINT_COLOR, amount: 0.57})]}
+ effects={[EffectInternals.tint({color: TINT_COLOR, amount: 0.57})]}
/>
</div>
<div style={panelStyle}>
@@ -132,7 +133,7 @@ export const VideoEffectsFastRefresh: React.FC = () => {
height={1080}
color="#3b82f6"
style={mediaStyle}
- _experimentalEffects={[tint({color: TINT_COLOR, amount: 0.2})]}
+ effects={[EffectInternals.tint({color: TINT_COLOR, amount: 0.2})]}
/>
</div>
</div>
diff --git a/packages/example/src/ErrorOverlayE2e/ErrorOverlayRepro.tsx b/packages/example/src/ErrorOverlayE2e/ErrorOverlayRepro.tsx
index f592fc3148..59734bacd6 100644
--- a/packages/example/src/ErrorOverlayE2e/ErrorOverlayRepro.tsx
+++ b/packages/example/src/ErrorOverlayE2e/ErrorOverlayRepro.tsx
@@ -1,7 +1,7 @@
// Regression fixture for https://github.com/remotion-dev/remotion/issues/7447
// The error overlay does not dismiss after a runtime error is fixed.
// The e2e test toggles the radius argument below to reproduce.
-import {blur} from '@remotion/effects/blur';
+import {EffectInternals} from '@remotion/effects';
import React from 'react';
import {AbsoluteFill, Solid} from 'remotion';
@@ -15,7 +15,7 @@ export const ErrorOverlayRepro: React.FC = () => {
height={400}
color="#ff5fa2"
style={STYLE}
- _experimentalEffects={[blur({radius: 24})]}
+ effects={[EffectInternals.blur({radius: 24})]}
/>
</AbsoluteFill>
);
diff --git a/packages/example/src/Gif/GifEffects.tsx b/packages/example/src/Gif/GifEffects.tsx
index 875ae89a5a..3567c76a7b 100644
--- a/packages/example/src/Gif/GifEffects.tsx
+++ b/packages/example/src/Gif/GifEffects.tsx
@@ -1,7 +1,4 @@
-import {blur} from '@remotion/effects/blur';
-import {halftone} from '@remotion/effects/halftone';
-import {tint} from '@remotion/effects/tint';
-import {wave} from '@remotion/effects/wave';
+import {EffectInternals} from '@remotion/effects';
import {Gif} from '@remotion/gif';
import {StudioInternals} from '@remotion/studio';
import React from 'react';
@@ -93,7 +90,7 @@ const AnimatedBlurGif: React.FC = () => {
src={GIF_SRC}
fit="contain"
style={tileGifStyle}
- _experimentalEffects={[blur({radius: blurRadius})]}
+ effects={[EffectInternals.blur({radius: blurRadius})]}
/>
);
};
@@ -107,8 +104,8 @@ const AnimatedWaveGif: React.FC = () => {
src={GIF_SRC}
fit="contain"
style={tileGifStyle}
- _experimentalEffects={[
- wave({
+ effects={[
+ EffectInternals.wave({
amplitude: 22,
wavelength: 180,
evolution,
@@ -129,16 +126,16 @@ const StackedGif: React.FC = () => {
src={GIF_SRC}
fit="contain"
style={tileGifStyle}
- _experimentalEffects={[
- tint({color: '#ff5fa2', amount: 0.4}),
- wave({
+ effects={[
+ EffectInternals.tint({color: '#ff5fa2', amount: 0.4}),
+ EffectInternals.wave({
amplitude: 12,
wavelength: 160,
evolution,
sliceWidth: 4,
background: '#020617',
}),
- blur({radius: 6}),
+ EffectInternals.blur({radius: 6}),
]}
/>
);
@@ -174,7 +171,7 @@ const Comp: React.FC = () => {
src={GIF_SRC}
fit="contain"
style={tileGifStyle}
- _experimentalEffects={[tint({color: '#ff5fa2', amount: 0.6})]}
+ effects={[EffectInternals.tint({color: '#ff5fa2', amount: 0.6})]}
/>
</Tile>
<Tile title="halftone" subtitle="circles, dotSize 12, on luminance">
@@ -182,8 +179,8 @@ const Comp: React.FC = () => {
src={GIF_SRC}
fit="contain"
style={tileGifStyle}
- _experimentalEffects={[
- halftone({
+ effects={[
+ EffectInternals.halftone({
shape: 'circle',
dotSize: 12,
dotSpacing: 12,
diff --git a/packages/example/src/HtmlInCanvas/compose-webgl-crt.tsx b/packages/example/src/HtmlInCanvas/compose-webgl-crt.tsx
index dcbf23228b..7ab5bd0263 100644
--- a/packages/example/src/HtmlInCanvas/compose-webgl-crt.tsx
+++ b/packages/example/src/HtmlInCanvas/compose-webgl-crt.tsx
@@ -1,4 +1,4 @@
-import {tint} from '@remotion/effects/tint';
+import {EffectInternals} from '@remotion/effects';
import React, {useCallback, useRef} from 'react';
import {
HtmlInCanvas,
@@ -229,7 +229,7 @@ export const HtmlInCanvasComposeWebGLCrt: React.FC = () => {
height={height}
onInit={onInit}
onPaint={onPaint}
- _experimentalEffects={[tint({color: 'red'})]}
+ effects={[EffectInternals.tint({color: 'red'})]}
style={{
backgroundColor: 'white',
color: 'black',
diff --git a/packages/example/src/HtmlInCanvas/react-svg.tsx b/packages/example/src/HtmlInCanvas/react-svg.tsx
index 722f7b225d..43a4b53040 100644
--- a/packages/example/src/HtmlInCanvas/react-svg.tsx
+++ b/packages/example/src/HtmlInCanvas/react-svg.tsx
@@ -1,5 +1,4 @@
-import {halftone} from '@remotion/effects/halftone';
-import {tint} from '@remotion/effects/tint';
+import {EffectInternals} from '@remotion/effects';
import React from 'react';
import {HtmlInCanvas, useVideoConfig} from 'remotion';
import ReactSvg from '../ReactSvg';
@@ -15,13 +14,13 @@ export const HtmlInCanvasReactSvg: React.FC<{
<HtmlInCanvas
width={width}
height={height}
- _experimentalEffects={[
- halftone({
+ effects={[
+ EffectInternals.halftone({
dotSize: 30,
dotSpacing: 20,
shape: 'square',
}),
- tint({color: 'green', amount: 1}),
+ EffectInternals.tint({color: 'green', amount: 1}),
]}
>
<ReactSvg transparent={transparent} />
diff --git a/packages/example/src/LostNodePathE2e/LostNodePathRepro.tsx b/packages/example/src/LostNodePathE2e/LostNodePathRepro.tsx
index 0309385a28..eeefbb51fe 100644
--- a/packages/example/src/LostNodePathE2e/LostNodePathRepro.tsx
+++ b/packages/example/src/LostNodePathE2e/LostNodePathRepro.tsx
@@ -1,25 +1,24 @@
-import {halftone} from '@remotion/effects/halftone';
-import {tint} from '@remotion/effects/tint';
+import {EffectInternals} from '@remotion/effects';
import React from 'react';
import {AbsoluteFill, Internals, Sequence, useVideoConfig} from 'remotion';
import {SimpleSvg} from './SimpleSvg';
export const LostNodePathRepro: React.FC = () => {
const {durationInFrames} = useVideoConfig();
- const experimentalEffects = Internals.useMemoizedEffectDefinitions([
- halftone({
+ const memoizedEffects = Internals.useMemoizedEffectDefinitions([
+ EffectInternals.halftone({
dotSize: 30,
dotSpacing: 20,
shape: 'square',
}),
- tint({color: 'green', amount: 1}),
+ EffectInternals.tint({color: 'green', amount: 1}),
]);
return (
<AbsoluteFill style={{backgroundColor: 'white'}}>
<Sequence
durationInFrames={durationInFrames}
- _experimentalEffects={experimentalEffects}
+ _remotionInternalEffects={memoizedEffects}
>
<SimpleSvg />
</Sequence>
diff --git a/packages/example/src/Rive/RiveEffects.tsx b/packages/example/src/Rive/RiveEffects.tsx
index d2d08946f1..f3b7a0d0d5 100644
--- a/packages/example/src/Rive/RiveEffects.tsx
+++ b/packages/example/src/Rive/RiveEffects.tsx
@@ -1,7 +1,4 @@
-import {blur} from '@remotion/effects/blur';
-import {halftone} from '@remotion/effects/halftone';
-import {tint} from '@remotion/effects/tint';
-import {wave} from '@remotion/effects/wave';
+import {EffectInternals} from '@remotion/effects';
import {RemotionRiveCanvas} from '@remotion/rive';
import {StudioInternals} from '@remotion/studio';
import React from 'react';
@@ -89,7 +86,7 @@ const AnimatedBlurRive: React.FC = () => {
<RemotionRiveCanvas
src={RIVE_SRC}
style={tileRiveStyle}
- _experimentalEffects={[blur({radius: blurRadius})]}
+ effects={[EffectInternals.blur({radius: blurRadius})]}
/>
);
};
@@ -102,8 +99,8 @@ const AnimatedWaveRive: React.FC = () => {
<RemotionRiveCanvas
src={RIVE_SRC}
style={tileRiveStyle}
- _experimentalEffects={[
- wave({
+ effects={[
+ EffectInternals.wave({
amplitude: 22,
wavelength: 180,
evolution,
@@ -123,16 +120,16 @@ const StackedRive: React.FC = () => {
<RemotionRiveCanvas
src={RIVE_SRC}
style={tileRiveStyle}
- _experimentalEffects={[
- tint({color: '#ff5fa2', amount: 0.4}),
- wave({
+ effects={[
+ EffectInternals.tint({color: '#ff5fa2', amount: 0.4}),
+ EffectInternals.wave({
amplitude: 12,
wavelength: 160,
evolution,
sliceWidth: 4,
background: '#020617',
}),
- blur({radius: 6}),
+ EffectInternals.blur({radius: 6}),
]}
/>
);
@@ -167,15 +164,15 @@ const Comp: React.FC = () => {
<RemotionRiveCanvas
src={RIVE_SRC}
style={tileRiveStyle}
- _experimentalEffects={[tint({color: '#ff5fa2', amount: 0.6})]}
+ effects={[EffectInternals.tint({color: '#ff5fa2', amount: 0.6})]}
/>
</Tile>
<Tile title="halftone" subtitle="circles, dotSize 12, on luminance">
<RemotionRiveCanvas
src={RIVE_SRC}
style={tileRiveStyle}
- _experimentalEffects={[
- halftone({
+ effects={[
+ EffectInternals.halftone({
shape: 'circle',
dotSize: 12,
dotSpacing: 12,
diff --git a/packages/gif/src/Gif.tsx b/packages/gif/src/Gif.tsx
index ae69beb500..ea1efa47f6 100644
--- a/packages/gif/src/Gif.tsx
+++ b/packages/gif/src/Gif.tsx
@@ -22,11 +22,11 @@ const {
export type GifProps = Omit<
SequenceProps,
- 'children' | 'durationInFrames' | 'layout' | '_experimentalEffects'
+ 'children' | 'durationInFrames' | 'layout' | '_remotionInternalEffects'
> &
RemotionGifProps & {
readonly durationInFrames?: number;
- readonly _experimentalEffects?: EffectsProp;
+ readonly effects?: EffectsProp;
};
/*
@@ -60,7 +60,7 @@ const GifInner = ({
durationInFrames,
style,
_experimentalControls: controls,
- _experimentalEffects: effects = [],
+ effects = [],
ref,
...sequenceProps
}: GifProps & {
@@ -106,7 +106,7 @@ const GifInner = ({
durationInFrames={resolvedDuration}
name="<Gif>"
_experimentalControls={controls}
- _experimentalEffects={memoizedEffectDefinitions}
+ _remotionInternalEffects={memoizedEffectDefinitions}
{...sequenceProps}
>
{inner}
diff --git a/packages/media/src/video/props.ts b/packages/media/src/video/props.ts
index 2517a15049..bb6f47d0b2 100644
--- a/packages/media/src/video/props.ts
+++ b/packages/media/src/video/props.ts
@@ -70,13 +70,13 @@ type OptionalVideoProps = {
credentials: RequestCredentials | undefined;
objectFit: VideoObjectFit;
_experimentalInitiallyDrawCachedFrame: boolean;
- _experimentalEffects: EffectsProp;
+ effects: EffectsProp;
};
export type InnerVideoProps = MandatoryVideoProps &
OuterVideoProps &
- Omit<OptionalVideoProps, '_experimentalEffects'> & {
- _experimentalEffects: EffectDefinitionAndStack<unknown>[];
+ Omit<OptionalVideoProps, 'effects'> & {
+ effects: EffectDefinitionAndStack<unknown>[];
};
export type VideoProps = MandatoryVideoProps &
diff --git a/packages/media/src/video/video-for-preview.tsx b/packages/media/src/video/video-for-preview.tsx
index 2ceb4ed9ea..31465c3fba 100644
--- a/packages/media/src/video/video-for-preview.tsx
+++ b/packages/media/src/video/video-for-preview.tsx
@@ -67,7 +67,7 @@ type VideoForPreviewProps = {
readonly objectFit: VideoObjectFit;
readonly setMediaDurationInSeconds: (durationInSeconds: number) => void;
readonly _experimentalInitiallyDrawCachedFrame: boolean;
- readonly _experimentalEffects: EffectDefinitionAndStack<unknown>[];
+ readonly effects: EffectDefinitionAndStack<unknown>[];
};
type VideoForPreviewAssertedShowingProps = VideoForPreviewProps;
@@ -98,7 +98,7 @@ const VideoForPreviewAssertedShowing: React.FC<
credentials,
objectFit: objectFitProp,
_experimentalInitiallyDrawCachedFrame,
- _experimentalEffects,
+ effects,
setMediaDurationInSeconds,
}) => {
const src = usePreload(unpreloadedSrc);
@@ -139,8 +139,8 @@ const VideoForPreviewAssertedShowing: React.FC<
const effectChainState = useEffectChainState();
- const experimentalEffectsRef = useRef(_experimentalEffects);
- experimentalEffectsRef.current = _experimentalEffects;
+ const effectsRef = useRef(effects);
+ effectsRef.current = effects;
const effectChainStateRef = useRef(effectChainState);
effectChainStateRef.current = effectChainState;
@@ -276,7 +276,7 @@ const VideoForPreviewAssertedShowing: React.FC<
sequenceOffset: initialSequenceOffset.current,
credentials,
tagType: 'video',
- getEffects: () => experimentalEffectsRef.current,
+ getEffects: () => effectsRef.current,
getEffectChainState: (width, height) =>
effectChainStateRef.current?.get(width, height)!,
});
@@ -475,7 +475,7 @@ const VideoForPreviewAssertedShowing: React.FC<
mediaPlayer.redrawVideoEffects().catch(() => {
// Player may have been disposed between layout and the async redraw.
});
- }, [_experimentalEffects, mediaPlayerReady, mediaPlayerRef]);
+ }, [effects, mediaPlayerReady, mediaPlayerRef]);
const actualStyle: React.CSSProperties = useMemo(() => {
return {
diff --git a/packages/media/src/video/video.tsx b/packages/media/src/video/video.tsx
index da6320198f..bdd5158d14 100644
--- a/packages/media/src/video/video.tsx
+++ b/packages/media/src/video/video.tsx
@@ -72,7 +72,7 @@ const InnerVideo: React.FC<
_experimentalControls: controls,
objectFit,
_experimentalInitiallyDrawCachedFrame,
- _experimentalEffects,
+ effects,
setMediaDurationInSeconds,
}) => {
const environment = useRemotionEnvironment();
@@ -161,7 +161,7 @@ const InnerVideo: React.FC<
credentials={credentials}
controls={controls}
objectFit={objectFit}
- _experimentalEffects={_experimentalEffects}
+ effects={effects}
_experimentalInitiallyDrawCachedFrame={
_experimentalInitiallyDrawCachedFrame
}
@@ -202,7 +202,7 @@ const VideoInner: React.FC<
_experimentalControls: controls,
objectFit,
_experimentalInitiallyDrawCachedFrame,
- _experimentalEffects,
+ effects,
durationInFrames,
from,
hidden,
@@ -266,11 +266,11 @@ const VideoInner: React.FC<
);
const memoizedEffects = Internals.useMemoizedEffects({
- effects: _experimentalEffects ?? [],
+ effects: effects ?? [],
overrideId: controls?.overrideId ?? null,
});
const memoizedEffectDefinitions = Internals.useMemoizedEffectDefinitions(
- _experimentalEffects ?? [],
+ effects ?? [],
);
if (sequenceDurationInFrames === 0) {
@@ -287,7 +287,7 @@ const VideoInner: React.FC<
name={name ?? '<Video>'}
_experimentalControls={controls}
_remotionInternalLoopDisplay={loopDisplay}
- _experimentalEffects={memoizedEffectDefinitions}
+ _remotionInternalEffects={memoizedEffectDefinitions}
showInTimeline={showInTimeline ?? true}
hidden={hidden}
>
@@ -325,7 +325,7 @@ const VideoInner: React.FC<
_experimentalInitiallyDrawCachedFrame={
_experimentalInitiallyDrawCachedFrame ?? false
}
- _experimentalEffects={memoizedEffects}
+ effects={memoizedEffects}
setMediaDurationInSeconds={setMediaDurationInSeconds}
/>
</Sequence>
diff --git a/packages/rive/src/RemotionRiveCanvas.tsx b/packages/rive/src/RemotionRiveCanvas.tsx
index 68104e8c3b..b429df7515 100644
--- a/packages/rive/src/RemotionRiveCanvas.tsx
+++ b/packages/rive/src/RemotionRiveCanvas.tsx
@@ -64,7 +64,7 @@ type RemotionRiveCanvasOwnProps = {
readonly assetLoader?: assetLoadCallback;
readonly className?: string;
readonly style?: React.CSSProperties;
- readonly _experimentalEffects?: EffectsProp;
+ readonly effects?: EffectsProp;
};
export type RemotionRiveCanvasProps = RemotionRiveCanvasOwnProps &
@@ -121,7 +121,7 @@ const riveCanvasSchema = {
type RemotionRiveCanvasContentProps = Omit<
RemotionRiveCanvasOwnProps,
- '_experimentalEffects'
+ 'effects'
> & {
readonly fit: RemotionRiveCanvasFit;
readonly alignment: RemotionRiveCanvasAlignment;
@@ -436,7 +436,7 @@ const RemotionRiveCanvasInnerForwardRefFunction: React.ForwardRefRenderFunction<
enableRiveAssetCdn = true,
className,
style,
- _experimentalEffects: effects = [],
+ effects = [],
_experimentalControls: controls,
durationInFrames,
name,
@@ -460,7 +460,7 @@ const RemotionRiveCanvasInnerForwardRefFunction: React.ForwardRefRenderFunction<
name={name ?? '<RemotionRiveCanvas>'}
durationInFrames={durationInFrames}
_experimentalControls={controls}
- _experimentalEffects={memoizedEffectDefinitions}
+ _remotionInternalEffects={memoizedEffectDefinitions}
// 'stack' is in props
{...props}
>
diff --git a/packages/studio-server/src/codemods/update-effect-props/update-effect-props.ts b/packages/studio-server/src/codemods/update-effect-props/update-effect-props.ts
index 55d39b272f..69d28cbe6c 100644
--- a/packages/studio-server/src/codemods/update-effect-props/update-effect-props.ts
+++ b/packages/studio-server/src/codemods/update-effect-props/update-effect-props.ts
@@ -45,7 +45,7 @@ const parseValueExpression = (value: unknown): ExpressionKind => {
return stmt.expression.right as ExpressionKind;
};
-const findExperimentalEffectsAttr = (
+const findEffectsAttr = (
attrs: readonly (JSXAttribute | unknown)[],
): JSXAttribute | null => {
for (const attr of attrs) {
@@ -54,10 +54,7 @@ const findExperimentalEffectsAttr = (
}
const a = attr as JSXAttribute;
- if (
- a.name.type === 'JSXIdentifier' &&
- a.name.name === '_experimentalEffects'
- ) {
+ if (a.name.type === 'JSXIdentifier' && a.name.name === 'effects') {
return a;
}
}
@@ -199,11 +196,9 @@ export const updateEffectPropsAst = ({
);
}
- const attr = findExperimentalEffectsAttr(jsx.attributes ?? []);
+ const attr = findEffectsAttr(jsx.attributes ?? []);
if (!attr) {
- throw new Error(
- 'Could not find _experimentalEffects on the target JSX element',
- );
+ throw new Error('Could not find effects on the target JSX element');
}
const found = findEffectCallExpression({
diff --git a/packages/studio-server/src/preview-server/dev-middleware/setup-output-filesystem.ts b/packages/studio-server/src/preview-server/dev-middleware/setup-output-filesystem.ts
index 7d624193c4..2499b9d6f1 100644
--- a/packages/studio-server/src/preview-server/dev-middleware/setup-output-filesystem.ts
+++ b/packages/studio-server/src/preview-server/dev-middleware/setup-output-filesystem.ts
@@ -4,8 +4,10 @@ import type {DevMiddlewareContext} from './types';
export function setupOutputFileSystem(context: DevMiddlewareContext) {
const outputFileSystem = memfs.createFsFromVolume(new memfs.Volume());
- // @ts-expect-error output file sytem
- context.compiler.outputFileSystem = outputFileSystem;
+ context.compiler.outputFileSystem =
+ outputFileSystem as unknown as NonNullable<
+ typeof context.compiler.outputFileSystem
+ >;
context.outputFileSystem = outputFileSystem;
}
diff --git a/packages/studio-server/src/preview-server/routes/can-update-effect-props.ts b/packages/studio-server/src/preview-server/routes/can-update-effect-props.ts
index eda2a60b69..e6a23ecf9e 100644
--- a/packages/studio-server/src/preview-server/routes/can-update-effect-props.ts
+++ b/packages/studio-server/src/preview-server/routes/can-update-effect-props.ts
@@ -25,18 +25,13 @@ import {
isStaticValue,
} from './can-update-sequence-props';
-const findExperimentalEffectsAttr = (
- jsx: JSXOpeningElement,
-): JSXAttribute | null => {
+const findEffectsAttr = (jsx: JSXOpeningElement): JSXAttribute | null => {
for (const attr of jsx.attributes) {
if (attr.type !== 'JSXAttribute') {
continue;
}
- if (
- attr.name.type === 'JSXIdentifier' &&
- attr.name.name === '_experimentalEffects'
- ) {
+ if (attr.name.type === 'JSXIdentifier' && attr.name.name === 'effects') {
return attr;
}
}
@@ -106,7 +101,7 @@ export const computeEffectPropStatus = ({
effectIndex: number;
keys: string[];
}): CanUpdateEffectPropsResponse => {
- const attr = findExperimentalEffectsAttr(jsx);
+ const attr = findEffectsAttr(jsx);
const elements = getEffectsArrayElements(attr);
if (!elements) {
diff --git a/packages/studio-server/src/test/compute-effect-props-status.test.ts b/packages/studio-server/src/test/compute-effect-props-status.test.ts
index 2341a6a8ad..a873f6acb2 100644
--- a/packages/studio-server/src/test/compute-effect-props-status.test.ts
+++ b/packages/studio-server/src/test/compute-effect-props-status.test.ts
@@ -7,11 +7,11 @@ import {lineColumnToNodePath} from './test-utils';
const buildInput = (
effects: string,
) => `import {HtmlInCanvas} from '@remotion/html-in-canvas';
-import {tint} from '@remotion/effects';
+import {EffectInternals} from '@remotion/effects';
export const Comp = () => {
\treturn (
-\t\t<HtmlInCanvas _experimentalEffects={${effects}}>
+\t\t<HtmlInCanvas effects={${effects}}>
\t\t\thi
\t\t</HtmlInCanvas>
\t);
@@ -29,7 +29,9 @@ const findJsx = (input: string) => {
};
test('computeEffectPropStatus reports static props as canUpdate=true with codeValue', () => {
- const input = buildInput('[tint({color: "red", opacity: 0.5})]');
+ const input = buildInput(
+ '[EffectInternals.tint({color: "red", opacity: 0.5})]',
+ );
const result = computeEffectPropStatus({
jsx: findJsx(input),
effectIndex: 0,
@@ -46,7 +48,9 @@ test('computeEffectPropStatus reports static props as canUpdate=true with codeVa
});
test('computeEffectPropStatus reports computed props', () => {
- const input = buildInput('[tint({color: getColor(), opacity: 0.5})]');
+ const input = buildInput(
+ '[EffectInternals.tint({color: getColor(), opacity: 0.5})]',
+ );
const result = computeEffectPropStatus({
jsx: findJsx(input),
effectIndex: 0,
@@ -63,7 +67,7 @@ test('computeEffectPropStatus reports computed props', () => {
});
test('computeEffectPropStatus reports unset props as undefined codeValue', () => {
- const input = buildInput('[tint({color: "red"})]');
+ const input = buildInput('[EffectInternals.tint({color: "red"})]');
const result = computeEffectPropStatus({
jsx: findJsx(input),
effectIndex: 0,
@@ -80,7 +84,9 @@ test('computeEffectPropStatus reports unset props as undefined codeValue', () =>
});
test('computeEffectPropStatus flags non-call expressions', () => {
- const input = buildInput('[someEffect, tint({color: "red"})]');
+ const input = buildInput(
+ '[someEffect, EffectInternals.tint({color: "red"})]',
+ );
const result = computeEffectPropStatus({
jsx: findJsx(input),
effectIndex: 0,
@@ -96,7 +102,7 @@ test('computeEffectPropStatus flags non-call expressions', () => {
});
test('computeEffectPropStatus flags out-of-range effect indices', () => {
- const input = buildInput('[tint({color: "red"})]');
+ const input = buildInput('[EffectInternals.tint({color: "red"})]');
const result = computeEffectPropStatus({
jsx: findJsx(input),
effectIndex: 5,
@@ -112,7 +118,7 @@ test('computeEffectPropStatus flags out-of-range effect indices', () => {
});
test('computeEffectPropStatus treats non-object first arg as computed', () => {
- const input = buildInput('[tint(getParams())]');
+ const input = buildInput('[EffectInternals.tint(getParams())]');
const result = computeEffectPropStatus({
jsx: findJsx(input),
effectIndex: 0,
@@ -128,7 +134,7 @@ test('computeEffectPropStatus treats non-object first arg as computed', () => {
});
test('computeEffectPropStatus treats zero-arg effect as editable with undefined props', () => {
- const input = buildInput('[tint()]');
+ const input = buildInput('[EffectInternals.tint()]');
const result = computeEffectPropStatus({
jsx: findJsx(input),
effectIndex: 0,
diff --git a/packages/studio-server/src/test/update-effect-props.test.ts b/packages/studio-server/src/test/update-effect-props.test.ts
index 11b7550024..5c78c50579 100644
--- a/packages/studio-server/src/test/update-effect-props.test.ts
+++ b/packages/studio-server/src/test/update-effect-props.test.ts
@@ -5,11 +5,11 @@ import {lineColumnToNodePath} from './test-utils';
const buildInput = (
effects: string,
) => `import {HtmlInCanvas} from '@remotion/html-in-canvas';
-import {tint} from '@remotion/effects';
+import {EffectInternals} from '@remotion/effects';
export const Comp = () => {
\treturn (
-\t\t<HtmlInCanvas _experimentalEffects={${effects}}>
+\t\t<HtmlInCanvas effects={${effects}}>
\t\t\thi
\t\t</HtmlInCanvas>
\t);
@@ -17,7 +17,9 @@ export const Comp = () => {
`;
test('updateEffectProps updates an existing prop on the right effect', () => {
- const input = buildInput('[tint({color: "red", opacity: 0.5})]');
+ const input = buildInput(
+ '[EffectInternals.tint({color: "red", opacity: 0.5})]',
+ );
const {serialized} = updateEffectPropsAst({
input,
sequenceNodePath: lineColumnToNodePath(input, 6),
@@ -30,7 +32,7 @@ test('updateEffectProps updates an existing prop on the right effect', () => {
});
test('updateEffectProps adds a missing prop', () => {
- const input = buildInput('[tint({color: "red"})]');
+ const input = buildInput('[EffectInternals.tint({color: "red"})]');
const {serialized, effectCallee} = updateEffectPropsAst({
input,
sequenceNodePath: lineColumnToNodePath(input, 6),
@@ -44,7 +46,9 @@ test('updateEffectProps adds a missing prop', () => {
});
test('updateEffectProps removes a prop equal to default', () => {
- const input = buildInput('[tint({color: "red", opacity: 0.5})]');
+ const input = buildInput(
+ '[EffectInternals.tint({color: "red", opacity: 0.5})]',
+ );
const {serialized} = updateEffectPropsAst({
input,
sequenceNodePath: lineColumnToNodePath(input, 6),
@@ -58,7 +62,7 @@ test('updateEffectProps removes a prop equal to default', () => {
test('updateEffectProps targets the correct effect by index when there are multiple', () => {
const input = buildInput(
- '[tint({color: "red"}), tint({color: "green", opacity: 0.4})]',
+ '[EffectInternals.tint({color: "red"}), EffectInternals.tint({color: "green", opacity: 0.4})]',
);
const {serialized} = updateEffectPropsAst({
input,
@@ -73,7 +77,7 @@ test('updateEffectProps targets the correct effect by index when there are multi
});
test('updateEffectProps throws when effect index is out of range', () => {
- const input = buildInput('[tint({color: "red"})]');
+ const input = buildInput('[EffectInternals.tint({color: "red"})]');
expect(() => {
updateEffectPropsAst({
input,
@@ -85,7 +89,7 @@ test('updateEffectProps throws when effect index is out of range', () => {
});
test('updateEffectProps inserts object literal when effect has no arguments', () => {
- const input = buildInput('[tint()]');
+ const input = buildInput('[EffectInternals.tint()]');
const {serialized} = updateEffectPropsAst({
input,
sequenceNodePath: lineColumnToNodePath(input, 6),
@@ -98,7 +102,7 @@ test('updateEffectProps inserts object literal when effect has no arguments', ()
});
test('updateEffectProps throws when first arg is not an object literal', () => {
- const input = buildInput('[tint(getParams())]');
+ const input = buildInput('[EffectInternals.tint(getParams())]');
expect(() => {
updateEffectPropsAst({
input,
diff --git a/packages/transitions/src/html-in-canvas-presentation.tsx b/packages/transitions/src/html-in-canvas-presentation.tsx
index a995308aae..fee69dd985 100644
--- a/packages/transitions/src/html-in-canvas-presentation.tsx
+++ b/packages/transitions/src/html-in-canvas-presentation.tsx
@@ -21,12 +21,12 @@ export const HtmlInCanvasPresentation = <
presentationProgress,
presentationDirection,
shader,
- _experimentalEffects,
+ effects,
passedProps,
bothEnteringAndExiting,
}: TransitionPresentationComponentProps<TPassedProps> & {
readonly shader: HtmlInCanvasShader<TPassedProps>;
- readonly _experimentalEffects?: EffectsProp;
+ readonly effects?: EffectsProp;
}) => {
if (!HtmlInCanvas.isSupported()) {
throw new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE);
@@ -51,7 +51,7 @@ export const HtmlInCanvasPresentation = <
passedPropsRef.current = passedProps;
const memoizedEffects = Internals.useMemoizedEffects({
- effects: _experimentalEffects ?? [],
+ effects: effects ?? [],
overrideId: null,
});
@@ -228,17 +228,17 @@ export const makeHtmlInCanvasPresentation = <
>(
shader: HtmlInCanvasShader<TPassedProps>,
) => {
- type AugmentedProps = TPassedProps & {_experimentalEffects?: EffectsProp};
+ type AugmentedProps = TPassedProps & {effects?: EffectsProp};
const CompWithShader: React.FC<
TransitionPresentationComponentProps<AugmentedProps>
> = (props) => {
const {passedProps, ...otherProps} = props;
- const {_experimentalEffects, ...restPassedProps} = props.passedProps;
+ const {effects, ...restPassedProps} = props.passedProps;
return (
<HtmlInCanvasPresentation
shader={shader}
passedProps={restPassedProps as TPassedProps}
- _experimentalEffects={_experimentalEffects}
+ effects={effects}
{...otherProps}
/>
);