Repository navigation
fix(studio): 内置视频模板渲染不再把 webpack 缓存写进安装目录 - #138
Merged
freedomkk-qfeng merged 5 commits intoOct 15, 2026
Merged
Conversation
Remotion 以入口文件最近的 package.json 作为项目根,把 webpack 文件系统缓存写到 <根>/node_modules/.cache/webpack。Studio 视频模板随共享服务包安装,缓存因此写进 应用包内部(macOS 上约 142 MB),破坏 .app 的签名封印。内置模板改为不缓存; 用户工作区中的可编辑视频项目保持原有缓存行为。
This was referenced Oct 12, 2026
Member
|
缓存处理的方向和改动范围可以接受:内置模板关闭 webpack 缓存,用户工作区中的可编辑视频项目继续保留缓存。 请先同步最新 main,重新生成 source-receipt.json 并重跑 CI。目前新增的缓存回归通过;media-runtime.test.mjs 里另有一条缺少浏览器时的提示文本断言,在 main 上也会失败,请顺带对齐实际提示,避免后续验收一直带着这条旧失败。 当前桌面的 pinned-source 装配会复制这份 artifact-services 源码,修复能进入候选包。同步 main 后请用候选包确认内置视频不再往安装目录写缓存,工作区视频工程仍正常。 |
Contributor
Author
|
已同步 main(3977b35),回执已重新生成,CI 全部通过。
未测:Windows 候选包(代码路径相同)。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Studio 生成视频时,共享服务用 Remotion
bundle()打包随包安装的视频模板。Remotion 以入口文件最近的package.json所在目录为项目根,打包时切换到该目录,webpack 文件系统缓存因此落在<根>/node_modules/.cache/webpack;Remotion 在webpackOverride之后才设置cache,无法通过覆盖配置改写位置。桌面版中这个根就是应用包内的@eduwork/dsh-artifact-services,一次渲染会向安装目录写入约 142 MB 缓存,macOS.app的签名封印随之失效(codesign --verify --strict:a sealed resource is missing or invalid)。改动
prepareComposition增加enableCaching(默认true),透传给 Remotionbundle()。renderMedia打包内置模板时传enableCaching: false;用户工作区中的可编辑视频项目(video-runner)保持原有缓存。验证
macOS 27.0.1 arm64。使用 0.4.2 正式包的两个副本(包内
media.js、remotion.js、runtime.js与当前 main 逐字节一致,Remotion 4.0.520),以包内 Node 直接调用包内渲染模块,连续渲染两次合成无旁白视频:codesign --verify --strictnode_modules/.cache/webpack/...,约 142 MB)codesign --verify --strict两组输出均为 90 帧、3.05 秒视频,抽帧画面一致。不缓存使后续渲染的打包阶段约多 2 秒,首次渲染不再需要写入缓存。
test/media-runtime.test.mjs通过;Studio typecheck、build、audit 通过。/var与/private/var路径比较、测试直接调用 Remotion ffmpeg 时未设置工作目录),本改动没有新增失败。--verify-receipt。未测:Windows 实机渲染(同一代码路径会把缓存写进安装目录,修复方式相同);通过桌面界面生成 Studio 视频的完整流程。npm 发布与产品锁更新不在本 PR 范围。