Skip to content

πŸŽ₯ Make videos programmatically with React

`@remotion/cloudrun`: Point more prominently towards light client

Jonny Burgerecad3e9ca06b
diff --git a/packages/cloudrun/src/index.ts b/packages/cloudrun/src/index.ts
index f6673f8aa9..06b29bd4ae 100644
--- a/packages/cloudrun/src/index.ts
+++ b/packages/cloudrun/src/index.ts
@@ -10,16 +10,31 @@ import {getOrCreateBucket} from './api/get-or-create-bucket';
import {getRegions} from './api/get-regions';
import {getServiceInfo} from './api/get-service-info';
import {getServices} from './api/get-services';
-import {getSites} from './api/get-sites';
+import {getSites as deprecatedGetSites} from './api/get-sites';
import {testPermissions} from './api/iam-validation/testPermissions';
import type {RenderMediaOnCloudrunInput} from './api/render-media-on-cloudrun';
-import {renderMediaOnCloudrun} from './api/render-media-on-cloudrun';
-import {renderStillOnCloudrun} from './api/render-still-on-cloudrun';
+import {renderMediaOnCloudrun as deprecatedRenderMediaOnCloudrun} from './api/render-media-on-cloudrun';
+import {renderStillOnCloudrun as deprecatedRenderStillOnCloudrun} from './api/render-still-on-cloudrun';
import {speculateServiceName} from './api/speculate-service-name';
import type {RenderMediaOnCloudrunOutput} from './functions/helpers/payloads';
import {CloudrunInternals} from './internals';
import type {GcpRegion} from './pricing/gcp-regions';
+/**
+ * @deprecated Import this from `@remotion/cloudrun/client` instead
+ */
+const renderMediaOnCloudrun = deprecatedRenderMediaOnCloudrun;
+
+/**
+ * @deprecated Import this from `@remotion/cloudrun/client` instead
+ */
+const renderStillOnCloudrun = deprecatedRenderStillOnCloudrun;
+
+/**
+ * @deprecated Import this from `@remotion/lambda/client` instead
+ */
+const getSites = deprecatedGetSites;
+
export {
CloudrunInternals,
deployService,
diff --git a/packages/docs/docs/cloudrun/getServiceinfo.md b/packages/docs/docs/cloudrun/getServiceinfo.md
index 3f70bcd057..7a597e511e 100644
--- a/packages/docs/docs/cloudrun/getServiceinfo.md
+++ b/packages/docs/docs/cloudrun/getServiceinfo.md
@@ -22,7 +22,7 @@ To deploy a service, use [`deployService()`](/docs/cloudrun/deployservice).
// @module: esnext
// @target: es2017
-import { getServiceInfo } from "@remotion/cloudrun";
+import { getServiceInfo } from "@remotion/cloudrun/client";
const info = await getServiceInfo({
region: "us-east1",
@@ -38,6 +38,10 @@ console.log(info.region); // "us-east1"
console.log(info.consoleUrl); // "https://console.cloud.google.com/run/detail/us-east1/remotion--3-3-82--mem512mi--cpu1-0--t-500/logs"
```
+:::note
+Import from [`@remotion/cloudrun/client`](/docs/cloudrun/light-client) to not import the whole renderer, which cannot be bundled.
+:::
+
## Arguments
An object containing the following properties:
diff --git a/packages/docs/docs/cloudrun/getregions.md b/packages/docs/docs/cloudrun/getregions.md
index 46a7073896..3bbf92f554 100644
--- a/packages/docs/docs/cloudrun/getregions.md
+++ b/packages/docs/docs/cloudrun/getregions.md
@@ -16,7 +16,7 @@ Gets an array of all supported GCP regions of this release of Remotion Cloud Run
```tsx twoslash
// @module: esnext
// @target: es2017
-import { getRegions } from "@remotion/cloudrun";
+import { getRegions } from "@remotion/cloudrun/client";
// ---cut---
@@ -24,6 +24,10 @@ const regions = getRegions();
// ["asia-east1", "us-east1"]
```
+:::note
+Import from [`@remotion/cloudrun/client`](/docs/cloudrun/light-client) to not import the whole renderer, which cannot be bundled.
+:::
+
## Return value
An array of supported regions by this release of Remotion Cloud Run.
diff --git a/packages/docs/docs/cloudrun/getservices.md b/packages/docs/docs/cloudrun/getservices.md
index 0998d3a3ca..e184c6c2bb 100644
--- a/packages/docs/docs/cloudrun/getservices.md
+++ b/packages/docs/docs/cloudrun/getservices.md
@@ -28,7 +28,7 @@ If you are sure that a service exists, you can also guess the name of it using [
// @module: esnext
// @target: es2017
-import { getServices } from "@remotion/cloudrun";
+import { getServices } from "@remotion/cloudrun/client";
const info = await getServices({
region: "us-east1",
@@ -47,6 +47,10 @@ for (const service of info) {
}
```
+:::note
+Import from [`@remotion/cloudrun/client`](/docs/cloudrun/light-client) to not import the whole renderer, which cannot be bundled.
+:::
+
## Argument
An object containing the following properties:
diff --git a/packages/docs/docs/cloudrun/rendermediaoncloudrun.md b/packages/docs/docs/cloudrun/rendermediaoncloudrun.md
index 22c785ae55..9c08ee1bd1 100644
--- a/packages/docs/docs/cloudrun/rendermediaoncloudrun.md
+++ b/packages/docs/docs/cloudrun/rendermediaoncloudrun.md
@@ -20,7 +20,7 @@ A [site](/docs/cloudrun/deploysite) or a [Serve URL](/docs/terminology/serve-url
// @module: esnext
// @target: es2017
// ---cut---
-import { renderMediaOnCloudrun } from "@remotion/cloudrun";
+import { renderMediaOnCloudrun } from "@remotion/cloudrun/client";
const result = await renderMediaOnCloudrun({
region: "us-east1",
@@ -30,12 +30,17 @@ const result = await renderMediaOnCloudrun({
"https://storage.googleapis.com/remotioncloudrun-123asd321/sites/abcdefgh",
codec: "h264",
});
+
if (result.type === "success") {
console.log(result.bucketName);
console.log(result.renderId);
}
```
+:::note
+Import from [`@remotion/cloudrun/client`](/docs/cloudrun/light-client) to not import the whole renderer, which cannot be bundled.
+:::
+
## Arguments
An object with the following properties:
diff --git a/packages/docs/docs/cloudrun/renderstilloncloudrun.md b/packages/docs/docs/cloudrun/renderstilloncloudrun.md
index ca6a2f78e7..fd7b735a70 100644
--- a/packages/docs/docs/cloudrun/renderstilloncloudrun.md
+++ b/packages/docs/docs/cloudrun/renderstilloncloudrun.md
@@ -20,7 +20,7 @@ A [site](/docs/cloudrun/deploysite) or a [Serve URL](/docs/terminology/serve-url
// @module: esnext
// @target: es2017
// ---cut---
-import { renderStillOnCloudrun } from "@remotion/cloudrun";
+import { renderStillOnCloudrun } from "@remotion/cloudrun/client";
const result = await renderStillOnCloudrun({
region: "us-east1",
@@ -37,6 +37,10 @@ if (result.type === "success") {
}
```
+:::note
+Import from [`@remotion/cloudrun/client`](/docs/cloudrun/light-client) to not import the whole renderer, which cannot be bundled.
+:::
+
## Arguments
An object with the following properties:
diff --git a/packages/docs/docs/cloudrun/setup.md b/packages/docs/docs/cloudrun/setup.md
index 46451bcad2..aeac11a21d 100644
--- a/packages/docs/docs/cloudrun/setup.md
+++ b/packages/docs/docs/cloudrun/setup.md
@@ -295,7 +295,7 @@ You already have the service name from a previous step. But since you only need
```ts twoslash
// @module: ESNext
// @target: ESNext
-import { getServices, renderMediaOnCloudrun } from "@remotion/cloudrun";
+import { getServices, renderMediaOnCloudrun } from "@remotion/cloudrun/client";
const services = await getServices({
region: "us-east1",
@@ -310,8 +310,8 @@ We can now trigger a render of a video using the [`renderMediaOnCloudrun()`](/do
```ts twoslash
// @module: ESNext
// @target: ESNext
-import { renderMediaOnCloudrun } from "@remotion/cloudrun";
+import { renderMediaOnCloudrun } from "@remotion/cloudrun/client";
const url = "string";
const serviceName = "string";
const updateRenderProgress = (progress: number) => {};
@@ -333,6 +333,10 @@ if (result.type === "success") {
}
```
+:::note
+Import from [`@remotion/cloudrun/client`](/docs/cloudrun/light-client) to not import the whole renderer, which cannot be bundled.
+:::
+
The render will now run and after a while the video will be available in your cloud storage bucket. You can keep track of the render progress by passing a function to the [updateRenderProgress](/docs/cloudrun/rendermediaoncloudrun#updaterenderprogress) attribute, to receive progress as a number.
Congrats! [Check your Cloud Storage Bucket](https://console.cloud.google.com/storage/browser) - you just rendered your first video using Remotion Cloud Run πŸš€
@@ -359,7 +363,7 @@ We can now trigger a render of a still using the [`renderStillOnCloudrun()`](/do
```ts twoslash
// @module: ESNext
// @target: ESNext
-import { renderStillOnCloudrun } from "@remotion/cloudrun";
+import { renderStillOnCloudrun } from "@remotion/cloudrun/client";
const url = "string";
const serviceName = "string";
@@ -380,6 +384,10 @@ if (result.type === "success") {
}
```
+:::note
+Import from [`@remotion/cloudrun/client`](/docs/cloudrun/light-client) to not import the whole renderer, which cannot be bundled.
+:::
+
The render will now run and after a while the image will be available in your cloud storage bucket.
Congrats! [Check your Cloud Storage Bucket](https://console.cloud.google.com/storage/browser) - you just rendered your first still using Remotion Cloud Run πŸš€
diff --git a/packages/docs/docs/studio/deploy-static.mdx b/packages/docs/docs/studio/deploy-static.mdx
index e2ba184835..0b5d9a46d2 100644
--- a/packages/docs/docs/studio/deploy-static.mdx
+++ b/packages/docs/docs/studio/deploy-static.mdx
@@ -150,7 +150,7 @@ npx remotion cloudrun render https://remotion-helloworld.vercel.app HelloWorld -
// @module: esnext
// @target: es2017
// ---cut---
-import { renderMediaOnCloudrun } from "@remotion/cloudrun";
+import { renderMediaOnCloudrun } from "@remotion/cloudrun/client";
const result = await renderMediaOnCloudrun({
region: "us-east1",