Skip to content

Conversation

@dferber90
Copy link
Collaborator

@dferber90 dferber90 commented Nov 28, 2025

Adds the experimental Edge Config Snapshot feature. See upcoming changelog for details.


This PR also simplifies the test setup. We were previously invoking jest multiple times with different --env options and specific .common.test.ts, .node.test.ts and .edge.test.ts filters. This made it possible that some test files without those endings did not run. It also led to worse output as Jest would be invoked multiple times. I now changed the setup so we only invoke Jest once. Each env-specific test file uses the @jest-environment comment to specify its env. The only change to the setup is that common.ts tests are no longer run for both environments now run for node only.

@dferber90 dferber90 requested a review from a team November 28, 2025 16:03
@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2025

🦋 Changeset detected

Latest commit: 4068f6f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vercel/edge-config Minor
vercel-storage-integration-test-suite Patch

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

@vercel
Copy link
Contributor

vercel bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
vercel-storage-next-integration-test-suite Ready Ready Preview Dec 16, 2025 2:35pm

@socket-security
Copy link

socket-security bot commented Dec 16, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcommander@​14.0.210010010087100

View full report

@dferber90 dferber90 changed the title [edge config] embed edge configs at build time [edge config] edge configs snapshots Dec 16, 2025
Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 Build Fix:

The parseConnectionFromFlags function returns a Connection object that is missing two required properties: snapshot and timeoutMs. The returned object must include these properties to match the Connection type definition.

View Details
📝 Patch Details
diff --git a/packages/edge-config/src/cli.ts b/packages/edge-config/src/cli.ts
index 3e3ce99..57b6a31 100755
--- a/packages/edge-config/src/cli.ts
+++ b/packages/edge-config/src/cli.ts
@@ -52,6 +52,8 @@ function parseConnectionFromFlags(text: string): Connection | null {
       id,
       version: '1',
       token,
+      snapshot: 'optional',
+      timeoutMs: undefined,
     };
   } catch {
     // no-op

Analysis

Missing required properties in Connection type

What fails: TypeScript compilation fails in @vercel/edge-config:build during DTS build due to missing type properties when creating a Connection object from parsed flags.

How to reproduce:

cd packages/edge-config
pnpm run build

Result:

src/cli.ts(49,5): error TS2322: Type '{ type: "vercel"; baseUrl: string; id: string; version: string; token: string; }' is not assignable to type 'Connection | null'.
  Type '{ type: "vercel"; baseUrl: string; id: string; version: string; token: string; }' is missing the following properties from type '{ baseUrl: string; id: string; token: string; version: string; type: "vercel"; snapshot: "required" | "optional"; timeoutMs: number | undefined; }': snapshot, timeoutMs

Why this occurs: The parseConnectionFromFlags function in cli.ts returns a Connection object that is missing two required properties (snapshot and timeoutMs) that are required by the Connection type definition in types.ts.

Fix on Vercel

@dferber90 dferber90 changed the title [edge config] edge configs snapshots [edge config] edge config snapshots Dec 16, 2025
@dferber90 dferber90 changed the title [edge config] edge config snapshots edge config snapshots Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants