[client] Add inlined file deployment for small HTML-only projects#15034
Open
[client] Add inlined file deployment for small HTML-only projects#15034
Conversation
When deploying a directory that contains only HTML files (fewer than 10), the files are now sent inline with the deployment API request instead of being uploaded separately. This optimizes deployment for simple static HTML sites by eliminating separate file upload requests. Changes: - Add `data` and `encoding` fields to PreparedFile interface - Add `shouldUseInlineFiles()` helper to check inline conditions - Modify `prepareFiles()` to include file content when conditions are met - Add debug logging for inline file deployments - Export `shouldUseInlineFiles` from client package - Add comprehensive unit tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 8e5a6ae The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://vercel-pq6zvnols.vercel.sh/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://vercel-pq6zvnols.vercel.sh/tarballs/vercel.tgz"
}
}
} |
Contributor
🧪 Unit Test StrategyComparing: Strategy: Affected packages only ✅ Only testing packages that have been modified or depend on modified packages. Affected packages - 40 (100%)
Results
This comment is automatically generated based on the affected testing strategy |
The Vercel API rejects additional properties on inlined files. Inlined files should only have: file, data, encoding. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add inlined file deployment for small HTML-only projects.
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
/v2/filesChanges
packages/client/src/utils/index.ts:PreparedFileinterface withdataandencodingfieldsshouldUseInlineFiles()function to detect when inline deployment should be usedprepareFiles()to conditionally include file contentpackages/client/src/deploy.ts: Added debug logging when using inline deploymentpackages/client/src/index.ts: ExportedshouldUseInlineFilesfor external usepackages/client/tests/unit.utils.test.ts: Added comprehensive unit testsTest plan
shouldUseInlineFiles()andprepareFiles()🤖 Generated with Claude Code
Note
Low Risk Change
This PR adds a performance optimization for small HTML-only deployments by inlining file content in the API request, with no security or authorization changes.
shouldUseInlineFiles()function checks for <10 HTML-only filesprepareFiles()to conditionally include file data with utf-8 encodingRisk assessment for commit 8e5a6ae.