-
Notifications
You must be signed in to change notification settings - Fork 80
edge config snapshots #910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 4068f6f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
d892ac1 to
b17b01e
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this 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 buildResult:
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.
Adds the experimental Edge Config Snapshot feature. See upcoming changelog for details.
This PR also simplifies the test setup. We were previously invoking
jestmultiple times with different--envoptions and specific.common.test.ts,.node.test.tsand.edge.test.tsfilters. 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-environmentcomment to specify its env. The only change to the setup is thatcommon.tstests are no longer run for both environments now run for node only.