Skip to content

🎥 Make videos programmatically with React

remotion: Remove deprecated outlineRef prop

Jonny Burgercb6f41f88ee8
diff --git a/packages/core/src/Sequence.tsx b/packages/core/src/Sequence.tsx
index 1528b3061a..c7cef0a246 100644
--- a/packages/core/src/Sequence.tsx
+++ b/packages/core/src/Sequence.tsx
@@ -162,11 +162,6 @@ export type SequencePropsWithoutDuration = {
type: 'image';
src: string;
};
- /**
- * @deprecated Remotion Studio discovers rendered elements automatically.
- * Remove this prop.
- */
- readonly outlineRef?: React.RefObject<Element | null> | null;
} & LayoutAndStyle;
export type SequenceProps = {
@@ -200,7 +195,6 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
_remotionInternalPremountDisplay: premountDisplay,
_remotionInternalPostmountDisplay: postmountDisplay,
_remotionInternalIsMedia: isMedia,
- outlineRef: passedRefForOutline,
cropLeft,
cropRight,
cropTop,
@@ -436,16 +430,14 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
const shouldDiscoverOutline = env.isStudio || canvasOutlinesEnabled;
const automaticOutlineRef = useMemo(
() =>
- shouldDiscoverOutline && layout === 'none' && !passedRefForOutline
+ shouldDiscoverOutline && layout === 'none'
? SequenceOutlineInternals.createRef()
: null,
- [shouldDiscoverOutline, layout, passedRefForOutline],
+ [shouldDiscoverOutline, layout],
);
const wrapperRefForOutline = useRef<HTMLDivElement | null>(null);
const refForOutline =
- other.layout === 'none'
- ? (passedRefForOutline ?? automaticOutlineRef)
- : (passedRefForOutline ?? wrapperRefForOutline);
+ layout === 'none' ? automaticOutlineRef : wrapperRefForOutline;
const premounting = useMemo(() => {
// || is intentional, ?? would not trigger on `false`
diff --git a/packages/core/src/sequence-outline.ts b/packages/core/src/sequence-outline.ts
index 6ccad94783..33c8bacaf6 100644
--- a/packages/core/src/sequence-outline.ts
+++ b/packages/core/src/sequence-outline.ts
@@ -6,7 +6,6 @@ type OutlineRef = RefObject<Element | null>;
export const SequenceOutlineContext = React.createContext(false);
-// Keep automatic groups separate from the public, single-element outlineRef.
// A group only exposes .current when it has exactly one element, so consumers
// that require an actual element never accidentally act on part of a group.
const nodesByRef = new WeakMap<OutlineRef, readonly OutlineNode[]>();
diff --git a/packages/core/src/test/sequence-register-once.test.tsx b/packages/core/src/test/sequence-register-once.test.tsx
index a13ab2de2a..ec7ba01fe5 100644
--- a/packages/core/src/test/sequence-register-once.test.tsx
+++ b/packages/core/src/test/sequence-register-once.test.tsx
@@ -468,46 +468,6 @@ test('Sequence registers its wrapper element for Studio outlines', () => {
expect(registeredSequences[0]?.refForOutline?.current).toBe(ref.current);
});
-test('Sequence uses outlineRef for Studio outlines', () => {
- const registeredSequences: TSequence[] = [];
- const outlineRef = React.createRef<HTMLDivElement>();
-
- render(
- <SequenceTestWrapper
- onRegisterSequence={(sequence) => {
- registeredSequences.push(sequence);
- }}
- >
- <Sequence outlineRef={outlineRef}>
- <div ref={outlineRef}>hi</div>
- </Sequence>
- </SequenceTestWrapper>,
- );
-
- expect(registeredSequences[0]?.refForOutline).toBe(outlineRef);
- expect(registeredSequences[0]?.refForOutline?.current?.tagName).toBe('DIV');
-});
-
-test('Sequence layout="none" uses outlineRef for Studio outlines', () => {
- const registeredSequences: TSequence[] = [];
- const outlineRef = React.createRef<HTMLDivElement>();
-
- render(
- <SequenceTestWrapper
- onRegisterSequence={(sequence) => {
- registeredSequences.push(sequence);
- }}
- >
- <Sequence layout="none" outlineRef={outlineRef}>
- <div ref={outlineRef}>hi</div>
- </Sequence>
- </SequenceTestWrapper>,
- );
-
- expect(registeredSequences[0]?.refForOutline).toBe(outlineRef);
- expect(registeredSequences[0]?.refForOutline?.current?.tagName).toBe('DIV');
-});
-
test('Series inherits Sequence controls', () => {
const registeredSequences: TSequence[] = [];
diff --git a/packages/docs/docs/sequence.mdx b/packages/docs/docs/sequence.mdx
index 6757a1666f..62387534b8 100644
--- a/packages/docs/docs/sequence.mdx
+++ b/packages/docs/docs/sequence.mdx
@@ -242,6 +242,8 @@ By default, your sequences will be absolutely positioned, so they will overlay e
If you would like to opt out of it and handle layouting yourself, pass `layout="none"`.
Available since v1.4.
+Remotion Studio discovers selection outlines automatically. By default, it outlines the wrapper created by `<Sequence>`. With `layout="none"`, it outlines the rendered element or the bounds of multiple rendered roots.
+
### `cropLeft?`<AvailableFrom v="4.0.500" />
Crops the Sequence from the left edge without changing its size or transform origin.
@@ -287,16 +289,6 @@ export const MyVideo = () => {
};
```
-### ~~`outlineRef?`~~<AvailableFrom v="4.0.479" />
-
-:::info Deprecated
-Remotion Studio discovers selection outlines automatically.
-Remove this prop.
-:::
-
-By default, the Studio outlines the wrapper created by `<Sequence>`.
-With `layout="none"`, it outlines the rendered element or the bounds of multiple rendered roots.
-
### `style?`<AvailableFrom v="3.0.27"/>
CSS styles to be applied to the container.
diff --git a/packages/shapes/src/test/effects.test.tsx b/packages/shapes/src/test/effects.test.tsx
index 58cbdaa42d..82f3495554 100644
--- a/packages/shapes/src/test/effects.test.tsx
+++ b/packages/shapes/src/test/effects.test.tsx
@@ -253,7 +253,6 @@ test('Should render a shape with effects in HtmlInCanvas', async () => {
'https://www.remotion.dev/docs/shapes/circle',
_remotionInternalEffects: effectDefinitions,
});
- expect(sequenceCalls[0]).not.toHaveProperty('outlineRef');
});
test('Should keep rendering SVG directly with no effects', async () => {
@@ -286,7 +285,6 @@ test('Should keep rendering SVG directly with no effects', async () => {
_remotionInternalDocumentationLink:
'https://www.remotion.dev/docs/shapes/circle',
});
- expect(sequenceCalls[0]).not.toHaveProperty('outlineRef');
});
test('Should pass integer dimensions to HtmlInCanvas', async () => {