Skip to content

🎥 Make videos programmatically with React

better lambda upgrade docs and mention site-name

Jonny Burger693a42fbce37
diff --git a/packages/docs/components/PrereleaseVersion.tsx b/packages/docs/components/PrereleaseVersion.tsx
index 02c9a4a8b7..9ad6685686 100644
--- a/packages/docs/components/PrereleaseVersion.tsx
+++ b/packages/docs/components/PrereleaseVersion.tsx
@@ -38,11 +38,11 @@ export const Prerelease: React.FC<{
return (
<div key={r}>
<span style={{ color: "#e13238" }}>
- - &quot;{r}&quot;: &quot;{"^3.0.0"}&quot;
+ - &quot;{r}&quot;: &quot;{"3.0.0"}&quot;
</span>
{"\n"}
<span style={{ color: "#009400" }}>
- + &quot;{r}&quot;: &quot;^{version}&quot;
+ + &quot;{r}&quot;: &quot;{version}&quot;
</span>
{"\n"}
</div>
diff --git a/packages/docs/docs/lambda/setup.md b/packages/docs/docs/lambda/setup.md
index 92c34e6821..9acaf51397 100644
--- a/packages/docs/docs/lambda/setup.md
+++ b/packages/docs/docs/lambda/setup.md
@@ -151,7 +151,7 @@ The function name is returned which you'll need for rendering.
</TabItem>
</Tabs>
-## 8. Deploy a website
+## 8. Deploy a site
<Tabs
defaultValue="cli"
@@ -165,10 +165,12 @@ values={[
Run the following command to deploy your Remotion project to an S3 bucket. Pass as the last argument the entry file of the project - this is the file where [`registerRoot()`](/docs/register-root) is called.
```bash
-npx remotion lambda sites create src/index.tsx
+npx remotion lambda sites create src/index.tsx --site-name=my-video
```
-A URL will be printed pointing to the deployed project.
+A `serveUrl` will be printed pointing to the deployed project.
+
+When you update your Remotion video in the future, redeploy your site. Pass the same [`--site-name`](/docs/lambda/cli/sites#--site-name) to overwrite the previous deploy. If you don't pass [`--site-name`](/docs/lambda/cli/sites#--site-name), a unique URL will be generated on every deploy.
</TabItem>
<TabItem value="node">
@@ -202,10 +204,11 @@ const { serveUrl } = await deploySite({
bucketName,
entryPoint: path.resolve(process.cwd(), "src/index.tsx"),
region: "us-east-1",
+ siteName: "my-video",
});
```
-You are now ready to render a video.
+When you update your Remotion video in the future, redeploy your site. Pass the same [`siteName`](/docs/lambda/deploysite#sitename) to overwrite the previous deploy. If you don't pass [`siteName`](/docs/lambda/deploysite#sitename), a unique URL will be generated on every deploy.
</TabItem>
</Tabs>
diff --git a/packages/docs/docs/lambda/upgrading.md b/packages/docs/docs/lambda/upgrading.md
index 2f2b225775..9ad174152e 100644
--- a/packages/docs/docs/lambda/upgrading.md
+++ b/packages/docs/docs/lambda/upgrading.md
@@ -1,6 +1,6 @@
---
id: upgrading
-title: Upgrading
+title: Upgrading Lambda
slug: /lambda/upgrading
---
@@ -27,10 +27,26 @@ npx remotion lambda functions rmall -y
npx remotion lambda functions deploy
```
+- Update the site:
+
+```
+npx remotion sites create src/index.ts --site-name=my-name
+```
+
+:::info
+
+Pass `--site-name` with the name of an existing site to update it. The URL will stay the same but older functions may not be able to render the updated site.
+
+If you don't pass `--site-name` a new site URL will be generated. You'll need to update the [`serveUrl`](/docs/lambda/rendermediaonlambda#serveurl) parameter in your [`renderMediaOnLambda()`](/docs/lambda/rendermediaonlambda) calls. Old deployed functions can still render by specifying the old serve URL.
+:::
+
## 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 a breaking change is introduced.
+If you already shipped Remotion Lambda to production, you can upgrade without incurring any downtime:
+
+- Each deployed function has a version (see them using `npx remotion lambda functions ls`).
+ Use the same version of the `@remotion/lambda` package to invoke the function.
-If you have Remotion Lambda in production and are testing locally, upgrading Remotion Lambda in your project 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.
+- You can have multiple functions with different versions deployed. Use the [`compatibleOnly`](/docs/lambda/getfunctions#compatibleonly) parameter to find functions that match the version of the `@remotion/lambda` package.
-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.
+- Sites/`serveUrl`'s also are version-dependant. Create them with the same version of Remotion that you render them with. Remotion will tolerate mismatches if there are no incompatibilities, but will issue a warning that you might not have all the newest features and bugfixes in the bundled site.