visual-mode
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVisual Mode is a feature in Remotion Studio that allows one to visually edit Sequences.
I've made the following observations:
可视化模式是Remotion Studio中的一项功能,允许用户可视化编辑序列。
我有以下观察结果:
Fields
字段
- overrideId -> does keep the identity the same of a sequence, even if the file / line / column changes
- Sequence -> changes on hot reload. shared by multiple sequences which have different overrideIds
stack - Sequence file, line, column (symbolicated stack) -> does not change, but needs to be calculated asyn
- -> same identity, even if line, stack and overrideId changes. async
nodePath
nodePath + index is ideal way to keep track of the expanded state. that’s the end goal.
Once nodePath is mapped to , it doesn’t change otherwise component would remount and overrideId works change.
overrideIdIf the same is found already used by another sequence, we re-use the .
stackoverrideIdnodePathWe should only fetch the nodepath for every stack once
different unsymbolicated stacks could lead to the same symbolicated stack, because of fast refresh
unsymbolicated to symbolicated stack does never change because if it does, it is a different stack due to fast refresh
- overrideId -> 即使文件/行/列发生变化,也会保持序列的标识不变
- Sequence -> 热重载时会发生变化。由多个具有不同overrideId的序列共享
stack - Sequence的文件、行、列(符号化堆栈)-> 不会变化,但需要异步计算
- -> 即使行、堆栈和overrideId发生变化,标识仍保持一致。异步获取
nodePath
nodePath + 索引是跟踪展开状态的理想方式,这是最终目标。
一旦nodePath映射到,除非组件重新挂载导致overrideId改变,否则它不会变化。
overrideId如果发现相同的已被另一个序列使用,我们会复用该。
stackoverrideId理论上,每次文件更改时,到符号化堆栈的映射都可能改变。但多个序列可以共享同一个堆栈,此时它们的nodePath也相同。
nodePath我们应该只为每个堆栈获取一次nodePath
由于快速刷新,不同的未符号化堆栈可能会指向同一个符号化堆栈
未符号化堆栈到符号化堆栈的映射永远不会改变,因为如果发生变化,那就是快速刷新导致的另一个不同堆栈