@remotion/studio-server 4.0.540 → 4.0.541

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.
Files changed (50) hide show
  1. package/dist/codemods/get-node-path-remappings.d.ts +5 -2
  2. package/dist/codemods/get-node-path-remappings.js +7 -1
  3. package/dist/file-watcher.d.ts +1 -0
  4. package/dist/file-watcher.js +9 -1
  5. package/dist/index.d.ts +4 -0
  6. package/dist/index.js +4 -0
  7. package/dist/preview-server/api-routes.js +4 -0
  8. package/dist/preview-server/commit-node-codemod.d.ts +27 -0
  9. package/dist/preview-server/commit-node-codemod.js +68 -0
  10. package/dist/preview-server/hot-middleware/index.js +11 -7
  11. package/dist/preview-server/prerendered-scene.d.ts +25 -0
  12. package/dist/preview-server/prerendered-scene.js +86 -0
  13. package/dist/preview-server/resolve-compiled-sequence-paths.d.ts +12 -0
  14. package/dist/preview-server/resolve-compiled-sequence-paths.js +155 -0
  15. package/dist/preview-server/routes/add-effect-keyframe.js +1 -1
  16. package/dist/preview-server/routes/add-keyframes.js +17 -9
  17. package/dist/preview-server/routes/add-render.js +24 -2
  18. package/dist/preview-server/routes/add-sequence-keyframe.js +1 -1
  19. package/dist/preview-server/routes/can-update-sequence-props.js +17 -4
  20. package/dist/preview-server/routes/delete-nodes.js +1 -1
  21. package/dist/preview-server/routes/duplicate-nodes.js +1 -1
  22. package/dist/preview-server/routes/invalidate-bundle.js +1 -1
  23. package/dist/preview-server/routes/prerendered-scene-info.d.ts +3 -0
  24. package/dist/preview-server/routes/prerendered-scene-info.js +31 -0
  25. package/dist/preview-server/routes/reorder-sequence.js +1 -1
  26. package/dist/preview-server/routes/replace-video-source.js +25 -78
  27. package/dist/preview-server/routes/restore-prerendered-scene.d.ts +3 -0
  28. package/dist/preview-server/routes/restore-prerendered-scene.js +38 -0
  29. package/dist/preview-server/routes/save-effect-props.js +1 -1
  30. package/dist/preview-server/routes/save-sequence-props.js +3 -1
  31. package/dist/preview-server/routes/split-sequences.js +1 -1
  32. package/dist/preview-server/routes/split-video-from-audio.js +1 -1
  33. package/dist/preview-server/routes/subscribe-to-sequence-props.js +50 -15
  34. package/dist/preview-server/routes/unwrap-node.js +1 -1
  35. package/dist/preview-server/routes/update-effect-keyframe-settings.js +1 -1
  36. package/dist/preview-server/routes/update-sequence-keyframe-settings.js +1 -1
  37. package/dist/preview-server/routes/wrap-node.js +1 -1
  38. package/dist/preview-server/sequence-node-path-mutation-build.d.ts +2 -0
  39. package/dist/preview-server/sequence-node-path-mutation-build.js +221 -0
  40. package/dist/preview-server/sequence-node-path-mutation.d.ts +2 -1
  41. package/dist/preview-server/sequence-node-path-mutation.js +14 -2
  42. package/dist/preview-server/sequence-props-watchers.d.ts +2 -1
  43. package/dist/preview-server/sequence-props-watchers.js +6 -2
  44. package/dist/preview-server/serve-static.js +3 -0
  45. package/dist/preview-server/undo-stack.d.ts +1 -1
  46. package/dist/preview-server/undo-stack.js +14 -2
  47. package/dist/preview-server/watch-ignore-next-change.d.ts +1 -1
  48. package/dist/preview-server/watch-ignore-next-change.js +3 -3
  49. package/dist/routes.js +91 -28
  50. package/package.json +8 -8
@@ -1,10 +1,31 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.handleAddRender = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
4
8
  const renderer_1 = require("@remotion/renderer");
5
- const handleAddRender = ({ input, entryPoint, remotionRoot, logLevel, binariesDirectory, methods: { addJob }, }) => {
9
+ const handleAddRender = ({ input, entryPoint, remotionRoot, logLevel, binariesDirectory, publicDir, methods: { addJob }, }) => {
6
10
  const id = String(Math.random()).replace('0.', '');
7
11
  if (input.type === 'video') {
12
+ let { outName } = input;
13
+ let prerender = null;
14
+ if (input.prerenderTarget !== null) {
15
+ const absoluteOutName = node_path_1.default.resolve(publicDir, input.outName);
16
+ const src = node_path_1.default.relative(publicDir, absoluteOutName);
17
+ if (src.startsWith('..') || node_path_1.default.isAbsolute(src)) {
18
+ throw new Error('Pre-rendered videos must be saved in the public folder');
19
+ }
20
+ outName = node_path_1.default
21
+ .relative(remotionRoot, absoluteOutName)
22
+ .split(node_path_1.default.sep)
23
+ .join('/');
24
+ prerender = {
25
+ ...input.prerenderTarget,
26
+ src: src.split(node_path_1.default.sep).join('/'),
27
+ };
28
+ }
8
29
  addJob({
9
30
  entryPoint,
10
31
  remotionRoot,
@@ -18,7 +39,7 @@ const handleAddRender = ({ input, entryPoint, remotionRoot, logLevel, binariesDi
18
39
  status: 'idle',
19
40
  id,
20
41
  imageFormat: input.imageFormat,
21
- outName: input.outName,
42
+ outName,
22
43
  jpegQuality: input.jpegQuality,
23
44
  scale: input.scale,
24
45
  startedAt: Date.now(),
@@ -61,6 +82,7 @@ const handleAddRender = ({ input, entryPoint, remotionRoot, logLevel, binariesDi
61
82
  preferredEffectBackend: input.preferredEffectBackend,
62
83
  sampleRate: input.sampleRate,
63
84
  licenseKey: input.licenseKey,
85
+ prerender,
64
86
  },
65
87
  logLevel,
66
88
  });
@@ -44,7 +44,7 @@ const addSequenceKeyframeHandler = ({ input: { fileName, nodePath, key, frame, v
44
44
  (0, undo_stack_1.pushToUndoStack)({
45
45
  filePath: absolutePath,
46
46
  oldContents: fileContents,
47
- newContents: null,
47
+ newContents: output,
48
48
  logLevel,
49
49
  remotionRoot,
50
50
  logLine,
@@ -973,14 +973,27 @@ const resolveSequencePropsNodePathsFromFilename = ({ fileName, targets, remotion
973
973
  exports.resolveSequencePropsNodePathsFromFilename = resolveSequencePropsNodePathsFromFilename;
974
974
  const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, componentIdentity, keys, assetKeys = [], effects, }) => {
975
975
  try {
976
- return (0, codemods_1.getNodeProps)({
977
- project: { rootDir: '/', files: { 'source.tsx': fileContents } },
978
- node: { filePath: 'source.tsx', nodePath },
976
+ const result = codemods_1.CodemodsInternals.computeSequencePropsStatusFromContent({
977
+ fileContents,
978
+ includeSourceLocation: true,
979
+ nodePath,
979
980
  componentIdentity,
980
981
  keys,
981
982
  assetKeys,
982
- effectKeys: effects,
983
+ effects,
983
984
  });
985
+ const translate = result.props['style.translate'];
986
+ if (((translate === null || translate === void 0 ? void 0 : translate.status) === 'static' &&
987
+ typeof translate.codeValue === 'string' &&
988
+ translate.codeValue.includes('%')) ||
989
+ ((translate === null || translate === void 0 ? void 0 : translate.status) === 'keyframed' &&
990
+ translate.keyframes.some((keyframe) => typeof keyframe.value === 'string' && keyframe.value.includes('%')))) {
991
+ return {
992
+ ...result,
993
+ props: { ...result.props, 'style.translate': { status: 'computed' } },
994
+ };
995
+ }
996
+ return result;
984
997
  }
985
998
  catch (error) {
986
999
  if (error instanceof codemods_1.CodemodsInternals.JsxElementIdentityMismatchError) {
@@ -87,7 +87,7 @@ const deleteNodesHandler = ({ input: { nodes }, remotionRoot, logLevel }) => {
87
87
  (0, undo_stack_1.pushToUndoStack)({
88
88
  filePath: update.absolutePath,
89
89
  oldContents: update.fileContents,
90
- newContents: null,
90
+ newContents: update.output,
91
91
  logLevel,
92
92
  remotionRoot,
93
93
  logLine: update.logLine,
@@ -73,7 +73,7 @@ const duplicateNodesHandler = ({ input: { nodes }, remotionRoot, logLevel }) =>
73
73
  snapshots: updates.map((update) => ({
74
74
  filePath: update.absolutePath,
75
75
  oldContents: update.fileContents,
76
- newContents: null,
76
+ newContents: update.output,
77
77
  logLine: update.logLine,
78
78
  nodePathRemappings: update.nodePathRemappings,
79
79
  })),
@@ -5,7 +5,7 @@ const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
5
5
  const source_file_write_queue_1 = require("./source-file-write-queue");
6
6
  const invalidateBundleHandler = () => {
7
7
  return (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
8
- return { didInvalidate: await (0, watch_ignore_next_change_1.invalidatePreviouslySuppressedFiles)() };
8
+ return { didInvalidate: await (0, watch_ignore_next_change_1.invalidatePreviouslySuppressedFiles)(null) };
9
9
  });
10
10
  };
11
11
  exports.invalidateBundleHandler = invalidateBundleHandler;
@@ -0,0 +1,3 @@
1
+ import type { PrerenderedSceneInfoRequest, PrerenderedSceneInfoResponse } from '@remotion/studio-shared';
2
+ import type { ApiHandler } from '../api-types';
3
+ export declare const prerenderedSceneInfoHandler: ApiHandler<PrerenderedSceneInfoRequest, PrerenderedSceneInfoResponse>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.prerenderedSceneInfoHandler = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const prerendered_scene_1 = require("../prerendered-scene");
9
+ const prerenderedSceneInfoHandler = ({ input: { src }, publicDir, remotionRoot }) => {
10
+ const sidecar = (0, prerendered_scene_1.readPrerenderedSceneSidecar)({ publicDir, src });
11
+ if (sidecar === null) {
12
+ return Promise.resolve({ type: 'not-prerendered' });
13
+ }
14
+ let stale = null;
15
+ if (sidecar.sceneFile !== null && sidecar.sceneFileHash !== null) {
16
+ try {
17
+ stale =
18
+ (0, prerendered_scene_1.hashSceneFile)(node_path_1.default.resolve(remotionRoot, sidecar.sceneFile)) !==
19
+ sidecar.sceneFileHash;
20
+ }
21
+ catch (_a) {
22
+ stale = true;
23
+ }
24
+ }
25
+ return Promise.resolve({
26
+ type: 'prerendered',
27
+ compositionId: sidecar.compositionId,
28
+ stale,
29
+ });
30
+ };
31
+ exports.prerenderedSceneInfoHandler = prerenderedSceneInfoHandler;
@@ -49,7 +49,7 @@ const reorderSequenceHandler = ({ input: { fileName, sourceNodePaths, targetNode
49
49
  (0, undo_stack_1.pushToUndoStack)({
50
50
  filePath: absolutePath,
51
51
  oldContents: fileContents,
52
- newContents: null,
52
+ newContents: output,
53
53
  logLevel,
54
54
  remotionRoot,
55
55
  logLine,
@@ -1,86 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.replaceVideoSourceHandler = void 0;
4
- const node_fs_1 = require("node:fs");
5
4
  const codemods_1 = require("@remotion/codemods");
6
- const renderer_1 = require("@remotion/renderer");
7
5
  const no_react_1 = require("remotion/no-react");
8
- const file_watcher_1 = require("../../file-watcher");
9
- const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
10
- const format_log_file_location_1 = require("../format-log-file-location");
11
- const sequence_node_path_mutation_1 = require("../sequence-node-path-mutation");
12
- const undo_stack_1 = require("../undo-stack");
13
- const source_file_write_queue_1 = require("./source-file-write-queue");
14
- const replaceVideoSourceHandler = ({ input: { fileName, nodePath, src }, remotionRoot, logLevel }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(() => {
15
- var _a;
16
- var _b, _c;
17
- try {
18
- const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
19
- remotionRoot,
20
- fileName,
21
- action: 'modify',
22
- });
23
- const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
24
- const result = (0, codemods_1.updateNodeProps)({
25
- project: {
26
- files: { [absolutePath]: fileContents },
27
- rootDir: remotionRoot,
28
- },
29
- node: { filePath: absolutePath, nodePath },
30
- updates: [
31
- {
32
- key: 'src',
33
- value: `${no_react_1.NoReactInternals.FILE_TOKEN}${src.split('/').map(encodeURIComponent).join('/')}`,
34
- defaultValue: null,
35
- },
36
- ],
37
- });
38
- const output = (_b = (_a = result.changes[0]) === null || _a === void 0 ? void 0 : _a.nextContents) !== null && _b !== void 0 ? _b : fileContents;
39
- const { logLine } = result;
40
- const nodePathRemappings = result.nodePathRemappings.map(({ oldNodePath, newNodePath, oldJsxName, newJsxName }) => ({
41
- oldNodePath,
42
- newNodePath,
43
- oldJsxName,
44
- newJsxName,
45
- }));
46
- const nodePathMutation = (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)([{ absolutePath, remappings: nodePathRemappings }], null);
47
- (0, undo_stack_1.pushToUndoStack)({
48
- filePath: absolutePath,
49
- oldContents: fileContents,
50
- newContents: null,
51
- logLevel,
52
- remotionRoot,
53
- logLine,
54
- description: {
55
- undoMessage: '↩️ Removed video background',
56
- redoMessage: '↪️ Removed video background',
6
+ const commit_node_codemod_1 = require("../commit-node-codemod");
7
+ const replaceVideoSourceHandler = ({ input: { fileName, nodePath, src }, remotionRoot, logLevel }) => (0, commit_node_codemod_1.commitNodeCodemod)({
8
+ remotionRoot,
9
+ logLevel,
10
+ fileName,
11
+ nodePath,
12
+ codemod: ({ project, node }) => (0, codemods_1.updateNodeProps)({
13
+ project,
14
+ node,
15
+ updates: [
16
+ {
17
+ key: 'src',
18
+ value: `${no_react_1.NoReactInternals.FILE_TOKEN}${src.split('/').map(encodeURIComponent).join('/')}`,
19
+ defaultValue: null,
57
20
  },
58
- entryType: 'replace-video-source',
59
- suppressHmrOnFileRestore: false,
60
- nodePathRemappings,
61
- });
62
- (0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
63
- (0, file_watcher_1.writeFileAndNotifyFileWatchers)({
64
- file: absolutePath,
65
- content: output,
66
- originatorClientId: undefined,
67
- metadata: { skipSequencePropsUpdate: true },
68
- });
69
- const locationLabel = (0, format_log_file_location_1.formatLogFileLocation)({
70
- remotionRoot,
71
- absolutePath,
72
- line: logLine,
73
- });
74
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(locationLabel)} Replaced video source`);
75
- (0, undo_stack_1.printUndoHint)(logLevel);
76
- return Promise.resolve({ success: true, nodePathMutation });
77
- }
78
- catch (error) {
79
- return Promise.resolve({
80
- success: false,
81
- reason: error.message,
82
- stack: (_c = error.stack) !== null && _c !== void 0 ? _c : '',
83
- });
84
- }
21
+ ],
22
+ }),
23
+ label: 'Removed video background',
24
+ entryType: 'replace-video-source',
25
+ }).then(({ nodePathMutation }) => ({ success: true, nodePathMutation }), (error) => {
26
+ var _a;
27
+ return ({
28
+ success: false,
29
+ reason: error.message,
30
+ stack: (_a = error.stack) !== null && _a !== void 0 ? _a : '',
31
+ });
85
32
  });
86
33
  exports.replaceVideoSourceHandler = replaceVideoSourceHandler;
@@ -0,0 +1,3 @@
1
+ import type { RestorePrerenderedSceneRequest, RestorePrerenderedSceneResponse } from '@remotion/studio-shared';
2
+ import type { ApiHandler } from '../api-types';
3
+ export declare const restorePrerenderedSceneHandler: ApiHandler<RestorePrerenderedSceneRequest, RestorePrerenderedSceneResponse>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.restorePrerenderedSceneHandler = void 0;
4
+ const codemods_1 = require("@remotion/codemods");
5
+ const commit_node_codemod_1 = require("../commit-node-codemod");
6
+ const prerendered_scene_1 = require("../prerendered-scene");
7
+ const restorePrerenderedSceneHandler = ({ input: { fileName, nodePath, src }, publicDir, remotionRoot, logLevel }) => {
8
+ const sidecar = (0, prerendered_scene_1.readPrerenderedSceneSidecar)({ publicDir, src });
9
+ if (sidecar === null) {
10
+ return Promise.resolve({
11
+ success: false,
12
+ reason: 'This video was not rendered from a scene',
13
+ stack: '',
14
+ });
15
+ }
16
+ return (0, commit_node_codemod_1.commitNodeCodemod)({
17
+ remotionRoot,
18
+ logLevel,
19
+ fileName,
20
+ nodePath,
21
+ codemod: ({ project, node }) => codemods_1.CodemodsInternals.replaceJsxElementWithSource({
22
+ project,
23
+ node,
24
+ source: sidecar.source,
25
+ importStatements: sidecar.importStatements,
26
+ }),
27
+ label: 'Restored unrendered scene',
28
+ entryType: 'restore-prerendered-scene',
29
+ }).then(({ nodePathMutation }) => ({ success: true, nodePathMutation }), (error) => {
30
+ var _a;
31
+ return ({
32
+ success: false,
33
+ reason: error.message,
34
+ stack: (_a = error.stack) !== null && _a !== void 0 ? _a : '',
35
+ });
36
+ });
37
+ };
38
+ exports.restorePrerenderedSceneHandler = restorePrerenderedSceneHandler;
@@ -81,7 +81,7 @@ const saveEffectPropsHandler = ({ input, remotionRoot, logLevel }) => (0, source
81
81
  (0, undo_stack_1.pushToUndoStack)({
82
82
  filePath: absolutePath,
83
83
  oldContents: fileContents,
84
- newContents: null,
84
+ newContents: output,
85
85
  logLevel,
86
86
  remotionRoot,
87
87
  logLine,
@@ -73,7 +73,9 @@ const convertSequencePropEditToCodemodChange = (edit) => {
73
73
  exports.convertSequencePropEditToCodemodChange = convertSequencePropEditToCodemodChange;
74
74
  const shouldSuppressHmrForSequencePropEdits = (edits) => {
75
75
  return edits.every((edit) => edit.key !== 'showInTimeline' &&
76
- (edit.sourceEdit === null || edit.sourceEdit === undefined));
76
+ (edit.sourceEdit === null ||
77
+ edit.sourceEdit === undefined ||
78
+ edit.sourceEdit.type === 'playback-rate'));
77
79
  };
78
80
  exports.shouldSuppressHmrForSequencePropEdits = shouldSuppressHmrForSequencePropEdits;
79
81
  const saveSequencePropsHandler = ({ input: { edits, addedKeyframes, movedKeyframes, captionPatches = [], clientId, undoLabel, redoLabel, }, remotionRoot, logLevel, }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
@@ -77,7 +77,7 @@ const splitSequencesHandler = ({ input: { sequences }, remotionRoot, logLevel })
77
77
  snapshots: updates.map((update) => ({
78
78
  filePath: update.absolutePath,
79
79
  oldContents: update.fileContents,
80
- newContents: null,
80
+ newContents: update.output,
81
81
  logLine: update.logLine,
82
82
  nodePathRemappings: update.nodePathRemappings,
83
83
  })),
@@ -43,7 +43,7 @@ const splitVideoFromAudioHandler = ({ input: { fileName, nodePath }, remotionRoo
43
43
  (0, undo_stack_1.pushToUndoStack)({
44
44
  filePath: absolutePath,
45
45
  oldContents: fileContents,
46
- newContents: null,
46
+ newContents: output,
47
47
  logLevel,
48
48
  remotionRoot,
49
49
  logLine,
@@ -5,30 +5,53 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.subscribeToSequenceProps = void 0;
7
7
  const node_path_1 = __importDefault(require("node:path"));
8
+ const resolve_compiled_sequence_paths_1 = require("../resolve-compiled-sequence-paths");
8
9
  const sequence_props_watchers_1 = require("../sequence-props-watchers");
10
+ const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
9
11
  const can_update_sequence_props_1 = require("./can-update-sequence-props");
10
- const subscribeToSequenceProps = ({ input, remotionRoot, logLevel }) => {
11
- var _a;
12
+ const subscribeToSequenceProps = async ({ input, remotionRoot, logLevel }) => {
13
+ var _a, _b;
14
+ var _c, _d, _e, _f;
12
15
  // Source contents are shared only within this synchronous subscription batch.
13
16
  const fileContentsCache = new Map();
14
17
  const requestsByFile = new Map();
15
18
  for (const [index, request] of input.requests.entries()) {
16
19
  const absolutePath = node_path_1.default.resolve(remotionRoot, request.fileName);
17
- const indexes = (_a = requestsByFile.get(absolutePath)) !== null && _a !== void 0 ? _a : [];
20
+ const indexes = (_c = requestsByFile.get(absolutePath)) !== null && _c !== void 0 ? _c : [];
18
21
  indexes.push(index);
19
22
  requestsByFile.set(absolutePath, indexes);
20
23
  }
21
24
  const results = [];
22
25
  // Finish each file before moving on so large batches do not evict and
23
26
  // repeatedly parse the same source snapshot from the bounded AST cache.
24
- for (const indexes of requestsByFile.values()) {
25
- const unresolved = indexes
26
- .filter((index) => input.requests[index].nodePath === null)
27
- .map((index) => ({
28
- index,
29
- line: input.requests[index].line,
30
- column: input.requests[index].column,
31
- }));
27
+ const staleFiles = new Set();
28
+ for (const [absolutePath, indexes] of requestsByFile) {
29
+ const unresolved = [];
30
+ const compiledTargets = [];
31
+ for (const index of indexes) {
32
+ const { line, column, nodePath } = input.requests[index];
33
+ if (nodePath !== null)
34
+ continue;
35
+ const hash = (_d = (_a = input.compiledSourceHashes) === null || _a === void 0 ? void 0 : _a[index]) !== null && _d !== void 0 ? _d : null;
36
+ if (hash === null)
37
+ unresolved.push({ index, line, column });
38
+ else
39
+ compiledTargets.push({ index, line, column, hash });
40
+ }
41
+ let compiledPaths = new Map();
42
+ if (compiledTargets.length > 0) {
43
+ try {
44
+ compiledPaths = (0, resolve_compiled_sequence_paths_1.resolveCompiledSequencePaths)({
45
+ fileName: input.requests[indexes[0]].fileName,
46
+ remotionRoot,
47
+ fileContentsCache,
48
+ targets: compiledTargets,
49
+ });
50
+ }
51
+ catch (_g) {
52
+ // An unavailable or unparsable source cannot be safely located in a newer file.
53
+ }
54
+ }
32
55
  const resolvedNodePaths = new Map();
33
56
  if (unresolved.length > 0) {
34
57
  try {
@@ -44,17 +67,22 @@ const subscribeToSequenceProps = ({ input, remotionRoot, logLevel }) => {
44
67
  }
45
68
  }
46
69
  }
47
- catch (_b) {
70
+ catch (_h) {
48
71
  // Let each subscription produce its usual not-found response.
49
72
  }
50
73
  }
51
74
  for (const index of indexes) {
52
75
  const { fileName, line, column, nodePath, componentIdentity, keys, assetKeys, effects, clientId, } = input.requests[index];
53
- results[index] = (0, sequence_props_watchers_1.subscribeToSequencePropsWatchers)({
76
+ const requireExactNodePath = nodePath === null &&
77
+ ((_e = (_b = input.compiledSourceHashes) === null || _b === void 0 ? void 0 : _b[index]) !== null && _e !== void 0 ? _e : null) !== null;
78
+ const result = (0, sequence_props_watchers_1.subscribeToSequencePropsWatchers)({
54
79
  fileName,
55
80
  line,
56
81
  column,
57
- nodePath,
82
+ nodePath: requireExactNodePath
83
+ ? ((_f = compiledPaths.get(index)) !== null && _f !== void 0 ? _f : null)
84
+ : nodePath,
85
+ requireExactNodePath,
58
86
  resolvedNodePath: resolvedNodePaths.get(index),
59
87
  componentIdentity,
60
88
  keys,
@@ -65,8 +93,15 @@ const subscribeToSequenceProps = ({ input, remotionRoot, logLevel }) => {
65
93
  logLevel,
66
94
  fileContentsCache,
67
95
  });
96
+ results[index] = result;
97
+ if (requireExactNodePath &&
98
+ !result.success &&
99
+ result.status.reason === 'not-found') {
100
+ staleFiles.add(absolutePath);
101
+ }
68
102
  }
69
103
  }
70
- return Promise.resolve({ results });
104
+ await Promise.all([...staleFiles].map((file) => (0, watch_ignore_next_change_1.invalidatePreviouslySuppressedFiles)(file)));
105
+ return { results };
71
106
  };
72
107
  exports.subscribeToSequenceProps = subscribeToSequenceProps;
@@ -54,7 +54,7 @@ const unwrapNodeHandler = ({ input: { fileName, compositionId, nodePath, dryRun
54
54
  {
55
55
  filePath: absolutePath,
56
56
  oldContents: fileContents,
57
- newContents: null,
57
+ newContents: output,
58
58
  logLine: line,
59
59
  nodePathRemappings: remappings,
60
60
  },
@@ -52,7 +52,7 @@ const updateEffectKeyframeSettingsHandler = ({ input: { fileName, sequenceNodePa
52
52
  (0, undo_stack_1.pushToUndoStack)({
53
53
  filePath: absolutePath,
54
54
  oldContents: fileContents,
55
- newContents: null,
55
+ newContents: output,
56
56
  logLevel,
57
57
  remotionRoot,
58
58
  logLine,
@@ -48,7 +48,7 @@ const updateSequenceKeyframeSettingsHandler = ({ input: { fileName, nodePath, ke
48
48
  (0, undo_stack_1.pushToUndoStack)({
49
49
  filePath: absolutePath,
50
50
  oldContents: fileContents,
51
- newContents: null,
51
+ newContents: output,
52
52
  logLevel,
53
53
  remotionRoot,
54
54
  logLine,
@@ -73,7 +73,7 @@ const wrapNodeHandler = ({ input: { fileName, compositionId, nodePath, wrapper,
73
73
  {
74
74
  filePath: absolutePath,
75
75
  oldContents: fileContents,
76
- newContents: null,
76
+ newContents: output,
77
77
  logLine: line,
78
78
  nodePathRemappings: remappings,
79
79
  },
@@ -0,0 +1,2 @@
1
+ import type { webpack } from '@remotion/bundler';
2
+ export declare const trackSequenceNodePathMutationBuilds: (compiler: webpack.Compiler) => (statsResult: webpack.Stats) => string | null;