@remotion/bundler 3.0.24 → 3.0.27

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
@@ -49,7 +49,6 @@ const bundle = async (entryPoint, onProgressUpdate, options) => {
49
49
  maxTimelineTracks: 15,
50
50
  // For production, the variables are set dynamically
51
51
  envVariables: {},
52
- inputProps: {},
53
52
  entryPoints: [],
54
53
  }),
55
54
  ]);
@@ -70,7 +69,7 @@ const bundle = async (entryPoint, onProgressUpdate, options) => {
70
69
  if (fs_1.default.existsSync(from)) {
71
70
  await (0, copy_dir_1.copyDir)(from, to);
72
71
  }
73
- const html = (0, index_html_1.indexHtml)(publicDir, baseDir, null);
72
+ const html = (0, index_html_1.indexHtml)(publicDir, baseDir, null, null);
74
73
  fs_1.default.writeFileSync(path_1.default.join(outDir, 'index.html'), html);
75
74
  return outDir;
76
75
  };
@@ -1 +1 @@
1
- export declare const indexHtml: (staticHash: string, baseDir: string, editorName: string | null) => string;
1
+ export declare const indexHtml: (staticHash: string, baseDir: string, editorName: string | null, inputProps: object | null) => string;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.indexHtml = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const indexHtml = (staticHash, baseDir, editorName) => `
8
+ const indexHtml = (staticHash, baseDir, editorName, inputProps) => `
9
9
  <!DOCTYPE html>
10
10
  <html lang="en">
11
11
  <head>
@@ -24,6 +24,10 @@ const indexHtml = (staticHash, baseDir, editorName) => `
24
24
  : '<script>window.remotion_editorName = null;</script>'}
25
25
  <script>window.remotion_projectName = ${JSON.stringify(path_1.default.basename(process.cwd()))};</script>
26
26
  <script>window.remotion_cwd = ${JSON.stringify(process.cwd())};</script>
27
+ ${inputProps
28
+ ? ` <script>window.remotion_inputProps = ${JSON.stringify(JSON.stringify(inputProps))};</script>
29
+ `
30
+ : ''}
27
31
 
28
32
  <div id="container"></div>
29
33
  <div id="menuportal-0"></div>
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import esbuild = require('esbuild');
2
2
  import webpack = require('webpack');
3
3
  export declare const BundlerInternals: {
4
4
  esbuild: typeof esbuild;
5
- webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgressUpdate, enableCaching, inputProps, envVariables, maxTimelineTracks, entryPoints, }: {
5
+ webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgressUpdate, enableCaching, envVariables, maxTimelineTracks, entryPoints, }: {
6
6
  entry: string;
7
7
  userDefinedComponent: string;
8
8
  outDir: string;
@@ -10,14 +10,13 @@ export declare const BundlerInternals: {
10
10
  webpackOverride: import("remotion").WebpackOverrideFn;
11
11
  onProgressUpdate?: ((f: number) => void) | undefined;
12
12
  enableCaching?: boolean | undefined;
13
- inputProps: object;
14
13
  envVariables: Record<string, string>;
15
14
  maxTimelineTracks: number;
16
15
  entryPoints: string[];
17
16
  }) => webpack.Configuration;
18
- indexHtml: (staticHash: string, baseDir: string, editorName: string | null) => string;
19
- cacheExists: (environment: "development" | "production", inputProps: object | null) => boolean;
20
- clearCache: (environment: "development" | "production", inputProps: object | null) => Promise<void>;
17
+ indexHtml: (staticHash: string, baseDir: string, editorName: string | null, inputProps: object | null) => string;
18
+ cacheExists: (environment: "development" | "production") => boolean;
19
+ clearCache: (environment: "development" | "production") => Promise<void>;
21
20
  };
22
21
  export { bundle } from './bundle';
23
22
  export { webpack };
@@ -6,7 +6,7 @@ declare global {
6
6
  }
7
7
  }
8
8
  }
9
- export declare const clearCache: (environment: Environment, inputProps: object | null) => Promise<void>;
10
- export declare const getWebpackCacheName: (environment: Environment, inputProps: object | null) => string;
11
- export declare const cacheExists: (environment: Environment, inputProps: object | null) => boolean;
9
+ export declare const clearCache: (environment: Environment) => Promise<void>;
10
+ export declare const getWebpackCacheName: (environment: Environment) => string;
11
+ export declare const cacheExists: (environment: Environment) => boolean;
12
12
  export {};
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.cacheExists = exports.getWebpackCacheName = exports.clearCache = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
- const remotion_1 = require("remotion");
10
9
  // Inlined from https://github.com/webpack/webpack/blob/4c2ee7a4ddb8db2362ca83b6c4190523387ba7ee/lib/config/defaults.js#L265
11
10
  // An algorithm to determine where Webpack will cache the depencies
12
11
  const getWebpackCacheDir = () => {
@@ -38,29 +37,26 @@ const getWebpackCacheDir = () => {
38
37
  }
39
38
  return path_1.default.resolve(dir, 'node_modules/.cache/webpack');
40
39
  };
41
- const remotionCacheLocation = (environment, inputProps) => {
42
- return path_1.default.join(getWebpackCacheDir(), (0, exports.getWebpackCacheName)(environment, inputProps));
40
+ const remotionCacheLocation = (environment) => {
41
+ return path_1.default.join(getWebpackCacheDir(), (0, exports.getWebpackCacheName)(environment));
43
42
  };
44
- const clearCache = (environment, inputProps) => {
43
+ const clearCache = (environment) => {
45
44
  var _a;
46
- return ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(remotionCacheLocation(environment, inputProps), {
45
+ return ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(remotionCacheLocation(environment), {
47
46
  recursive: true,
48
47
  });
49
48
  };
50
49
  exports.clearCache = clearCache;
51
- const getWebpackCacheName = (environment, inputProps) => {
52
- // In development, let's reset the cache when input props
53
- // are changing, because they are injected using Webpack and if changed,
54
- // it will get the cached version
50
+ const getWebpackCacheName = (environment) => {
55
51
  if (environment === 'development') {
56
- return `remotion-v3-${environment}-${(0, remotion_1.random)(JSON.stringify(inputProps))}`;
52
+ return `remotion-v3-${environment}`;
57
53
  }
58
54
  // In production, the cache is independent from input props because
59
55
  // they are passed over URL params. Speed is mostly important in production.
60
56
  return `remotion-v3-${environment}`;
61
57
  };
62
58
  exports.getWebpackCacheName = getWebpackCacheName;
63
- const cacheExists = (environment, inputProps) => {
64
- return fs_1.default.existsSync(remotionCacheLocation(environment, inputProps));
59
+ const cacheExists = (environment) => {
60
+ return fs_1.default.existsSync(remotionCacheLocation(environment));
65
61
  };
66
62
  exports.cacheExists = cacheExists;
@@ -1,5 +1,5 @@
1
1
  import type { WebpackConfiguration, WebpackOverrideFn } from 'remotion';
2
- export declare const webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgressUpdate, enableCaching, inputProps, envVariables, maxTimelineTracks, entryPoints, }: {
2
+ export declare const webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgressUpdate, enableCaching, envVariables, maxTimelineTracks, entryPoints, }: {
3
3
  entry: string;
4
4
  userDefinedComponent: string;
5
5
  outDir: string;
@@ -7,7 +7,6 @@ export declare const webpackConfig: ({ entry, userDefinedComponent, outDir, envi
7
7
  webpackOverride: WebpackOverrideFn;
8
8
  onProgressUpdate?: ((f: number) => void) | undefined;
9
9
  enableCaching?: boolean | undefined;
10
- inputProps: object;
11
10
  envVariables: Record<string, string>;
12
11
  maxTimelineTracks: number;
13
12
  entryPoints: string[];
@@ -49,7 +49,7 @@ const esbuildLoaderOptions = {
49
49
  function truthy(value) {
50
50
  return Boolean(value);
51
51
  }
52
- const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpackOverride = (f) => f, onProgressUpdate, enableCaching = remotion_1.Internals.DEFAULT_WEBPACK_CACHE_ENABLED, inputProps, envVariables, maxTimelineTracks, entryPoints, }) => {
52
+ const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpackOverride = (f) => f, onProgressUpdate, enableCaching = remotion_1.Internals.DEFAULT_WEBPACK_CACHE_ENABLED, envVariables, maxTimelineTracks, entryPoints, }) => {
53
53
  return webpackOverride({
54
54
  optimization: {
55
55
  minimize: false,
@@ -68,7 +68,7 @@ const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpa
68
68
  cache: enableCaching
69
69
  ? {
70
70
  type: 'filesystem',
71
- name: (0, webpack_cache_1.getWebpackCacheName)(environment, inputProps !== null && inputProps !== void 0 ? inputProps : {}),
71
+ name: (0, webpack_cache_1.getWebpackCacheName)(environment),
72
72
  }
73
73
  : false,
74
74
  devtool: environment === 'development'
@@ -94,7 +94,6 @@ const webpackConfig = ({ entry, userDefinedComponent, outDir, environment, webpa
94
94
  new webpack_1.default.HotModuleReplacementPlugin(),
95
95
  new webpack_1.default.DefinePlugin({
96
96
  'process.env.MAX_TIMELINE_TRACKS': maxTimelineTracks,
97
- 'process.env.INPUT_PROPS': JSON.stringify(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
98
97
  [`process.env.${remotion_1.Internals.ENV_VARIABLES_ENV_NAME}`]: JSON.stringify(envVariables),
99
98
  }),
100
99
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "3.0.24",
3
+ "version": "3.0.27",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -26,7 +26,7 @@
26
26
  "css-loader": "5.2.7",
27
27
  "esbuild": "0.14.19",
28
28
  "react-refresh": "0.9.0",
29
- "remotion": "3.0.24",
29
+ "remotion": "3.0.27",
30
30
  "style-loader": "2.0.0",
31
31
  "webpack": "5.72.0"
32
32
  },
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "7a9b3937f3d7eb41894a338cd92991e6d1226725"
66
+ "gitHead": "16f54241ee403a938c1af372bebc4ac83a4a24f0"
67
67
  }