@remotion/bundler 4.1.0-alpha3 → 4.1.0-alpha5

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/dist/bundle.js CHANGED
@@ -187,6 +187,7 @@ async function bundle(...args) {
187
187
  onSymlinkDetected: showSymlinkWarning,
188
188
  onProgress: (prog) => { var _a; return (_a = options.onPublicDirCopyProgress) === null || _a === void 0 ? void 0 : _a.call(options, prog); },
189
189
  copied: 0,
190
+ lastReportedProgress: 0,
190
191
  });
191
192
  }
192
193
  const html = (0, index_html_1.indexHtml)({
@@ -1,9 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import fs from 'node:fs';
3
- export declare function copyDir({ src, dest, onSymlinkDetected, onProgress, copied, }: {
3
+ export declare function copyDir({ src, dest, onSymlinkDetected, onProgress, copied, lastReportedProgress, }: {
4
4
  src: string;
5
5
  dest: string;
6
6
  onSymlinkDetected: (entry: fs.Dirent, dir: string) => void;
7
7
  onProgress: (bytes: number) => void;
8
8
  copied: number;
9
+ lastReportedProgress: number;
9
10
  }): Promise<void>;
package/dist/copy-dir.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.copyDir = void 0;
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
- async function copyDir({ src, dest, onSymlinkDetected, onProgress, copied = 0, }) {
9
+ async function copyDir({ src, dest, onSymlinkDetected, onProgress, copied = 0, lastReportedProgress = 0, }) {
10
10
  await node_fs_1.default.promises.mkdir(dest, { recursive: true });
11
11
  const entries = await node_fs_1.default.promises.readdir(src, { withFileTypes: true });
12
12
  for (const entry of entries) {
@@ -19,6 +19,7 @@ async function copyDir({ src, dest, onSymlinkDetected, onProgress, copied = 0, }
19
19
  onSymlinkDetected,
20
20
  onProgress,
21
21
  copied,
22
+ lastReportedProgress,
22
23
  });
23
24
  }
24
25
  else if (entry.isSymbolicLink()) {
@@ -32,7 +33,10 @@ async function copyDir({ src, dest, onSymlinkDetected, onProgress, copied = 0, }
32
33
  node_fs_1.default.promises.stat(srcPath),
33
34
  ]);
34
35
  copied += size;
35
- onProgress(copied);
36
+ if (copied - lastReportedProgress > 1024 * 1024 * 10) {
37
+ onProgress(copied);
38
+ lastReportedProgress = copied;
39
+ }
36
40
  }
37
41
  }
38
42
  }
@@ -50,7 +50,7 @@ const GetVideo = ({ state }) => {
50
50
  }
51
51
  compositions.setCurrentComposition((_a = foundComposition === null || foundComposition === void 0 ? void 0 : foundComposition.id) !== null && _a !== void 0 ? _a : null);
52
52
  compositions.setCurrentCompositionMetadata({
53
- defaultProps: state.compositionDefaultProps,
53
+ props: state.props,
54
54
  durationInFrames: state.compositionDurationInFrames,
55
55
  fps: state.compositionFps,
56
56
  height: state.compositionHeight,
@@ -223,7 +223,7 @@ if (typeof window !== 'undefined') {
223
223
  (0, remotion_1.continueRender)(handle);
224
224
  return prom;
225
225
  };
226
- window.siteVersion = '5';
226
+ window.siteVersion = '6';
227
227
  window.remotion_version = remotion_1.VERSION;
228
228
  window.remotion_setBundleMode = exports.setBundleModeAndUpdate;
229
229
  }
@@ -53,6 +53,7 @@ function truthy(value) {
53
53
  return Boolean(value);
54
54
  }
55
55
  const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpackOverride = (f) => f, onProgress, enableCaching = true, maxTimelineTracks, entryPoints, remotionRoot, keyboardShortcutsEnabled, poll, }) => {
56
+ let lastProgress = 0;
56
57
  const conf = webpackOverride({
57
58
  optimization: {
58
59
  minimize: false,
@@ -97,7 +98,10 @@ const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpa
97
98
  : [
98
99
  new webpack_1.ProgressPlugin((p) => {
99
100
  if (onProgress) {
100
- onProgress(Number((p * 100).toFixed(2)));
101
+ if (p === 1 || p - lastProgress > 0.05) {
102
+ lastProgress = p;
103
+ onProgress(Number((p * 100).toFixed(2)));
104
+ }
101
105
  }
102
106
  }),
103
107
  new optional_dependencies_1.AllowOptionalDependenciesPlugin(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "4.1.0-alpha3",
3
+ "version": "4.1.0-alpha5",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -18,11 +18,11 @@
18
18
  "license": "SEE LICENSE IN LICENSE.md",
19
19
  "dependencies": {
20
20
  "css-loader": "5.2.7",
21
- "esbuild": "0.16.12",
21
+ "esbuild": "0.18.6",
22
22
  "react-refresh": "0.9.0",
23
23
  "style-loader": "2.0.0",
24
24
  "webpack": "5.83.1",
25
- "remotion": "4.1.0-alpha3"
25
+ "remotion": "4.1.0-alpha5"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.8.0",