remotion 4.0.148 → 4.0.150
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.ts +45 -0
- package/dist/cjs/Img.js +2 -1
- package/dist/cjs/audio/AudioForRendering.js +2 -1
- package/dist/cjs/get-remotion-environment.js +7 -4
- package/dist/cjs/use-media-in-timeline.js +4 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/VideoForRendering.js +4 -2
- package/dist/cjs/video/props.d.ts +1 -0
- package/dist/esm/index.mjs +5747 -5217
- package/dist/esm/no-react.mjs +692 -748
- package/dist/esm/version.mjs +5 -9
- package/ensure-correct-version.ts +3 -2
- package/package.json +2 -5
- package/rollup-no-react.config.js +0 -22
package/bundle.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {build, revision} from 'bun';
|
|
2
|
+
|
|
3
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4
|
+
throw new Error('This script must be run using NODE_ENV=production');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
if (!revision.startsWith('07ce')) {
|
|
8
|
+
// eslint-disable-next-line no-console
|
|
9
|
+
console.warn('warn: Remotion currently uses a fork of Bun to bundle.');
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
console.log(
|
|
12
|
+
'You dont currently run the fork, this could lead to duplicate key warnings in React.',
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const output = await build({
|
|
17
|
+
entrypoints: ['src/index.ts'],
|
|
18
|
+
naming: '[name].mjs',
|
|
19
|
+
target: 'browser',
|
|
20
|
+
external: ['remotion', 'remotion/no-react', 'react', 'react-dom'],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const [file] = output.outputs;
|
|
24
|
+
const text = await file.text();
|
|
25
|
+
await Bun.write('dist/esm/index.mjs', text);
|
|
26
|
+
|
|
27
|
+
const versionOutput = await build({
|
|
28
|
+
entrypoints: ['src/version.ts'],
|
|
29
|
+
naming: '[name].mjs',
|
|
30
|
+
target: 'browser',
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const [versionFile] = versionOutput.outputs;
|
|
34
|
+
await Bun.write('dist/esm/version.mjs', await versionFile.text());
|
|
35
|
+
|
|
36
|
+
const noReactOutput = await build({
|
|
37
|
+
entrypoints: ['src/no-react.ts'],
|
|
38
|
+
naming: '[name].mjs',
|
|
39
|
+
target: 'browser',
|
|
40
|
+
external: ['remotion', 'react', 'react-dom'],
|
|
41
|
+
});
|
|
42
|
+
const [noReactFile] = noReactOutput.outputs;
|
|
43
|
+
await Bun.write('dist/esm/no-react.mjs', await noReactFile.text());
|
|
44
|
+
|
|
45
|
+
export {};
|
package/dist/cjs/Img.js
CHANGED
|
@@ -68,7 +68,8 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, pauseWhenLoading, dela
|
|
|
68
68
|
const isPremounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premounting);
|
|
69
69
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
70
70
|
(0, react_1.useLayoutEffect)(() => {
|
|
71
|
-
|
|
71
|
+
var _a, _b;
|
|
72
|
+
if (((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'test') {
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
75
|
const newHandle = (0, delay_render_js_1.delayRender)('Loading <Img> with src=' + actualSrc, {
|
|
@@ -89,7 +89,8 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
89
89
|
const needsToRenderAudioTag = ref || _remotionInternalNeedsDurationCalculation;
|
|
90
90
|
// If audio source switches, make new handle
|
|
91
91
|
(0, react_1.useLayoutEffect)(() => {
|
|
92
|
-
|
|
92
|
+
var _a, _b;
|
|
93
|
+
if (((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'test') {
|
|
93
94
|
return;
|
|
94
95
|
}
|
|
95
96
|
if (!needsToRenderAudioTag) {
|
|
@@ -7,10 +7,13 @@ exports.getRemotionEnvironment = void 0;
|
|
|
7
7
|
*/
|
|
8
8
|
const getRemotionEnvironment = () => {
|
|
9
9
|
const isPlayer = typeof window !== 'undefined' && window.remotion_isPlayer;
|
|
10
|
-
const isRendering =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const isRendering = typeof window !== 'undefined' &&
|
|
11
|
+
typeof window.process !== 'undefined' &&
|
|
12
|
+
typeof window.process.env !== 'undefined' &&
|
|
13
|
+
(window.process.env.NODE_ENV === 'test' ||
|
|
14
|
+
(window.process.env.NODE_ENV === 'production' &&
|
|
15
|
+
typeof window !== 'undefined' &&
|
|
16
|
+
typeof window.remotion_puppeteerTimeout !== 'undefined'));
|
|
14
17
|
const isStudio = typeof window !== 'undefined' && window.remotion_isStudio;
|
|
15
18
|
return {
|
|
16
19
|
isStudio,
|
|
@@ -59,14 +59,15 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
59
59
|
}
|
|
60
60
|
}, [initialVolume, mediaType, src, volume]);
|
|
61
61
|
(0, react_1.useEffect)(() => {
|
|
62
|
-
var _a;
|
|
62
|
+
var _a, _b, _c;
|
|
63
63
|
if (!mediaRef.current) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
if (!src) {
|
|
67
67
|
throw new Error('No src passed');
|
|
68
68
|
}
|
|
69
|
-
if (!(0, get_remotion_environment_js_1.getRemotionEnvironment)().isStudio &&
|
|
69
|
+
if (!(0, get_remotion_environment_js_1.getRemotionEnvironment)().isStudio &&
|
|
70
|
+
((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) !== 'test') {
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
73
|
if (!showInTimeline) {
|
|
@@ -78,7 +79,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
78
79
|
id,
|
|
79
80
|
duration,
|
|
80
81
|
from: 0,
|
|
81
|
-
parent: (
|
|
82
|
+
parent: (_c = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _c !== void 0 ? _c : null,
|
|
82
83
|
displayName: displayName !== null && displayName !== void 0 ? displayName : (0, get_asset_file_name_js_1.getAssetDisplayName)(src),
|
|
83
84
|
rootId,
|
|
84
85
|
volume: volumes,
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -92,6 +92,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
92
92
|
return videoRef.current;
|
|
93
93
|
}, []);
|
|
94
94
|
(0, react_1.useEffect)(() => {
|
|
95
|
+
var _a, _b;
|
|
95
96
|
if (!window.remotion_videoEnabled) {
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
@@ -109,7 +110,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
109
110
|
retries: delayRenderRetries !== null && delayRenderRetries !== void 0 ? delayRenderRetries : undefined,
|
|
110
111
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds !== null && delayRenderTimeoutInMilliseconds !== void 0 ? delayRenderTimeoutInMilliseconds : undefined,
|
|
111
112
|
});
|
|
112
|
-
if (process.env.NODE_ENV === 'test') {
|
|
113
|
+
if (((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'test') {
|
|
113
114
|
(0, delay_render_js_1.continueRender)(handle);
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
@@ -173,7 +174,8 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
173
174
|
if (environment.isRendering) {
|
|
174
175
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
175
176
|
(0, react_1.useLayoutEffect)(() => {
|
|
176
|
-
|
|
177
|
+
var _a, _b;
|
|
178
|
+
if (((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'test') {
|
|
177
179
|
return;
|
|
178
180
|
}
|
|
179
181
|
const newHandle = (0, delay_render_js_1.delayRender)('Loading <Video> duration with src=' + src, {
|