Wrap map in Emitter class with markRaw to avoid Vue reactivity#2944
Wrap map in Emitter class with markRaw to avoid Vue reactivity#2944nighca merged 1 commit intogoplus:devfrom
Conversation
Summary of ChangesHello, 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 addresses an issue where the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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 introduces a constructor for the Emitter class to call markRaw(this). This is a sound optimization to prevent Vue from making Emitter instances reactive, which can improve performance and avoid unexpected behavior. The change is implemented correctly and aligns with Vue's best practices for handling non-reactive objects within a reactive context.
There was a problem hiding this comment.
Pull request overview
This PR attempts to fix issue #2943 (UI language switching freezing XBuilder) by adding markRaw(this) to the Emitter base class constructor, preventing Vue from wrapping Emitter instances in reactive proxies.
Changes:
- Added a constructor to
Emitterthat callsmarkRaw(this)to opt all Emitter instances out of Vue reactivity
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment was marked as outdated.
This comment was marked as outdated.
|
@xgopilot /review |
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@xgopilot pull the latest code and review again, as your comments are based on outdated code. |
Code Review (updated)The PR has been updated and the fix is now correct.
No issues found with the current code. |
fix #2943.
After a simple investigation, it was found that changing the language causes the code editor to be reinitialized. Reinitializing the code editor leads to reinitializing the spx diagnostics provider, which introduces an infinite loop. This is because the emitter's map for recording event handlers was converted into reactive data by Vue, thus incorrectly establishing a dependency during runtime.