@remotion/bundler 4.0.498 → 4.0.500

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.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import type { GitSource, RenderDefaults } from '@remotion/studio-shared';
2
+ import { NoReactInternals } from 'remotion/no-react';
2
3
  import webpack from 'webpack';
3
4
  import type { BundlerOverrideFn, RspackOverrideFn, WebpackOverrideFn } from './override-types';
4
5
  export declare const getBundlePublicPath: (publicPath: string | null) => string;
5
6
  export declare const getBundleStaticHash: (publicPath: string) => string;
6
- export type MandatoryLegacyBundleOptions = {
7
+ export type MandatoryBundleInternalsOptions = {
7
8
  bundlerOverride?: BundlerOverrideFn;
8
9
  rspackOverride?: RspackOverrideFn;
9
10
  webpackOverride: WebpackOverrideFn;
@@ -26,16 +27,17 @@ export type MandatoryLegacyBundleOptions = {
26
27
  */
27
28
  symlinkPublicDir: boolean;
28
29
  };
29
- export type LegacyBundleOptions = Partial<MandatoryLegacyBundleOptions>;
30
+ type V4LegacyBundleOptions = Partial<MandatoryBundleInternalsOptions>;
31
+ export type MandatoryLegacyBundleOptions = typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true ? never : MandatoryBundleInternalsOptions;
32
+ export type LegacyBundleOptions = typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true ? never : V4LegacyBundleOptions;
30
33
  export declare const getConfig: ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, }: {
31
34
  outDir: string;
32
35
  entryPoint: string;
33
36
  resolvedRemotionRoot: string;
34
37
  onProgress: (progress: number) => void;
35
- options: MandatoryLegacyBundleOptions;
38
+ options: MandatoryBundleInternalsOptions;
36
39
  }) => Promise<[string, webpack.Configuration]> | Promise<[string, import("@rspack/core").RspackOptions]>;
37
40
  type NewBundleOptions = {
38
- entryPoint: string;
39
41
  onProgress: (progress: number) => void;
40
42
  ignoreRegisterRootWarning: boolean;
41
43
  onDirectoryCreated: (dir: string) => void;
@@ -47,16 +49,18 @@ type NewBundleOptions = {
47
49
  };
48
50
  type MandatoryBundleOptions = {
49
51
  entryPoint: string;
50
- } & NewBundleOptions & MandatoryLegacyBundleOptions;
52
+ } & NewBundleOptions & MandatoryBundleInternalsOptions;
51
53
  export type BundleOptions = {
52
54
  entryPoint: string;
53
- } & Partial<NewBundleOptions> & LegacyBundleOptions;
54
- type Arguments = [options: BundleOptions] | [
55
+ } & Partial<NewBundleOptions> & Partial<MandatoryBundleInternalsOptions>;
56
+ type V4BundleArguments = [options: BundleOptions] | [
55
57
  entryPoint: string,
56
58
  onProgress?: (progress: number) => void,
57
- options?: LegacyBundleOptions
59
+ options?: V4LegacyBundleOptions
58
60
  ];
61
+ type BundleArguments = typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true ? [options: BundleOptions] : V4BundleArguments;
62
+ export declare const convertBundleArgumentsIntoOptions: (args: V4BundleArguments, enableV5BreakingChanges: boolean) => BundleOptions;
59
63
  export declare const findClosestFolderWithItem: (currentDir: string, file: string) => string | null;
60
64
  export declare const internalBundle: (actualArgs: MandatoryBundleOptions) => Promise<string>;
61
- export declare function bundle(...args: Arguments): Promise<string>;
65
+ export declare function bundle(...args: BundleArguments): Promise<string>;
62
66
  export {};
package/dist/bundle.js CHANGED
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.internalBundle = exports.findClosestFolderWithItem = exports.getConfig = exports.getBundleStaticHash = exports.getBundlePublicPath = void 0;
39
+ exports.internalBundle = exports.findClosestFolderWithItem = exports.convertBundleArgumentsIntoOptions = exports.getConfig = exports.getBundleStaticHash = exports.getBundlePublicPath = void 0;
40
40
  exports.bundle = bundle;
41
41
  const node_fs_1 = __importStar(require("node:fs"));
42
42
  const node_os_1 = __importDefault(require("node:os"));
@@ -44,6 +44,7 @@ const node_path_1 = __importDefault(require("node:path"));
44
44
  const node_util_1 = require("node:util");
45
45
  const node_worker_threads_1 = require("node:worker_threads");
46
46
  const studio_shared_1 = require("@remotion/studio-shared");
47
+ const no_react_1 = require("remotion/no-react");
47
48
  const webpack_1 = __importDefault(require("webpack"));
48
49
  const copy_dir_1 = require("./copy-dir");
49
50
  const index_html_1 = require("./index-html");
@@ -124,24 +125,28 @@ const getConfig = ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, optio
124
125
  return (0, webpack_config_1.webpackConfig)(configArgs);
125
126
  };
126
127
  exports.getConfig = getConfig;
127
- const convertArgumentsIntoOptions = (args) => {
128
+ const convertBundleArgumentsIntoOptions = (args, enableV5BreakingChanges) => {
128
129
  var _a;
129
130
  if (args.length === 0) {
130
131
  throw new TypeError('bundle() was called without arguments');
131
132
  }
132
133
  const firstArg = args[0];
133
134
  if (typeof firstArg === 'string') {
134
- return {
135
- entryPoint: firstArg,
136
- onProgress: args[1],
137
- ...((_a = args[2]) !== null && _a !== void 0 ? _a : {}),
138
- };
135
+ if (!enableV5BreakingChanges) {
136
+ return {
137
+ entryPoint: firstArg,
138
+ onProgress: args[1],
139
+ ...((_a = args[2]) !== null && _a !== void 0 ? _a : {}),
140
+ };
141
+ }
142
+ throw new TypeError('bundle() no longer supports the legacy positional arguments. Pass an options object instead: bundle({entryPoint, onProgress, ...options}).');
139
143
  }
140
144
  if (typeof firstArg.entryPoint !== 'string') {
141
145
  throw new TypeError('bundle() was called without the `entryPoint` option');
142
146
  }
143
147
  return firstArg;
144
148
  };
149
+ exports.convertBundleArgumentsIntoOptions = convertBundleArgumentsIntoOptions;
145
150
  const recursionLimit = 5;
146
151
  const findClosestFolderWithItem = (currentDir, file) => {
147
152
  let possibleFile = '';
@@ -341,7 +346,7 @@ exports.internalBundle = internalBundle;
341
346
  */
342
347
  async function bundle(...args) {
343
348
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
344
- const actualArgs = convertArgumentsIntoOptions(args);
349
+ const actualArgs = (0, exports.convertBundleArgumentsIntoOptions)(args, no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES);
345
350
  const result = await (0, exports.internalBundle)({
346
351
  bufferStateDelayInMilliseconds: (_a = actualArgs.bufferStateDelayInMilliseconds) !== null && _a !== void 0 ? _a : null,
347
352
  enableCaching: (_b = actualArgs.enableCaching) !== null && _b !== void 0 ? _b : true,
package/dist/index.d.ts CHANGED
@@ -38,7 +38,7 @@ export declare const BundlerInternals: {
38
38
  entryPoint: string;
39
39
  resolvedRemotionRoot: string;
40
40
  onProgress: (progress: number) => void;
41
- options: import("./bundle").MandatoryLegacyBundleOptions;
41
+ options: import("./bundle").MandatoryBundleInternalsOptions;
42
42
  }) => Promise<[string, webpack.Configuration]> | Promise<[string, import("@rspack/core").RspackOptions]>;
43
43
  readRecursively: ({ folder, output, startPath, staticHash, limit, }: {
44
44
  folder: string;
@@ -51,7 +51,6 @@ export declare const BundlerInternals: {
51
51
  internalBundle: (actualArgs: {
52
52
  entryPoint: string;
53
53
  } & {
54
- entryPoint: string;
55
54
  onProgress: (progress: number) => void;
56
55
  ignoreRegisterRootWarning: boolean;
57
56
  onDirectoryCreated: (dir: string) => void;
@@ -60,10 +59,10 @@ export declare const BundlerInternals: {
60
59
  bufferStateDelayInMilliseconds: number | null;
61
60
  audioLatencyHint: AudioContextLatencyCategory | null;
62
61
  renderDefaults: import("@remotion/studio-shared").RenderDefaults | null;
63
- } & import("./bundle").MandatoryLegacyBundleOptions) => Promise<string>;
62
+ } & import("./bundle").MandatoryBundleInternalsOptions) => Promise<string>;
64
63
  };
65
64
  export type { GitSource } from '@remotion/studio-shared';
66
- export { bundle, BundleOptions, LegacyBundleOptions, MandatoryLegacyBundleOptions, } from './bundle';
65
+ export { bundle, BundleOptions, LegacyBundleOptions, MandatoryLegacyBundleOptions, MandatoryBundleInternalsOptions, } from './bundle';
67
66
  export type { BundlerConfiguration, BundlerName, BundlerOverrideFn, RspackConfiguration, RspackOverrideFn, WebpackConfiguration, WebpackOverrideFn, } from './override-types';
68
67
  export { WatchIgnoreNextChangePlugin };
69
68
  export { webpack };
@@ -2,14 +2,13 @@ export declare const shouldUseReactDomClient: boolean;
2
2
  export declare const getResolveConfig: () => {
3
3
  extensions: string[];
4
4
  alias: {
5
- [x: string]: string;
6
5
  'react/jsx-runtime': string;
7
6
  'react/jsx-dev-runtime': string;
8
7
  react: string;
9
8
  'remotion/no-react': string;
10
9
  'remotion/version': string;
11
10
  remotion: string;
12
- '@remotion/media-parser/worker': string;
11
+ '@remotion/media-parser/worker'?: string | undefined;
13
12
  '@remotion/studio': string;
14
13
  'react-dom/client': string;
15
14
  };
@@ -31,7 +31,11 @@ const getResolveConfig = () => ({
31
31
  'remotion/no-react': node_path_1.default.resolve(require.resolve('remotion'), '..', '..', 'esm', 'no-react.mjs'),
32
32
  'remotion/version': node_path_1.default.resolve(require.resolve('remotion'), '..', '..', 'esm', 'version.mjs'),
33
33
  remotion: node_path_1.default.resolve(require.resolve('remotion'), '..', '..', 'esm', 'index.mjs'),
34
- '@remotion/media-parser/worker': node_path_1.default.resolve(require.resolve('@remotion/media-parser'), '..', 'esm', 'worker.mjs'),
34
+ ...(no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
35
+ ? {}
36
+ : {
37
+ '@remotion/media-parser/worker': node_path_1.default.resolve(require.resolve('@remotion/media-parser'), '..', 'esm', 'worker.mjs'),
38
+ }),
35
39
  // test visual controls before removing this
36
40
  '@remotion/studio': require.resolve('@remotion/studio'),
37
41
  [node_path_1.default.join(require.resolve('@remotion/timeline-utils'), '..', 'audio-waveform-worker.mjs')]: node_path_1.default.join(require.resolve('@remotion/timeline-utils'), '..', 'esm', 'audio-waveform-worker.mjs'),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/bundler"
4
4
  },
5
5
  "name": "@remotion/bundler",
6
- "version": "4.0.498",
6
+ "version": "4.0.500",
7
7
  "description": "Bundle Remotion compositions using Webpack",
8
8
  "main": "dist/index.js",
9
9
  "bugs": {
@@ -24,11 +24,11 @@
24
24
  "css-loader": "7.1.4",
25
25
  "esbuild": "0.28.1",
26
26
  "react-refresh": "0.18.0",
27
- "remotion": "4.0.498",
28
- "@remotion/studio": "4.0.498",
29
- "@remotion/studio-shared": "4.0.498",
30
- "@remotion/timeline-utils": "4.0.498",
31
- "@remotion/media-parser": "4.0.498",
27
+ "remotion": "4.0.500",
28
+ "@remotion/studio": "4.0.500",
29
+ "@remotion/studio-shared": "4.0.500",
30
+ "@remotion/timeline-utils": "4.0.500",
31
+ "@remotion/media-parser": "4.0.500",
32
32
  "style-loader": "4.0.0",
33
33
  "webpack": "5.105.0"
34
34
  },
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "react": "19.2.3",
41
41
  "react-dom": "19.2.3",
42
- "@remotion/eslint-config-internal": "4.0.498",
42
+ "@remotion/eslint-config-internal": "4.0.500",
43
43
  "eslint": "9.19.0",
44
44
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
45
45
  },