@remotion/vercel 4.0.536 → 4.0.538

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.
@@ -1,5 +1,5 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
- export declare function addBundleToSandbox({ sandbox, bundleDir }: {
2
+ export declare function addBundleToSandbox({ sandbox, bundleDir, }: {
3
3
  sandbox: Sandbox;
4
4
  bundleDir: string;
5
5
  }): Promise<void>;
@@ -2,7 +2,7 @@ import type { Sandbox } from '@vercel/sandbox';
2
2
  import type { CreateSandboxOnProgress, VercelSandbox } from './types';
3
3
  type CreateSandboxResources = NonNullable<NonNullable<Parameters<typeof Sandbox.create>[0]>['resources']>;
4
4
  export declare const SANDBOX_CREATING_TIMEOUT: number;
5
- export declare function createSandbox({ onProgress, resources, timeoutInMilliseconds }?: {
5
+ export declare function createSandbox({ onProgress, resources, timeoutInMilliseconds, }?: {
6
6
  onProgress?: CreateSandboxOnProgress;
7
7
  resources?: CreateSandboxResources;
8
8
  timeoutInMilliseconds?: number;
@@ -426,27 +426,30 @@ function springCalculation({
426
426
  stiffness: config.stiffness ?? defaultSpringConfig.stiffness,
427
427
  overshootClamping: config.overshootClamping ?? defaultSpringConfig.overshootClamping
428
428
  };
429
- const cacheKey = [
430
- frame,
429
+ const configKey = [
431
430
  fps,
432
431
  resolvedConfig.damping,
433
432
  resolvedConfig.mass,
434
433
  resolvedConfig.overshootClamping,
435
434
  resolvedConfig.stiffness
436
435
  ].join("-");
436
+ const cacheKey = \`\${frame}-\${configKey}\`;
437
437
  if (calculationCache[cacheKey]) {
438
438
  return calculationCache[cacheKey];
439
439
  }
440
- let animation = {
440
+ const frameClamped = Math.max(0, frame);
441
+ const previousFrame = Math.ceil(frameClamped) - 1;
442
+ const previousAnimation = previousFrame >= 0 ? calculationCache[\`\${previousFrame}-\${configKey}\`] : undefined;
443
+ let animation = previousAnimation ?? {
441
444
  lastTimestamp: 0,
442
445
  current: from,
443
446
  toValue: to,
444
447
  velocity: 0,
445
448
  prevPosition: 0
446
449
  };
447
- const frameClamped = Math.max(0, frame);
448
450
  const unevenRest = frameClamped % 1;
449
- for (let f = 0;f <= Math.floor(frameClamped); f++) {
451
+ const startFrame = previousAnimation ? previousFrame + 1 : 0;
452
+ for (let f = startFrame;f <= Math.floor(frameClamped); f++) {
450
453
  const time = f / fps * 1000;
451
454
  animation = advance({
452
455
  animation,
@@ -580,6 +583,7 @@ function spring({
580
583
  }
581
584
  var clampUnit = (t) => Math.min(1, Math.max(0, t));
582
585
  var springEasingDurationInFrames = 30;
586
+ var easeBezier = null;
583
587
 
584
588
  class Easing {
585
589
  static step0(n) {
@@ -592,7 +596,8 @@ class Easing {
592
596
  return t;
593
597
  }
594
598
  static ease(t) {
595
- return Easing.bezier(0.42, 0, 1, 1)(t);
599
+ easeBezier ??= Easing.bezier(0.42, 0, 1, 1);
600
+ return easeBezier(t);
596
601
  }
597
602
  static quad(t) {
598
603
  return t * t;
@@ -1990,23 +1995,23 @@ var MODERN_VALUE = "(?:none|[-+]?\\\\d*\\\\.?\\\\d+(?:%|deg|rad|grad|turn)?)";
1990
1995
  function modernColorCall(name) {
1991
1996
  return new RegExp(name + "\\\\(\\\\s*(" + MODERN_VALUE + ")\\\\s+(" + MODERN_VALUE + ")\\\\s+(" + MODERN_VALUE + ")(?:\\\\s*\\\\/\\\\s*(" + MODERN_VALUE + "))?\\\\s*\\\\)");
1992
1997
  }
1998
+ var cachedMatchers = {
1999
+ rgb: undefined,
2000
+ rgba: undefined,
2001
+ hsl: undefined,
2002
+ hsla: undefined,
2003
+ hex3: undefined,
2004
+ hex4: undefined,
2005
+ hex5: undefined,
2006
+ hex6: undefined,
2007
+ hex8: undefined,
2008
+ oklch: undefined,
2009
+ oklab: undefined,
2010
+ lab: undefined,
2011
+ lch: undefined,
2012
+ hwb: undefined
2013
+ };
1993
2014
  function getMatchers() {
1994
- const cachedMatchers = {
1995
- rgb: undefined,
1996
- rgba: undefined,
1997
- hsl: undefined,
1998
- hsla: undefined,
1999
- hex3: undefined,
2000
- hex4: undefined,
2001
- hex5: undefined,
2002
- hex6: undefined,
2003
- hex8: undefined,
2004
- oklch: undefined,
2005
- oklab: undefined,
2006
- lab: undefined,
2007
- lch: undefined,
2008
- hwb: undefined
2009
- };
2010
2015
  if (cachedMatchers.rgb === undefined) {
2011
2016
  cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
2012
2017
  cachedMatchers.rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
@@ -2544,12 +2549,12 @@ function validateDurationInFrames(durationInFrames, options) {
2544
2549
  if (durationInFrames <= 0) {
2545
2550
  throw new TypeError(\`The "durationInFrames" prop \${component} must be positive, but got \${durationInFrames}.\`);
2546
2551
  }
2547
- if (!allowFloats && durationInFrames % 1 !== 0) {
2548
- throw new TypeError(\`The "durationInFrames" prop \${component} must be an integer, but got \${durationInFrames}.\`);
2549
- }
2550
2552
  if (!Number.isFinite(durationInFrames)) {
2551
2553
  throw new TypeError(\`The "durationInFrames" prop \${component} must be finite, but got \${durationInFrames}.\`);
2552
2554
  }
2555
+ if (!allowFloats && durationInFrames % 1 !== 0) {
2556
+ throw new TypeError(\`The "durationInFrames" prop \${component} must be an integer, but got \${durationInFrames}.\`);
2557
+ }
2553
2558
  }
2554
2559
  var getExpectedMediaFrameUncorrected = ({
2555
2560
  frame,
@@ -3040,27 +3045,30 @@ function springCalculation({
3040
3045
  stiffness: config.stiffness ?? defaultSpringConfig.stiffness,
3041
3046
  overshootClamping: config.overshootClamping ?? defaultSpringConfig.overshootClamping
3042
3047
  };
3043
- const cacheKey = [
3044
- frame,
3048
+ const configKey = [
3045
3049
  fps,
3046
3050
  resolvedConfig.damping,
3047
3051
  resolvedConfig.mass,
3048
3052
  resolvedConfig.overshootClamping,
3049
3053
  resolvedConfig.stiffness
3050
3054
  ].join("-");
3055
+ const cacheKey = \`\${frame}-\${configKey}\`;
3051
3056
  if (calculationCache[cacheKey]) {
3052
3057
  return calculationCache[cacheKey];
3053
3058
  }
3054
- let animation = {
3059
+ const frameClamped = Math.max(0, frame);
3060
+ const previousFrame = Math.ceil(frameClamped) - 1;
3061
+ const previousAnimation = previousFrame >= 0 ? calculationCache[\`\${previousFrame}-\${configKey}\`] : undefined;
3062
+ let animation = previousAnimation ?? {
3055
3063
  lastTimestamp: 0,
3056
3064
  current: from,
3057
3065
  toValue: to,
3058
3066
  velocity: 0,
3059
3067
  prevPosition: 0
3060
3068
  };
3061
- const frameClamped = Math.max(0, frame);
3062
3069
  const unevenRest = frameClamped % 1;
3063
- for (let f = 0;f <= Math.floor(frameClamped); f++) {
3070
+ const startFrame = previousAnimation ? previousFrame + 1 : 0;
3071
+ for (let f = startFrame;f <= Math.floor(frameClamped); f++) {
3064
3072
  const time = f / fps * 1000;
3065
3073
  animation = advance({
3066
3074
  animation,
@@ -3194,6 +3202,7 @@ function spring({
3194
3202
  }
3195
3203
  var clampUnit = (t) => Math.min(1, Math.max(0, t));
3196
3204
  var springEasingDurationInFrames = 30;
3205
+ var easeBezier = null;
3197
3206
 
3198
3207
  class Easing {
3199
3208
  static step0(n) {
@@ -3206,7 +3215,8 @@ class Easing {
3206
3215
  return t;
3207
3216
  }
3208
3217
  static ease(t) {
3209
- return Easing.bezier(0.42, 0, 1, 1)(t);
3218
+ easeBezier ??= Easing.bezier(0.42, 0, 1, 1);
3219
+ return easeBezier(t);
3210
3220
  }
3211
3221
  static quad(t) {
3212
3222
  return t * t;
@@ -4604,23 +4614,23 @@ var MODERN_VALUE = "(?:none|[-+]?\\\\d*\\\\.?\\\\d+(?:%|deg|rad|grad|turn)?)";
4604
4614
  function modernColorCall(name) {
4605
4615
  return new RegExp(name + "\\\\(\\\\s*(" + MODERN_VALUE + ")\\\\s+(" + MODERN_VALUE + ")\\\\s+(" + MODERN_VALUE + ")(?:\\\\s*\\\\/\\\\s*(" + MODERN_VALUE + "))?\\\\s*\\\\)");
4606
4616
  }
4617
+ var cachedMatchers = {
4618
+ rgb: undefined,
4619
+ rgba: undefined,
4620
+ hsl: undefined,
4621
+ hsla: undefined,
4622
+ hex3: undefined,
4623
+ hex4: undefined,
4624
+ hex5: undefined,
4625
+ hex6: undefined,
4626
+ hex8: undefined,
4627
+ oklch: undefined,
4628
+ oklab: undefined,
4629
+ lab: undefined,
4630
+ lch: undefined,
4631
+ hwb: undefined
4632
+ };
4607
4633
  function getMatchers() {
4608
- const cachedMatchers = {
4609
- rgb: undefined,
4610
- rgba: undefined,
4611
- hsl: undefined,
4612
- hsla: undefined,
4613
- hex3: undefined,
4614
- hex4: undefined,
4615
- hex5: undefined,
4616
- hex6: undefined,
4617
- hex8: undefined,
4618
- oklch: undefined,
4619
- oklab: undefined,
4620
- lab: undefined,
4621
- lch: undefined,
4622
- hwb: undefined
4623
- };
4624
4634
  if (cachedMatchers.rgb === undefined) {
4625
4635
  cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
4626
4636
  cachedMatchers.rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
@@ -5158,12 +5168,12 @@ function validateDurationInFrames(durationInFrames, options) {
5158
5168
  if (durationInFrames <= 0) {
5159
5169
  throw new TypeError(\`The "durationInFrames" prop \${component} must be positive, but got \${durationInFrames}.\`);
5160
5170
  }
5161
- if (!allowFloats && durationInFrames % 1 !== 0) {
5162
- throw new TypeError(\`The "durationInFrames" prop \${component} must be an integer, but got \${durationInFrames}.\`);
5163
- }
5164
5171
  if (!Number.isFinite(durationInFrames)) {
5165
5172
  throw new TypeError(\`The "durationInFrames" prop \${component} must be finite, but got \${durationInFrames}.\`);
5166
5173
  }
5174
+ if (!allowFloats && durationInFrames % 1 !== 0) {
5175
+ throw new TypeError(\`The "durationInFrames" prop \${component} must be an integer, but got \${durationInFrames}.\`);
5176
+ }
5167
5177
  }
5168
5178
  var getExpectedMediaFrameUncorrected = ({
5169
5179
  frame,
@@ -1,5 +1,5 @@
1
1
  import type { RenderProgress } from './types';
2
- export declare function getRenderProgress({ sandboxId, cmdId }: {
2
+ export declare function getRenderProgress({ sandboxId, cmdId, }: {
3
3
  sandboxId: string;
4
4
  cmdId: string;
5
5
  }): Promise<RenderProgress>;
@@ -1,2 +1,3 @@
1
+ import { Sandbox } from '@vercel/sandbox';
1
2
  import type { VercelSandbox } from '../types';
2
- export declare const createDisposableSandbox: (options: (import("@vercel/sandbox/dist/utils/types").WithPrivate<import("@vercel/sandbox/dist/sandbox").CreateSandboxParams | (import("@vercel/sandbox/dist/sandbox").CreateSandboxParams & import("@vercel/sandbox/dist/utils/get-credentials").Credentials)> & import("@vercel/sandbox/dist/api-client/api-client").WithFetchOptions) | undefined) => Promise<VercelSandbox>;
3
+ export declare const createDisposableSandbox: (options: Parameters<typeof Sandbox.create>[0]) => Promise<VercelSandbox>;
@@ -2,5 +2,5 @@ export declare const formatSandboxError: (error: unknown) => string;
2
2
  export declare const rethrowSandboxError: ({ error, operation, sandboxPath, }: {
3
3
  error: unknown;
4
4
  operation: string;
5
- sandboxPath?: string | undefined;
5
+ sandboxPath?: string;
6
6
  }) => never;
@@ -1,5 +1,5 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
- export declare function installBrowser({ sandbox, onProgress }: {
2
+ export declare function installBrowser({ sandbox, onProgress, }: {
3
3
  sandbox: Sandbox;
4
4
  onProgress: (progress: number) => Promise<void>;
5
5
  }): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
- export declare function installJsDependencies({ sandbox }: {
2
+ export declare function installJsDependencies({ sandbox, }: {
3
3
  sandbox: Sandbox;
4
4
  }): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
- export declare function installSystemDependencies({ sandbox, onProgress }: {
2
+ export declare function installSystemDependencies({ sandbox, onProgress, }: {
3
3
  sandbox: Sandbox;
4
4
  onProgress: (progress: number) => Promise<void>;
5
5
  }): Promise<void>;
@@ -9,6 +9,6 @@ import type { Sandbox } from '@vercel/sandbox';
9
9
  *
10
10
  * Only the `remotion` binary needs patching - ffmpeg/ffprobe work fine on glibc 2.34.
11
11
  */
12
- export declare function patchCompositor({ sandbox }: {
12
+ export declare function patchCompositor({ sandbox, }: {
13
13
  sandbox: Sandbox;
14
14
  }): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
2
  import type { ChromiumOptions, LogLevel, RenderStillOnVercelProgress, StillImageFormat } from './types';
3
- export declare function renderStillOnVercel({ sandbox, compositionId, inputProps, onProgress, outputFile, frame, imageFormat, jpegQuality, envVariables, chromiumOptions, scale, logLevel, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, offthreadVideoThreads, licenseKey }: {
3
+ export declare function renderStillOnVercel({ sandbox, compositionId, inputProps, onProgress, outputFile, frame, imageFormat, jpegQuality, envVariables, chromiumOptions, scale, logLevel, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, offthreadVideoThreads, licenseKey, }: {
4
4
  sandbox: Sandbox;
5
5
  compositionId: string;
6
6
  inputProps: Record<string, unknown>;
@@ -1,6 +1,6 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
2
  import type { VercelBlobAccess } from './types';
3
- export declare function uploadToVercelBlob({ sandbox, sandboxFilePath, blobPath, contentType, blobToken, access }: {
3
+ export declare function uploadToVercelBlob({ sandbox, sandboxFilePath, blobPath, contentType, blobToken, access, }: {
4
4
  sandbox: Sandbox;
5
5
  sandboxFilePath: string;
6
6
  blobPath?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/vercel",
3
- "version": "4.0.536",
3
+ "version": "4.0.538",
4
4
  "description": "Render Remotion videos on Vercel Sandbox",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "formatting": "oxfmt src --check",
14
14
  "format": "oxfmt src",
15
15
  "lint": "eslint src",
16
- "watch": "tsgo -w",
17
- "make": "bun --env-file=../.env.bundle bundle.ts && tsgo && bun check -p tsconfig.scripts.json"
16
+ "watch": "tsc -w",
17
+ "make": "bun --env-file=../.env.bundle bundle.ts && tsc && bun check -p tsconfig.scripts.json"
18
18
  },
19
19
  "author": "Jonny Burger <jonny@remotion.dev>",
20
20
  "contributors": [],
@@ -23,8 +23,8 @@
23
23
  "url": "https://github.com/remotion-dev/remotion/issues"
24
24
  },
25
25
  "dependencies": {
26
- "@remotion/renderer": "4.0.536",
27
- "remotion": "4.0.536"
26
+ "@remotion/renderer": "4.0.538",
27
+ "remotion": "4.0.538"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@vercel/sandbox": ">=1.0.0"
@@ -38,11 +38,11 @@
38
38
  "./package.json": "./package.json"
39
39
  },
40
40
  "devDependencies": {
41
- "@remotion/eslint-config-internal": "4.0.536",
41
+ "@remotion/eslint-config-internal": "4.0.538",
42
42
  "@vercel/blob": "2.3.0",
43
43
  "@vercel/sandbox": "1.6.0",
44
44
  "eslint": "9.19.0",
45
- "@typescript/native-preview": "7.0.0-dev.20260217.1"
45
+ "typescript": "7.1.0-beta"
46
46
  },
47
47
  "keywords": [
48
48
  "remotion",