Skip to content

🎥 Make videos programmatically with React

guide: how to upgrade remotion lambda

Jonny Burger72f2c9e6790f
diff --git a/packages/docs/components/PrereleaseVersion.tsx b/packages/docs/components/PrereleaseVersion.tsx
index 5f99aeb477..7c87abb070 100644
--- a/packages/docs/components/PrereleaseVersion.tsx
+++ b/packages/docs/components/PrereleaseVersion.tsx
@@ -1,8 +1,10 @@
import React from "react";
-const FALLBACK_VERSION = "2.4.0-alpha.b886f9bc";
+const FALLBACK_VERSION = "3.0.0-alpha.b886f9bc";
-export const Prerelease: React.FC = () => {
+export const Prerelease: React.FC<{
+ onlySnippet: boolean;
+}> = ({ onlySnippet }) => {
const version =
typeof URLSearchParams === "undefined"
? FALLBACK_VERSION
@@ -10,16 +12,20 @@ export const Prerelease: React.FC = () => {
FALLBACK_VERSION;
return (
<div>
- <p>
- If you have received a prerelease version of Remotion, such as
- <code>{version}</code>, this is how you install it:
- </p>
- <p>
- Replace all packages that are part of Remotion, such as{" "}
- <code>remotion</code>, <code>@remotion/renderer</code>,
- <code>@remotion/lambda</code>, etc with the version that you have
- received:
- </p>
+ {onlySnippet ? null : (
+ <div>
+ <p>
+ If you have received a prerelease version of Remotion, such as
+ <code>{version}</code>, this is how you install it:
+ </p>
+ <p>
+ Replace all packages that are part of Remotion, such as{" "}
+ <code>remotion</code>, <code>@remotion/renderer</code>,
+ <code>@remotion/lambda</code>, etc with the version that you have
+ received:
+ </p>
+ </div>
+ )}
<pre className="code-container">
{["@remotion/bundler", "@remotion/renderer", "remotion"].map((r) => {
return (
diff --git a/packages/docs/docs/lambda-changelog.md b/packages/docs/docs/lambda-changelog.md
index df6ae59491..00345af19b 100644
--- a/packages/docs/docs/lambda-changelog.md
+++ b/packages/docs/docs/lambda-changelog.md
@@ -8,11 +8,7 @@ Keep track of changes to the APIs of Remotion Lambda here.
## How to upgrade
-1. Get the newest version from the `#lambda` Discord channel.
-1. Upgrade all packages to the newest version (`@remotion/lambda`, but also `remotion`, `@remotion/cli` etc.)
-1. (Optional) Remove all existing lambdas: `npx remotion-lambda functions ls` and then `npx remotion-lambda functions rm <function-name>`
-1. Redeploy your function: `npx remotion lambda functions deploy`
-1. Migrate according to the changelog below:
+[Upgrading](/docs/lambda/upgrading)
## December 7th, 2021
diff --git a/packages/docs/docs/lambda-setup.md b/packages/docs/docs/lambda-setup.md
index 4343a18340..3c91107c9a 100644
--- a/packages/docs/docs/lambda-setup.md
+++ b/packages/docs/docs/lambda-setup.md
@@ -323,5 +323,6 @@ This code will poll every second to check the progress of the video and exit the
- Select [which region(s)](/docs/lambda/region-selection) you want to run Remotion Lambda in.
- Familiarize yourself with the CLI and the Node.JS APIs (list in sidebar).
+- Learn how to [upgrade Remotion Lambda](/docs/lambda/upgrading).
- Before going live, go through the [Production checklist](/docs/lambda/checklist).
- If you have any questions, go through the [FAQ](/docs/lambda/faq) or ask in our [Discord channel](https://discord.gg/PzjkKS8S5S)
diff --git a/packages/docs/docs/lambda-upgrading.md b/packages/docs/docs/lambda-upgrading.md
new file mode 100644
index 0000000000..63d7257cf8
--- /dev/null
+++ b/packages/docs/docs/lambda-upgrading.md
@@ -0,0 +1,38 @@
+---
+id: lambda-upgrading
+title: Upgrading
+slug: /lambda/upgrading
+---
+
+import {Prerelease} from "../components/PrereleaseVersion"
+
+- Get the newest version from the [changelog](/docs/lambda/changelog) page.
+- Upgrade all packages to the newest version (`@remotion/lambda`, but also `remotion`, `@remotion/cli` etc.)
+
+<Prerelease onlySnippet/>
+
+- (Optional): Remove the old versions of the function:
+
+:::info
+You only should do this if the function is not being used anymore. If you are still using it in production, you can just skip this step.
+:::
+
+```
+npx remotion lambda functions rm $(npx remotion lambda functions ls -q) -y
+```
+
+- Deploy the newest version of the Remotion Lambda function:
+
+```
+npx remotion lambda functions deploy
+```
+
+- Update your API calls according to the [changelog](/docs/lambda/upgrading). While Remotion Lambda is in Alpha, breaking changes may occur in every version. Once it hits stable, breaking changes will only occur in major version bumps.
+
+## Separating production and testing environments
+
+If you already shipped Remotion Lambda to production, you can upgrade without incurring any downtime. Each version of Remotion Lambda has a schema identifier (in the format of `2021-08-12`) that will increment whenever Remotion Lambda gets upgraded.
+
+If you have Remotion in production and cloned locally, upgrading Remotion Lambda in your code locally and then rendering a video will yield an error message that the versions are mismatching. Simply deploy a new function `npx remotion lambda functions deploy` and your local environment will talk to the new function, while production will talk to the older function.
+
+If everything works and you commit and deploy the change to production, it will start talking to the new version and you can safely remove the old function.
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index a30e50ce45..62b7572c83 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -85,6 +85,7 @@ module.exports = {
},
"lambda-checklist",
"lambda-changelog",
+ "lambda-upgrading",
"lambda-uninstall",
],
someSidebar: [