-
Notifications
You must be signed in to change notification settings - Fork 191
feat: event schema types #2445
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?
feat: event schema types #2445
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
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.
7 files reviewed, 2 comments
export function createTypedEventCapture<Client extends { capture: (event: string, properties?: any) => any }>( | ||
client: Client | ||
): TypedEventCapture<Client> { | ||
return new Proxy({} as TypedEventCapture<Client>, { |
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.
logic: Proxy
is not supported in IE 11, which is listed in the browserslist. This will cause runtime errors in IE 11 environments when the typed
property is accessed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/typed-events.ts
Line: 44:44
Comment:
**logic:** `Proxy` is not supported in IE 11, which is listed in the browserslist. This will cause runtime errors in IE 11 environments when the `typed` property is accessed.
How can I resolve this? If you propose a fix, please make it concise.
client: Client | ||
): TypedEventCapture<Client> { | ||
return new Proxy({} as TypedEventCapture<Client>, { | ||
get: (_target, eventName: string) => { |
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.
logic: The eventName
parameter should be typed as string | symbol
since Proxy get traps can receive Symbols (e.g., for well-known symbols like Symbol.toStringTag
). Consider adding a type guard to filter out non-string property keys.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/typed-events.ts
Line: 45:45
Comment:
**logic:** The `eventName` parameter should be typed as `string | symbol` since Proxy get traps can receive Symbols (e.g., for well-known symbols like `Symbol.toStringTag`). Consider adding a type guard to filter out non-string property keys.
How can I resolve this? If you propose a fix, please make it concise.
Problem
Changes
Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changeset
to generate a changeset file