Skip to content

Conversation

@wang1212
Copy link
Member

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / Document optimization
  • TypeScript definition update
  • Refactoring
  • Performance improvement
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

This issue was raised by #2005 .

📝 Changelog

Language Changelog
🇺🇸 English fix(g-lite): fix CustomEvent constructor compatibility
🇨🇳 Chinese fix(g-lite): 保持 CustomEvent 的向后兼容性

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@wang1212 wang1212 added the bug label Oct 20, 2025
@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2025

🦋 Changeset detected

Latest commit: e788d99

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

This PR includes changesets to release 47 packages
Name Type
@antv/g-lite Patch
@antv/g-camera-api Patch
@antv/g-canvas Patch
@antv/g-canvaskit Patch
@antv/g-components Patch
@antv/g-dom-mutation-observer-api Patch
@antv/g-gesture Patch
@antv/g-image-exporter Patch
@antv/g-lottie-player Patch
@antv/g-mobile-canvas-element Patch
@antv/g-mobile-canvas Patch
@antv/g-mobile-svg Patch
@antv/g-mobile-webgl Patch
@antv/g-pattern Patch
@antv/g-plugin-3d Patch
@antv/g-plugin-a11y Patch
@antv/g-plugin-annotation Patch
@antv/g-plugin-box2d Patch
@antv/g-plugin-canvas-path-generator Patch
@antv/g-plugin-canvas-picker Patch
@antv/g-plugin-canvas-renderer Patch
@antv/g-plugin-canvaskit-renderer Patch
@antv/g-plugin-control Patch
@antv/g-plugin-css-select Patch
@antv/g-plugin-device-renderer Patch
@antv/g-plugin-dom-interaction Patch
@antv/g-plugin-dragndrop Patch
@antv/g-plugin-gesture Patch
@antv/g-plugin-html-renderer Patch
@antv/g-plugin-image-loader Patch
@antv/g-plugin-matterjs Patch
@antv/g-plugin-mobile-interaction Patch
@antv/g-plugin-physx Patch
@antv/g-plugin-rough-canvas-renderer Patch
@antv/g-plugin-rough-svg-renderer Patch
@antv/g-plugin-svg-picker Patch
@antv/g-plugin-svg-renderer Patch
@antv/g-plugin-yoga Patch
@antv/g-plugin-zdog-canvas-renderer Patch
@antv/g-plugin-zdog-svg-renderer Patch
@antv/g-svg Patch
@antv/g-web-animations-api Patch
@antv/g-web-components Patch
@antv/g-webgl Patch
@antv/g-webgpu Patch
@antv/g Patch
@antv/react-g 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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 resolves a bug related to the CustomEvent constructor's behavior, ensuring that event details are correctly processed regardless of how they are passed. The changes enhance the robustness of event handling within the system by making the CustomEvent constructor more flexible and updating its usage in the EventTarget class.

Highlights

  • CustomEvent Constructor Compatibility: Introduced a compatibility fix in the CustomEvent constructor to correctly interpret the second argument as detail when it's not explicitly wrapped in an options object. This addresses an issue where detail might be undefined if the options object was omitted.
  • Event Emission Update: Updated the emit method in EventTarget to directly pass the event object to the CustomEvent constructor, leveraging the new compatibility logic and simplifying event creation.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to add backward compatibility to the CustomEvent constructor to support passing the detail object directly, instead of within an options object. The change in EventTarget.ts's emit method reflects this.

My review focuses on the implementation of this compatibility layer in CustomEvent.ts. I've found a potential bug in the logic that handles different ways of instantiating CustomEvent and have suggested a more robust implementation to prevent incorrect behavior in edge cases.

wang1212 and others added 2 commits October 21, 2025 17:51
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@wang1212 wang1212 merged commit ca228f9 into release Oct 21, 2025
2 checks passed
@wang1212 wang1212 deleted the fix/custom-event branch October 21, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants