-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: add missing EventsOffAll export to runtime templates #4883
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
fix: add missing EventsOffAll export to runtime templates #4883
Conversation
The EventsOffAll function was implemented in the internal runtime (desktop/events.js) and exported in the wrapper runtime files, but was missing from the public runtime templates that are generated in user projects. This caused a type mismatch where EventsOffAll was declared in the TypeScript definition but the implementation was missing. This commit adds the EventsOffAll export and type declaration to all frontend framework templates: - Common templates (generate/assets/common) - React / React-TS - Vue / Vue-TS - Svelte / Svelte-TS - Preact / Preact-TS - Lit / Lit-TS - Vanilla / Vanilla-TS Fixes wailsapp#4703 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds a new runtime API function Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Added EventsOffAll function documentation to both English and Chinese versions of the runtime events reference. The function was already implemented in Go (pkg/runtime/events.go) and JavaScript (internal/frontend/runtime/desktop/events.js), but was missing from the public documentation. Related to wailsapp#4703 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx`:
- Around line 21-26: Translate the English description for EventsOffAll to
Chinese to match the header and other entries: replace "This method unregisters
all event listeners." with a concise Chinese sentence (e.g., "此方法注销所有事件侦听器。") in
the EventsOffAll section; while here, also update EventsOff's English
description to a similar Chinese translation for consistency (e.g.,
"此方法注销指定的事件侦听器。") so both EventsOffAll and EventsOff use Chinese descriptions.
| ### EventsOffAll 移除所有事件侦听器 | ||
|
|
||
| This method unregisters all event listeners. | ||
|
|
||
| Go: `EventsOffAll(ctx context.Context)`<br/> | ||
| JS: `EventsOffAll()` |
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.
Consider translating the description to Chinese for consistency.
The section header includes a Chinese translation ("移除所有事件侦听器"), but the description on line 23 remains in English. Most other entries in this file (EventsOn, EventsOnce, EventsOnMultiple, EventsEmit) have Chinese descriptions.
Note: I see that EventsOff (line 17) also has an English description, so this is an existing inconsistency—but it would be good to translate both if time permits.
Suggested translation
### EventsOffAll 移除所有事件侦听器
-This method unregisters all event listeners.
+此方法取消注册所有事件侦听器。
Go: `EventsOffAll(ctx context.Context)`<br/>
JS: `EventsOffAll()`🤖 Prompt for AI Agents
In
`@website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx`
around lines 21 - 26, Translate the English description for EventsOffAll to
Chinese to match the header and other entries: replace "This method unregisters
all event listeners." with a concise Chinese sentence (e.g., "此方法注销所有事件侦听器。") in
the EventsOffAll section; while here, also update EventsOff's English
description to a similar Chinese translation for consistency (e.g.,
"此方法注销指定的事件侦听器。") so both EventsOffAll and EventsOff use Chinese descriptions.
Added entry for the EventsOffAll fix to the Unreleased section of the changelog. Related to wailsapp#4703 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Summary of ChangesThis PR addresses issue #4703 by adding the missing What was fixed:
Root Cause:The
However, it was missing from the public-facing templates that are generated in user projects ( Testing:
Fixes #4703 |
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@website/src/pages/changelog.mdx`:
- Line 19: The changelog entry text "Fixed missing `EventsOffAll` in runtime
templates for all frontend frameworks
[`#4703`](https://github.com/wailsapp/wails/pull/4883) by `@narcilee7`" has a
mismatched issue/PR label and URL; update the bracketed label or the link so
they match (e.g., change "[`#4703`]" to "[`#4883`]" to match the current URL, or
change the URL to "/pull/4703"), or include both numbers like
"[`#4703/`#4883](...)"; locate the exact string in the changelog.mdx entry for the
change and modify the label or URL accordingly while preserving the rest of the
sentence and author attribution.
Improved consistency in Chinese documentation by translating the EventsOffAll description from English to Chinese, matching the style of other event method descriptions. Related to wailsapp#4703 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
31bf2f4 to
b376c17
Compare
|
Thank you!! |
|


Summary
EventsOffAllexport and type declaration to all frontend runtime templatesDetails
The
EventsOffAllfunction was already implemented inv2/internal/frontend/runtime/desktop/events.jsand exported in the wrapper runtime files, but was missing from the public runtime templates that are generated in user projects.This caused a type mismatch where
EventsOffAllwas declared in the TypeScript definition but the implementation was missing from the JavaScript export.Changes
Updated all frontend framework templates:
generate/assets/common)Testing
EventsOffAllmatches the signature in wrapper runtime filesEventsOffFixes #4703
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.