🎥 Make videos programmatically with React
more docs
JonnyBurger9e9baff013bd
diff --git a/packages/docs/docs/editor-starter/asset-uploads.mdx b/packages/docs/docs/editor-starter/asset-uploads.mdxindex 88f99315a7..2ce1a562f2 100644--- a/packages/docs/docs/editor-starter/asset-uploads.mdx+++ b/packages/docs/docs/editor-starter/asset-uploads.mdx@@ -6,7 +6,8 @@ id: asset-uploadscrumb: Editor Starter----If the user drops in any image, audio, video or GIF, you can configure them to be uploaded to an S3 bucket.+If the user drops in any image, audio, video or GIF, they are uploaded to cloud storage so that rendering in the cloud can be performed later.+By default, S3 is used for cloud storage, which requires some setup.## Setup@@ -57,11 +58,19 @@ Make sure to replace `YOUR_BUCKET_NAME` with the name of your bucket.In your `.env` file, fill now the following variables:```txt-AWS_ACCESS_KEY_ID=-AWS_SECRET_ACCESS_KEY=-AWS_REGION=-AWS_BUCKET_NAME=+REMOTION_AWS_ACCESS_KEY_ID=+REMOTION_AWS_SECRET_ACCESS_KEY=+REMOTION_AWS_REGION=+REMOTION_AWS_BUCKET_NAME=```+:::note+The same environment variables are also used for [rendering](/docs/editor-starter/rendering) in the cloud.+:::+Now, restart the Editor Starter.When you drop in an asset, it should be uploaded to the S3 bucket!++## See also++- [Tracks, items and assets](/docs/editor-starter/tracks-items-assets)diff --git a/packages/docs/docs/editor-starter/persistance.mdx b/packages/docs/docs/editor-starter/persistance.mdxindex e8824c7783..8eaa59d85e 100644--- a/packages/docs/docs/editor-starter/persistance.mdx+++ b/packages/docs/docs/editor-starter/persistance.mdx@@ -5,3 +5,7 @@ sidebar_label: Persistanceid: persistancecrumb: Editor Starter---++There are 2 types of persistance in the Editor Starter:++- Saving the editor statediff --git a/packages/docs/docs/editor-starter/state-management.mdx b/packages/docs/docs/editor-starter/state-management.mdxindex b5a33a32cb..33871404ed 100644--- a/packages/docs/docs/editor-starter/state-management.mdx+++ b/packages/docs/docs/editor-starter/state-management.mdx@@ -85,3 +85,34 @@ In [`src/editor-context-provider.tsx`](https://github.com/remotion-dev/editor-stThis is intentional and achieves that when updating a portion of the state, only the components that are dependent on that portion of the state will re-render, while the rest of the components will not.For the best performance, we recommend that you continue to use this pattern in your own application.++## Preventing state updates when nothing has changed++You should prevent an unnecessary state update when nothing has changed.++- This is better for performance+- [This will prevent adding a snapshot to the undo stack, which would lead to clicking the undo button once with no effect](/docs/editor-starter/undo-redo#preventing-unnecessary-additions-to-the-undo-stack)++Throughout the codebase, you will see checks that prevent an unnecessary state update.++```ts title="Preventing an identity change"+export const markAsDragging = (state: EditorState, itemId: string): EditorState => {+ return changeItem(state, itemId, (item) => {+ if (item.isDragging) {+ // The item would not change, so we return the original object+ return item;+ }++ return {+ ...item,+ isDragging: true,+ };+ });+};+```++We recommend that you continue to use this pattern when you iterate on the Editor Starter.++## See also++- [Undo and Redo](/docs/editor-starter/undo-redo)diff --git a/packages/docs/docs/editor-starter/undo-and-redo.mdx b/packages/docs/docs/editor-starter/undo-and-redo.mdxindex 65364380fe..a21bef86f4 100644--- a/packages/docs/docs/editor-starter/undo-and-redo.mdx+++ b/packages/docs/docs/editor-starter/undo-and-redo.mdx@@ -18,35 +18,19 @@ Whenever updating a state, you should set the `commitToUndoStack` property approActions that you may not want to add to the undo stack are high-frequency state update like:-- Dragging an item to a new position in the canvas-- Dragging an item to a new position in the timeline+- Dragging an item in the canvas+- Dragging an item in the timeline- Trimming an item in the timeline- Changing a value in the inspector with the slider-In these cases, it is appropriate to only commit to the undo stack once the mouse cursor is released.+In these cases, it is appropriate to only commit to the undo stack once the **mouse cursor is released**.-## Preventing state changes+## Preventing unnecessary additions to the undo stack-You should prevent an unnecessary write to the undo stack when nothing has changed.-Nothing is written to the undo stack when the identity of the `undoableState` object has not changed.+An addition to the undo stack is only made when the object reference of the state has changed.+If after a state update, JavaScript evaluates `oldState === newState` to `true`, the state update is not added to the undo stack.-This may require you to add additional checks to your state update functions to return the same object if nothing has changed.--```ts title="Preventing an identity change"-export const markAsDragging = (state: EditorState, itemId: string): EditorState => {- return changeItem(state, itemId, (item) => {- if (item.isDragging) {- // The item would not change, so we return the original object- return item;- }-- return {- ...item,- isDragging: true,- };- });-};-```+See [Preventing state updates when nothing has changed](/docs/editor-starter/state-management#preventing-state-updates-when-nothing-has-changed) for more information.## Undo and Redo interactions@@ -61,3 +45,7 @@ This behavior is controlled by the following [flags](/docs/editor-starter/featur- [`FEATURE_REDO_BUTTON`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_REDO_BUTTON&type=code)- [`FEATURE_UNDO_SHORTCUT`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_UNDO_SHORTCUT&type=code)- [`FEATURE_REDO_SHORTCUT`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_REDO_SHORTCUT&type=code)++## See also++- [State management](/docs/editor-starter/state-management)