[wip]#1462
Open
shomix wants to merge 1 commit into
Open
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
Here's a visual recap of what changed:
Open the full interactive recap |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
steve8708
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a direct-to-GCS resumable upload path for the Clips recorder, allowing the browser to PUT video chunks straight to GCS via a resumable session URI — bypassing the per-chunk app-server hop.
Problem
Previously, every video chunk recorded in the browser was routed through the app server before reaching GCS/Builder.io storage. This added unnecessary latency and load on the server for each chunk during upload.
Solution
When
BUILDER_PRIVATE_KEYis configured, the server initiates a GCS resumable session and returns the session URI to the browser. The browser then PUTs chunks directly to GCS usingContent-Rangeheaders. After all chunks are uploaded, the browser calls a completion endpoint that registers the asset with Builder.io and finalizes the recording row.Key Changes
packages/core/src/file-upload/builder.ts: AddedrequestBuilderResumableSession()to initiate a GCS resumable upload session via the Builder.io/api/v1/upload/signed-url?isResumable=trueendpoint, andcompleteBuilderResumableUpload()to register the completed upload and retrieve the CDN URL.packages/core/src/file-upload/index.ts: Exported the two new functions and theBuilderResumableSessiontype.templates/clips/server/routes/api/uploads/[recordingId]/init-resumable.post.ts: New route (POST /api/uploads/:recordingId/init-resumable) that authenticates the user, validates the request, and returns aresumableSessionUri+assetIdfor the browser to use.templates/clips/server/routes/api/uploads/[recordingId]/complete.post.ts: New route (POST /api/uploads/:recordingId/complete) that callscompleteBuilderResumableUpload()and then invokesfinalizeRecordingwith the resulting CDN URL, skipping chunk assembly entirely.templates/clips/actions/create-recording.ts: ReturnssupportsResumableUpload: truewhenBUILDER_PRIVATE_KEYis set, signaling to the frontend that the direct upload path is available.templates/clips/actions/finalize-recording.ts: AddedvideoUrlandvideoSizeBytesinput fields; whenvideoUrlis provided, chunk assembly and server-side upload are skipped and the recording is marked ready immediately.templates/clips/app/routes/record.tsx: PassesuseResumableUploadflag to the recorder engine based on thesupportsResumableUploadflag returned from recording creation.To clone this PR locally use the Github CLI with command
gh pr checkout 1462You can tag me at @BuilderIO for anything you want me to fix or change