跳到正文
cccskills
免费在 GitHub 公开

studio-config-option-lifecycle

Classify Remotion Studio settings as fixed at startup or reloadable, then wire every component that uses them consistently. Guide implementation and review of configuration reloads, default resets, CLI precedence, and render queue settings.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Classify and wire Remotion Studio config options as either startup-fixed or reloadable while preventing mixed lifecycle behavior across consumers. Use when adding, changing, or reviewing a Config setter or CLI option consumed by Studio, its preview server, compiler, HTML bootstrap, public-folder watcher, or render queue.

查看安装方法

适用场景

  • Add a Studio config setter or CLI option
  • Review inconsistent setting updates across Studio components
  • Keep preview and render queue settings aligned
  • Check default resets and recovery from invalid config changes

包含的文件(2)

  • SKILL.md5.1 KB
  • agents/openai.yaml244 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Studio Config Option Lifecycle

Make reload behavior explicit for every Studio-facing option. A config file is reset and re-executed when it changes, but a consumer only observes the new value if its code reads the option again.

Classify the whole option

Inspect every Studio consumer, then assign one lifecycle to the whole option:

  • Startup-fixed: Changing the value requires recreating a server, compiler, watcher, directory mapping, or other initialized resource.
  • Reloadable: Every Studio consumer can safely use the new value after the browser reload or at another deliberate request boundary.

If any consumer must be startup-fixed, make the option startup-fixed for all Studio consumers. Do not implement mixed lifecycle behavior.

Do not infer reloadability from Config.set*() state being updated. Config re-execution updates module state regardless of whether an already-created consumer observes it.

Wire startup-fixed values

Resolve the option once in packages/cli/src/studio.ts before calling startStudio():

const fixedValue = option.getValue({commandLine: parsedCli}).value;

await StudioServerInternals.startStudio({
	fixedValue,
});

Pass the value, not a getter, through startStudio(), startServer(), and the consumer. Keep new internal parameters required; use T | null when absence is valid.

Capture startup-fixed render settings in StudioRenderJobFixedConfig at the Studio queue boundary and thread that object into the job processor. Do not call option.getValue() from the processor, because config state may have changed since Studio startup.

Typical startup-fixed consumers include the Studio port, entry point, active compiler choice and override, polling mode, public directory and watcher, network binding, and cross-site-isolation headers.

Wire reloadable values

Read reloadable options through a getter that retains CLI precedence:

const getValue = () =>
	option.getValue({commandLine: parsedCli}).value;

await StudioServerInternals.startStudio({
	getValue,
});

Pass the getter as a required internal callback and invoke it only at the boundary that should observe config changes, such as generating Studio HTML after the config-file-changed browser reload. Do not evaluate the getter earlier and pass its result onward.

Use the existing getStudioRuntimeConfig() path for values already represented by StudioRuntimeConfig. Be careful when extending that exported type: adding a required property can be a public API break. For independent HTML bootstrap values, pass a dedicated getter through the internal Studio server layers.

Only use this pattern when all Studio consumers are reloadable. Typical examples include UI behavior and HTML bootstrap defaults that do not require rebuilding initialized resources.

Resolve lifecycle conflicts

Search all reads of the option and decide each one independently:

rg -n "myOption|setMyOption|my-cli-flag" packages

If the consumers do not all support reloading, capture the option once at Studio startup and pass that same value to every consumer. For example, if the active preview compiler cannot change bundlers, future render jobs must retain the startup bundler choice as well.

Treat aliases as one option. If a deprecated setter updates multiple underlying values, make every affected Studio consumer follow the stricter startup-fixed lifecycle.

Reset and rollback

Ensure config reload resets the option before executing the changed file, so deleting a setter restores the default. Options registered through BrowserSafeApis.options and exposed directly through Config are reset by resetBrowserSafeConfigOptions(). Add an explicit reset in ConfigInternals.resetConfigOptions() for custom module state.

Preserve transactional reload behavior: an invalid changed config must leave the previous valid configuration active.

Verify the lifecycle

Use existing checks or a manual workflow to verify the classification:

  • Reloadable: change the option after the initial read, cross the intended reload/request boundary, and confirm the new value is observed.
  • Startup-fixed: capture the initial value, change config state, and confirm the initialized consumer still receives the original value.
  • Cross-consumer: confirm every Studio consumer receives the same startup snapshot when any one consumer requires it.
  • Reset: omit a previously set option on reload and confirm its default is restored.
  • Nullable internal inputs: verify call sites pass null explicitly when no value exists.

Run focused builds and checks for the affected packages:

bunx turbo run make lint formatting --filter='@remotion/cli' --filter='@remotion/studio-server'
bun test packages/cli/src/test/config-reload.test.ts packages/cli/src/test/config-reset.test.ts

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

add-bug

免费

Add a reported Remotion bug to the bugs API with its affected versions, a short title, and upgrade guidance. Follow the existing entry format and place the new record first so recent bugs appear at the top.

中文简介正在准备中。当前显示英语简介。

  • Adding a reported bug to the Remotion bugs API
  • Recording which versions a bug affects
  • Including upgrade guidance in a bug description
remotion-dev/remotion6.5万2026年10月19日 更新

Add a Remotion command-line or configuration option, or convert a hardcoded flag into a shared option definition. Connect parsing, configuration setters, help entries, and generated documentation so the option is consistently available and documented.

中文简介正在准备中。当前显示英语简介。

  • Add a new Remotion command-line flag
  • Convert a hardcoded flag into a shared option
  • Connect an option to Config setters
remotion-dev/remotion6.5万2026年10月19日 更新

Add a new effect to @remotion/effects, including its implementation, package entry points, documentation, interactive demo, and preview images. Follow the package conventions and verify the changes with tests, formatting checks, and builds.

中文简介正在准备中。当前显示英语简介。

  • Implementing a new effect for @remotion/effects
  • Registering effect imports and parameter types
  • Creating documentation and an interactive effect demo
remotion-dev/remotion6.5万2026年10月19日 更新

Add a person to the Remotion experts page by placing their portrait, entering their profile and contact links, and generating an expert card image. The instructions specify file locations, profile fields, and how to verify card generation.

中文简介正在准备中。当前显示英语简介。

  • Add a new person to the Remotion experts page
  • Register a portrait, specialties, and contact links
  • Generate an expert card image
remotion-dev/remotion6.5万2026年10月19日 更新

Create a new @remotion package within the Remotion monorepo, a repository containing multiple packages. Set up its files, register it across the project, and prepare documentation, usage examples, and build configuration.

中文简介正在准备中。当前显示英语简介。

  • Creating a new @remotion package
  • Registering a package across the monorepo
  • Adding documentation and usage examples
remotion-dev/remotion6.5万2026年10月19日 更新

add-sfx

免费

Add a new sound effect to @remotion/sfx, from registering the audio file to exporting its URL and documenting its use. The workflow covers playback examples, attribution, navigation entries, waveform generation, and the package build.

中文简介正在准备中。当前显示英语简介。

  • Add a sound effect to @remotion/sfx
  • Create documentation with playback and usage examples
  • Update sound effect navigation and waveform data
remotion-dev/remotion6.5万2026年10月19日 更新

查看 remotion-dev 的全部技能

报告此技能的问题