Skip to content

@remotion/studio: Save default props immediately#6826

Draft
JonnyBurger wants to merge 16 commits intomainfrom
subscribe-default-props
Draft

@remotion/studio: Save default props immediately#6826
JonnyBurger wants to merge 16 commits intomainfrom
subscribe-default-props

Conversation

@JonnyBurger
Copy link
Member

@JonnyBurger JonnyBurger commented Mar 6, 2026

TODO:

  • In it's place, there should be a good undo + redo system
  • Debounce InputDraggers, colors, text fields
  • Should print good console messages
  • Need to deprecate updateDefaultProps().. I think?
  • There should only be 1 state of truth, should synchronize across tabs. default-props-updatable-changed should write updateProps.
  • Should be able to change in code and get the newest value immediately
  • In read-only mode, there should still be a way to reset the values to the original.
  • Visual controls should work just as well
  • Indicate that it is saving? Or no?
  • Should not interfere updateDefaultProps() API
  • Should skip prettier and log
  • Should log a hint that it can be undone with Cmd+Z
  • Text input, textarea and color input save on blur does not yet work properly
  • Can we make Prettier update faster by only formatting part of the file?
  • Do changes apply in Studio, if the composition is not focused? If we just switch to it afterwards?

Replace polling pattern for default props updatability with server-push
subscriptions (mirroring sequence props pattern), apply default props
changes immediately on save with server-side HMR suppression, and
extract current default props values from the source AST.

- Add /api/subscribe-to-default-props and /api/unsubscribe-from-default-props
- Remove /api/can-update-default-props polling endpoint
- Push 'default-props-updatable-changed' SSE events on root file changes
- Extract current defaultProps values from source AST via isStaticValue/extractStaticValue
- Handle TSAsExpression nodes (e.g. 'a' as const) in isStaticValue and extractStaticValue
- Suppress HMR in update-default-props handler (matching save-sequence-props)
- Apply default props optimistically on save, revert on error
- Remove client-side remotion_ignoreFastRefreshUpdate usage for default props
- Clean up default props watchers on client disconnect

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Mar 6, 2026 6:41pm
remotion Ready Ready Preview, Comment Mar 6, 2026 6:41pm

Request Review

Instead of installing a new file watcher per client, use one ref-counted
global watcher for the root file. Different clients can subscribe to
different compositionIds; on file change, each active compositionId is
recomputed and pushed. Also removes debug console.log calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add sendEventToClientId() to LiveEventsServer for targeted delivery.
The default props watcher now sends events only to clients that
subscribed to the specific compositionId, not to all connected clients.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pullfrog
Copy link
Contributor

pullfrog bot commented Mar 6, 2026

CI fix pushed

Root cause: DataEditor.tsx imported Internals from 'remotion' but never used it, causing TS6133: 'Internals' is declared but its value is never read — which failed the @remotion/studio#make build step (tsgo -d). This cascaded across 7 CI jobs (Linting + Formatting, SSR integration, Lambda integration, Next.js SSR build, and others).

Fix: Removed the unused Internals import from packages/studio/src/components/RenderModal/DataEditor.tsx (line 9).

-import {getInputProps, Internals} from 'remotion';
+import {getInputProps} from 'remotion';

Pullfrog  | View workflow run | Using Cursor CLI | Triggered by Pullfrogpullfrog.com𝕏

@pullfrog
Copy link
Contributor

pullfrog bot commented Mar 6, 2026

CI Fix

Failure: @remotion/studio#lint — eslint no-console error at packages/studio/src/components/DefaultPropsEditor.tsx:221

Cause: A debug console.log('onSave', onSave, saving) statement was left in the code.

Fix: Removed the debug console.log statement. Pushed as 91a33c3.

Pullfrog  | View workflow run | Using Cursor CLI | Triggered by Pullfrogpullfrog.com𝕏

@JonnyBurger JonnyBurger changed the title Subscribe-based default props + immediate save @remotion/studio: Save default props immediately Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant