Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Summary of ChangesHello @wang1212, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request is a routine release that propagates a critical type definition fix from the core Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request appears to be a release, primarily consisting of version bumps and changelog updates across multiple packages. The core logic change is in @antv/g-lite to fix a type definition.
My review focuses on the code changes in @antv/g-lite. I've found a potential issue in the CustomEvent type definition where it seems to incorrectly specify its base class generic parameter, which could lead to type errors and runtime issues. I've left a specific comment with a suggested fix for this.
| O extends { detail?: any } = any, | ||
| > extends FederatedEvent<null, O['detail']> { | ||
| O extends { detail?: any; [key: string | number]: any } = any, | ||
| > extends FederatedEvent<Event, O['detail']> { |
There was a problem hiding this comment.
The base class for CustomEvent is changed to FederatedEvent<Event, O['detail']>. This implies that CustomEvent instances must have a nativeEvent property of type Event.
However, CustomEvent is created programmatically and is not associated with a native browser event. Its constructor does not initialize the nativeEvent property, which will leave it undefined. This is a type mismatch (undefined is not assignable to Event) and can lead to runtime errors if nativeEvent is accessed.
The previous implementation extends FederatedEvent<null, O['detail']> was correct, as it correctly typed nativeEvent as null for custom events.
It's recommended to revert this part of the change.
| > extends FederatedEvent<Event, O['detail']> { | |
| > extends FederatedEvent<null, O['detail']> { |
No description provided.