@remotion/studio-server 4.0.458 → 4.0.460

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.
@@ -1,5 +1,5 @@
1
1
  import type { File, JSXElement } from '@babel/types';
2
- import type { SequenceNodePath } from '@remotion/studio-shared';
2
+ import type { SequenceNodePath } from 'remotion';
3
3
  /** e.g. `<Video>` or `<Remotion.Sequence>` for logs and undo copy. */
4
4
  export declare const getJsxElementTagLabel: (element: JSXElement) => string;
5
5
  export declare const findJsxElementPathForDeletion: (ast: File, nodePath: SequenceNodePath) => import("ast-types/lib/node-path").NodePath<N, V> | null;
@@ -1,4 +1,4 @@
1
- import type { SequenceNodePath } from '@remotion/studio-shared';
1
+ import type { SequenceNodePath } from 'remotion';
2
2
  export declare const duplicateJsxElementAtPath: (jsxPath: import("ast-types/lib/node-path").NodePath<N, V>) => void;
3
3
  export declare const duplicateJsxNode: ({ input, nodePath, prettierConfigOverride, }: {
4
4
  input: string;
@@ -1,5 +1,5 @@
1
1
  import type { Expression, File } from '@babel/types';
2
- import type { SequenceNodePath } from '@remotion/studio-shared';
2
+ import type { SequenceNodePath } from 'remotion';
3
3
  /**
4
4
  * Whether the callee is a `.map(...)` member call (including optional `?.map`).
5
5
  */
@@ -1,4 +1,4 @@
1
- import type { SequenceNodePath } from '@remotion/studio-shared';
1
+ import type { SequenceNodePath } from 'remotion';
2
2
  import type { SequenceSchema } from 'remotion';
3
3
  export type SequencePropUpdate = {
4
4
  key: string;
@@ -1,3 +1,3 @@
1
1
  import type { File } from '@babel/types';
2
- import type { SequenceNodePath } from '@remotion/studio-shared';
2
+ import type { SequenceNodePath } from 'remotion';
3
3
  export declare const getAstNodePath: (ast: File, nodePath: SequenceNodePath) => import("ast-types/lib/node-path").NodePath<N, V> | null;
@@ -1,4 +1,4 @@
1
- import type { SequenceNodePath } from '@remotion/studio-shared';
1
+ import type { SequenceNodePath } from 'remotion';
2
2
  export declare const getCachedNodePath: (fileName: string, line: number, column: number) => SequenceNodePath | undefined;
3
3
  export declare const setCachedNodePath: (fileName: string, line: number, column: number, nodePath: SequenceNodePath) => void;
4
4
  export declare const clearNodePathCache: () => void;
@@ -1,5 +1,5 @@
1
1
  import type { Expression, File, JSXOpeningElement } from '@babel/types';
2
- import type { CanUpdateSequencePropsResponse, SequenceNodePath } from '@remotion/studio-shared';
2
+ import type { CanUpdateSequencePropsResponse, SequenceNodePath } from 'remotion';
3
3
  export declare const isStaticValue: (node: Expression) => boolean;
4
4
  export declare const extractStaticValue: (node: Expression) => unknown;
5
5
  export declare const findJsxElementAtNodePath: (ast: File, nodePath: SequenceNodePath) => JSXOpeningElement | null;
@@ -1,4 +1,4 @@
1
- import type { CanUpdateSequencePropsResponse, SequenceNodePath } from '@remotion/studio-shared';
1
+ import type { CanUpdateSequencePropsResponse, SequenceNodePath } from 'remotion';
2
2
  export declare const subscribeToSequencePropsWatchers: ({ fileName, line, column, keys, remotionRoot, clientId, }: {
3
3
  fileName: string;
4
4
  line: number;
@@ -1,3 +1,4 @@
1
1
  import type { WatchIgnoreNextChangePlugin } from '@remotion/bundler';
2
2
  export declare const setWatchIgnoreNextChangePlugin: (plugin: WatchIgnoreNextChangePlugin) => void;
3
3
  export declare const suppressBundlerUpdateForFile: (absolutePath: string) => void;
4
+ export declare const reloadPreviouslySuppressedFiles: () => Promise<void>;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.suppressBundlerUpdateForFile = exports.setWatchIgnoreNextChangePlugin = void 0;
3
+ exports.reloadPreviouslySuppressedFiles = exports.suppressBundlerUpdateForFile = exports.setWatchIgnoreNextChangePlugin = void 0;
4
+ const node_fs_1 = require("node:fs");
4
5
  let currentPlugin = null;
5
6
  const setWatchIgnoreNextChangePlugin = (plugin) => {
6
7
  currentPlugin = plugin;
@@ -10,3 +11,26 @@ const suppressBundlerUpdateForFile = (absolutePath) => {
10
11
  currentPlugin === null || currentPlugin === void 0 ? void 0 : currentPlugin.ignoreNextChange(absolutePath);
11
12
  };
12
13
  exports.suppressBundlerUpdateForFile = suppressBundlerUpdateForFile;
14
+ // Why do we need this?
15
+ // Consider we have a <Sequence>.
16
+ // 1. In visual mode, we update it to layout='none'. This is reflected in the browser and in the code,
17
+ // but Webpack is not aware because we suppressed the file change
18
+ // 2. Reload the page. Sequence registers still as layout={undefined}, then listens to sequence props
19
+ // asynchronously!
20
+ // 3. Server says that layout="none" is the case, props gets updated, and this reloads the <Sequence>.
21
+ // The same happens again - infinite loop!
22
+ // --> When reloading the Studio, it is a good idea to reset Webpack to a non-hacked state.
23
+ const reloadPreviouslySuppressedFiles = async () => {
24
+ if (!currentPlugin) {
25
+ return;
26
+ }
27
+ const files = currentPlugin.consumeSuppressedFilesHistory();
28
+ const now = new Date();
29
+ await Promise.all(files.map(async (file) => {
30
+ try {
31
+ await node_fs_1.promises.utimes(file, now, now);
32
+ }
33
+ catch (_a) { }
34
+ }));
35
+ };
36
+ exports.reloadPreviouslySuppressedFiles = reloadPreviouslySuppressedFiles;
package/dist/routes.js CHANGED
@@ -53,6 +53,7 @@ const handler_1 = require("./preview-server/handler");
53
53
  const parse_body_1 = require("./preview-server/parse-body");
54
54
  const public_folder_1 = require("./preview-server/public-folder");
55
55
  const serve_static_1 = require("./preview-server/serve-static");
56
+ const watch_ignore_next_change_1 = require("./preview-server/watch-ignore-next-change");
56
57
  const editorGuess = (0, open_in_editor_1.guessEditor)();
57
58
  const loggedStaticFileHints = new Set();
58
59
  const static404 = (response) => {
@@ -79,6 +80,11 @@ const handleRemotionConfig = (response, remotionRoot) => {
79
80
  return Promise.resolve();
80
81
  };
81
82
  const handleFallback = async ({ remotionRoot, hash, response, request, getCurrentInputProps, getEnvVariables, publicDir, getRenderQueue, getRenderDefaults, numberOfAudioTags, audioLatencyHint, gitSource, logLevel, enableCrossSiteIsolation, }) => {
83
+ var _a;
84
+ const acceptsHtml = ((_a = request.headers.accept) !== null && _a !== void 0 ? _a : '').includes('text/html');
85
+ if (request.method === 'GET' && acceptsHtml) {
86
+ await (0, watch_ignore_next_change_1.reloadPreviouslySuppressedFiles)();
87
+ }
82
88
  const requestUrl = new URL(request.url, 'http://localhost');
83
89
  const { pathname } = requestUrl;
84
90
  const staticFileHint = (0, get_static_file_fallback_hint_1.getStaticFileFallbackHint)({
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio-server"
4
4
  },
5
5
  "name": "@remotion/studio-server",
6
- "version": "4.0.458",
6
+ "version": "4.0.460",
7
7
  "description": "Run a Remotion Studio with a server backend",
8
8
  "main": "dist",
9
9
  "sideEffects": false,
@@ -28,11 +28,11 @@
28
28
  "@babel/parser": "7.24.1",
29
29
  "semver": "7.5.3",
30
30
  "prettier": "3.8.1",
31
- "remotion": "4.0.458",
31
+ "remotion": "4.0.460",
32
32
  "recast": "0.23.11",
33
- "@remotion/bundler": "4.0.458",
34
- "@remotion/renderer": "4.0.458",
35
- "@remotion/studio-shared": "4.0.458",
33
+ "@remotion/bundler": "4.0.460",
34
+ "@remotion/renderer": "4.0.460",
35
+ "@remotion/studio-shared": "4.0.460",
36
36
  "memfs": "3.4.3",
37
37
  "source-map": "0.7.3",
38
38
  "open": "^8.4.2"
@@ -41,7 +41,7 @@
41
41
  "ast-types": "0.16.1",
42
42
  "react": "19.2.3",
43
43
  "@types/semver": "^7.3.4",
44
- "@remotion/eslint-config-internal": "4.0.458",
44
+ "@remotion/eslint-config-internal": "4.0.460",
45
45
  "eslint": "9.19.0",
46
46
  "@types/node": "20.12.14",
47
47
  "@typescript/native-preview": "7.0.0-dev.20260217.1"