@remotion/renderer 4.0.287 → 4.0.288

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.
Files changed (2) hide show
  1. package/ensure-browser.mjs +47 -40
  2. package/package.json +12 -12
@@ -412,8 +412,7 @@ var require_browser = __commonJS((exports, module) => {
412
412
  });
413
413
  args.splice(lastC, 0, c);
414
414
  }
415
- exports.log = console.debug || console.log || (() => {
416
- });
415
+ exports.log = console.debug || console.log || (() => {});
417
416
  function save(namespaces) {
418
417
  try {
419
418
  if (namespaces) {
@@ -421,15 +420,13 @@ var require_browser = __commonJS((exports, module) => {
421
420
  } else {
422
421
  exports.storage.removeItem("debug");
423
422
  }
424
- } catch (error) {
425
- }
423
+ } catch (error) {}
426
424
  }
427
425
  function load() {
428
426
  let r;
429
427
  try {
430
428
  r = exports.storage.getItem("debug");
431
- } catch (error) {
432
- }
429
+ } catch (error) {}
433
430
  if (!r && typeof process !== "undefined" && "env" in process) {
434
431
  r = process.env.DEBUG;
435
432
  }
@@ -438,8 +435,7 @@ var require_browser = __commonJS((exports, module) => {
438
435
  function localstorage() {
439
436
  try {
440
437
  return localStorage;
441
- } catch (error) {
442
- }
438
+ } catch (error) {}
443
439
  }
444
440
  module.exports = require_common()(exports);
445
441
  var { formatters } = module.exports;
@@ -571,8 +567,7 @@ var require_node = __commonJS((exports, module) => {
571
567
  exports.save = save;
572
568
  exports.load = load;
573
569
  exports.useColors = useColors;
574
- exports.destroy = util.deprecate(() => {
575
- }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
570
+ exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
576
571
  exports.colors = [6, 2, 3, 4, 5, 1];
577
572
  try {
578
573
  const supportsColor = require_supports_color();
@@ -656,8 +651,7 @@ var require_node = __commonJS((exports, module) => {
656
651
  221
657
652
  ];
658
653
  }
659
- } catch (error) {
660
- }
654
+ } catch (error) {}
661
655
  exports.inspectOpts = Object.keys(process.env).filter((key) => {
662
656
  return /^debug_/i.test(key);
663
657
  }).reduce((obj, key) => {
@@ -818,8 +812,7 @@ var require_once = __commonJS((exports, module) => {
818
812
  // ../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
819
813
  var require_end_of_stream = __commonJS((exports, module) => {
820
814
  var once = require_once();
821
- var noop = function() {
822
- };
815
+ var noop = function() {};
823
816
  var isRequest = function(stream) {
824
817
  return stream.setHeader && typeof stream.abort === "function";
825
818
  };
@@ -913,8 +906,7 @@ var require_pump = __commonJS((exports, module) => {
913
906
  var once = require_once();
914
907
  var eos = require_end_of_stream();
915
908
  var fs = __require("fs");
916
- var noop = function() {
917
- };
909
+ var noop = function() {};
918
910
  var ancient = /^v?\.0/.test(process.version);
919
911
  var isFn = function(fn) {
920
912
  return typeof fn === "function";
@@ -2207,8 +2199,7 @@ var require_yauzl = __commonJS((exports) => {
2207
2199
  }
2208
2200
  });
2209
2201
  };
2210
- function Entry() {
2211
- }
2202
+ function Entry() {}
2212
2203
  Entry.prototype.getLastModDate = function() {
2213
2204
  return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
2214
2205
  };
@@ -2826,13 +2817,15 @@ var getClient = (url) => {
2826
2817
  var readFileWithoutRedirect = (url) => {
2827
2818
  return new Promise((resolve, reject) => {
2828
2819
  const client = getClient(url);
2829
- client(url, typeof Bun === "undefined" ? {
2820
+ const req = client(url, typeof Bun === "undefined" ? {
2830
2821
  headers: {
2831
2822
  "user-agent": "Mozilla/5.0 (@remotion/renderer - https://remotion.dev)"
2832
2823
  }
2833
2824
  } : {}, (res) => {
2834
- resolve(res);
2835
- }).on("error", (err) => {
2825
+ resolve({ request: req, response: res });
2826
+ });
2827
+ req.on("error", (err) => {
2828
+ req.destroy();
2836
2829
  return reject(err);
2837
2830
  });
2838
2831
  });
@@ -2841,19 +2834,23 @@ var readFile = async (url, redirectsSoFar = 0) => {
2841
2834
  if (redirectsSoFar > 10) {
2842
2835
  throw new Error(`Too many redirects while downloading ${url}`);
2843
2836
  }
2844
- const file = await readFileWithoutRedirect(url);
2845
- if (redirectStatusCodes.includes(file.statusCode)) {
2846
- if (!file.headers.location) {
2847
- throw new Error(`Received a status code ${file.statusCode} but no "Location" header while calling ${file.headers.location}`);
2837
+ const { request, response } = await readFileWithoutRedirect(url);
2838
+ if (redirectStatusCodes.includes(response.statusCode)) {
2839
+ if (!response.headers.location) {
2840
+ throw new Error(`Received a status code ${response.statusCode} but no "Location" header while calling ${response.headers.location}`);
2848
2841
  }
2849
2842
  const { origin } = new URL(url);
2850
- const redirectUrl = new URL(file.headers.location, origin).toString();
2843
+ const redirectUrl = new URL(response.headers.location, origin).toString();
2844
+ request.destroy();
2845
+ response.destroy();
2851
2846
  return readFile(redirectUrl, redirectsSoFar + 1);
2852
2847
  }
2853
- if (file.statusCode >= 400) {
2854
- const body = await tryToObtainBody(file);
2848
+ if (response.statusCode >= 400) {
2849
+ const body = await tryToObtainBody(response);
2850
+ request.destroy();
2851
+ response.destroy();
2855
2852
  throw new Error([
2856
- `Received a status code of ${file.statusCode} while downloading file ${url}.`,
2853
+ `Received a status code of ${response.statusCode} while downloading file ${url}.`,
2857
2854
  body ? `The response body was:` : null,
2858
2855
  body ? `---` : null,
2859
2856
  body ? body : null,
@@ -2861,7 +2858,7 @@ var readFile = async (url, redirectsSoFar = 0) => {
2861
2858
  ].filter(truthy).join(`
2862
2859
  `));
2863
2860
  }
2864
- return file;
2861
+ return { request, response };
2865
2862
  };
2866
2863
  var tryToObtainBody = async (file) => {
2867
2864
  const success = new Promise((resolve) => {
@@ -2923,12 +2920,19 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2923
2920
  };
2924
2921
  refreshTimeout();
2925
2922
  let finishEventSent = false;
2926
- readFile(url).then((res) => {
2927
- const contentDisposition = res.headers["content-disposition"] ?? null;
2928
- const contentType = res.headers["content-type"] ?? null;
2923
+ let closeConnection = () => {
2924
+ return;
2925
+ };
2926
+ readFile(url).then(({ response, request }) => {
2927
+ closeConnection = () => {
2928
+ request.destroy();
2929
+ response.destroy();
2930
+ };
2931
+ const contentDisposition = response.headers["content-disposition"] ?? null;
2932
+ const contentType = response.headers["content-type"] ?? null;
2929
2933
  const to = toFn(contentDisposition, contentType);
2930
2934
  ensureOutputDirectory(to);
2931
- const sizeHeader = res.headers["content-length"];
2935
+ const sizeHeader = response.headers["content-length"];
2932
2936
  const totalSize = typeof sizeHeader === "undefined" ? null : Number(sizeHeader);
2933
2937
  const writeStream = createWriteStream(to);
2934
2938
  let downloaded = 0;
@@ -2947,9 +2951,12 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2947
2951
  return resolveAndFlag({ sizeInBytes: downloaded, to });
2948
2952
  });
2949
2953
  writeStream.on("error", (err) => rejectAndFlag(err));
2950
- res.on("error", (err) => rejectAndFlag(err));
2951
- res.pipe(writeStream).on("error", (err) => rejectAndFlag(err));
2952
- res.on("data", (d) => {
2954
+ response.on("error", (err) => {
2955
+ closeConnection();
2956
+ rejectAndFlag(err);
2957
+ });
2958
+ response.pipe(writeStream).on("error", (err) => rejectAndFlag(err));
2959
+ response.on("data", (d) => {
2953
2960
  refreshTimeout();
2954
2961
  downloaded += d.length;
2955
2962
  refreshTimeout();
@@ -2963,11 +2970,12 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2963
2970
  finishEventSent = true;
2964
2971
  }
2965
2972
  });
2966
- res.on("close", () => {
2973
+ response.on("close", () => {
2967
2974
  if (totalSize !== null && downloaded !== totalSize) {
2968
2975
  rejectAndFlag(new Error(`${incorrectContentLengthToken} ${downloaded} bytes, but expected ${totalSize} bytes from 'Content-Length'.`));
2969
2976
  }
2970
2977
  writeStream.close();
2978
+ closeConnection();
2971
2979
  });
2972
2980
  }).catch((err) => {
2973
2981
  rejectAndFlag(err);
@@ -3042,8 +3050,7 @@ var getDownloadsCacheDir = () => {
3042
3050
  if (fs2.statSync(path2.join(dir, "package.json")).isFile()) {
3043
3051
  break;
3044
3052
  }
3045
- } catch (e) {
3046
- }
3053
+ } catch (e) {}
3047
3054
  const parent = path2.dirname(dir);
3048
3055
  if (dir === parent) {
3049
3056
  dir = undefined;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
4
4
  },
5
5
  "name": "@remotion/renderer",
6
- "version": "4.0.287",
6
+ "version": "4.0.288",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.17.1",
21
- "remotion": "4.0.287",
22
- "@remotion/streaming": "4.0.287"
21
+ "remotion": "4.0.288",
22
+ "@remotion/streaming": "4.0.288"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0",
@@ -33,17 +33,17 @@
33
33
  "react-dom": "19.0.0",
34
34
  "@types/ws": "8.5.10",
35
35
  "eslint": "9.19.0",
36
- "@remotion/example-videos": "4.0.287",
37
- "@remotion/eslint-config-internal": "4.0.287"
36
+ "@remotion/example-videos": "4.0.288",
37
+ "@remotion/eslint-config-internal": "4.0.288"
38
38
  },
39
39
  "optionalDependencies": {
40
- "@remotion/compositor-darwin-x64": "4.0.287",
41
- "@remotion/compositor-linux-x64-gnu": "4.0.287",
42
- "@remotion/compositor-linux-x64-musl": "4.0.287",
43
- "@remotion/compositor-linux-arm64-gnu": "4.0.287",
44
- "@remotion/compositor-linux-arm64-musl": "4.0.287",
45
- "@remotion/compositor-win32-x64-msvc": "4.0.287",
46
- "@remotion/compositor-darwin-arm64": "4.0.287"
40
+ "@remotion/compositor-darwin-arm64": "4.0.288",
41
+ "@remotion/compositor-linux-arm64-gnu": "4.0.288",
42
+ "@remotion/compositor-linux-arm64-musl": "4.0.288",
43
+ "@remotion/compositor-linux-x64-gnu": "4.0.288",
44
+ "@remotion/compositor-linux-x64-musl": "4.0.288",
45
+ "@remotion/compositor-win32-x64-msvc": "4.0.288",
46
+ "@remotion/compositor-darwin-x64": "4.0.288"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",