Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
364 changes: 302 additions & 62 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/babel-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@babel/preset-typescript": "7.23.2",
"babel-loader": "8.2.2",
"react-refresh": "0.9.0",
"webpack": "5.96.1"
"@rspack/core": "1.0.14"
},
"devDependencies": {
"@remotion/bundler": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-loader/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {WebpackConfiguration} from '@remotion/bundler';
import type {RuleSetUseItem} from 'webpack';
import type {RuleSetUseItem} from '@rspack/core';

const envPreset = [
require.resolve('@babel/preset-env'),
Expand Down
5 changes: 2 additions & 3 deletions packages/bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
"license": "SEE LICENSE IN LICENSE.md",
"dependencies": {
"css-loader": "5.2.7",
"esbuild": "0.25.0",
"react-refresh": "0.9.0",
"remotion": "workspace:*",
"@remotion/studio": "workspace:*",
"@remotion/studio-shared": "workspace:*",
"@remotion/media-parser": "workspace:*",
"style-loader": "4.0.0",
"source-map": "0.7.3",
"webpack": "5.96.1"
"@rspack/core": "1.0.14",
"@rspack/plugin-react-refresh": "1.0.0"
},
"peerDependencies": {
"react": ">=16.8.0",
Expand All @@ -51,7 +51,6 @@
"ffmpeg",
"video",
"react",
"webpack",
"player"
],
"publishConfig": {
Expand Down
14 changes: 6 additions & 8 deletions packages/bundler/src/bundle.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import type {GitSource} from '@remotion/studio-shared';
import {getProjectName, SOURCE_MAP_ENDPOINT} from '@remotion/studio-shared';
import type {Configuration, Stats} from '@rspack/core';
import {rspack} from '@rspack/core';
import fs, {promises} from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import {promisify} from 'node:util';
import {isMainThread} from 'node:worker_threads';
import webpack from 'webpack';
import {copyDir} from './copy-dir';
import {indexHtml} from './index-html';
import {readRecursively} from './read-recursively';
import type {WebpackOverrideFn} from './webpack-config';
import {webpackConfig} from './webpack-config';

const promisified = promisify(webpack);
const promisified = promisify(rspack);

const prepareOutDir = async (specified: string | null) => {
if (specified) {
Expand Down Expand Up @@ -44,7 +45,6 @@ const trimTrailingSlash = (p: string): string => {
export type MandatoryLegacyBundleOptions = {
webpackOverride: WebpackOverrideFn;
outDir: string | null;
enableCaching: boolean;
publicPath: string | null;
rootDir: string | null;
publicDir: string | null;
Expand All @@ -70,7 +70,7 @@ export const getConfig = ({
maxTimelineTracks: number | null;
onProgress?: (progress: number) => void;
options?: LegacyBundleOptions;
}) => {
}): Promise<Configuration> => {
return webpackConfig({
entry: path.join(
require.resolve('@remotion/studio/renderEntry'),
Expand All @@ -85,7 +85,6 @@ export const getConfig = ({
onProgress: (p) => {
onProgress?.(p);
},
enableCaching: options?.enableCaching ?? true,
maxTimelineTracks,
remotionRoot: resolvedRemotionRoot,
keyboardShortcutsEnabled: true,
Expand Down Expand Up @@ -207,7 +206,7 @@ export const internalBundle = async (
}

const {onProgress, ...options} = actualArgs;
const [, config] = await getConfig({
const config = await getConfig({
outDir,
entryPoint,
resolvedRemotionRoot,
Expand All @@ -228,7 +227,7 @@ export const internalBundle = async (
throw new Error('Expected webpack output');
}

const {errors} = output.toJson();
const {errors} = (output as Stats).toJson();
if (errors !== undefined && errors.length > 0) {
throw new Error(errors[0].message + '\n' + errors[0].details);
}
Expand Down Expand Up @@ -336,7 +335,6 @@ export async function bundle(...args: Arguments): Promise<string> {
const result = await internalBundle({
bufferStateDelayInMilliseconds:
actualArgs.bufferStateDelayInMilliseconds ?? null,
enableCaching: actualArgs.enableCaching ?? true,
entryPoint: actualArgs.entryPoint,
gitSource: actualArgs.gitSource ?? null,
ignoreRegisterRootWarning: actualArgs.ignoreRegisterRootWarning ?? false,
Expand Down
7 changes: 5 additions & 2 deletions packages/bundler/src/case-sensitive-paths.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Compiler} from '@rspack/core';
import path from 'path';
import type {Compiler, InputFileSystem} from 'webpack';

// Inlined from https://github.com/umijs/case-sensitive-paths-webpack-plugin/blob/master/src/index.ts

Expand Down Expand Up @@ -74,7 +74,7 @@ export class CaseSensitivePathsPlugin {
} else {
// read directory for the first time
deferrer = new Promise((resolve2) => {
(this.fs as InputFileSystem).readdir(dir, (_, files = []) => {
this.fs!.readdir(dir, (_, files = []) => {
// save cache, resolve promise and release deferrer
this.cacheMap.set(dir, files as string[]);
resolve2(files as string[]);
Expand Down Expand Up @@ -138,10 +138,13 @@ export class CaseSensitivePathsPlugin {
const {createData = data as typeof data.createData} = data;

if (
createData &&
createData.resource &&
this.isCheckable(
createData.resource,
// @ts-expect-error
createData.type,
// @ts-expect-error
createData.resourceResolveData?.context?.issuer,
)
) {
Expand Down
73 changes: 0 additions & 73 deletions packages/bundler/src/esbuild-loader/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/bundler/src/esbuild-loader/interfaces.ts

This file was deleted.

Loading
Loading