-
Notifications
You must be signed in to change notification settings - Fork 11
feat(): support accessing specific event object in nested event callbacks #4822
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
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Walkthrough引入对键化事件的支持:在 RuntimeContext 中添加可选的 Changes
Estimated code review effort🎯 3 (中等复杂度) | ⏱️ ~20–30 分钟
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
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 |
b9e5473 to
0aeed99
Compare
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.
Pull Request Overview
This PR adds support for accessing specific event objects in nested event callbacks by introducing a key property on event handlers and a new EVENT_BY_KEY global variable. This allows developers to reference events from outer scopes when handling deeply nested callbacks.
- Adds optional
keyproperty to all event handler interfaces - Implements
EVENT_BY_KEYglobal variable for accessing keyed events via a dynamic proxy - Propagates event maps through nested handler contexts
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/types/src/manifest.ts | Adds key?: string property to BuiltinBrickEventHandler, UseProviderEventHandler, BaseCustomBrickEventHandler, and ConditionalEventHandler interfaces |
| packages/runtime/src/internal/interfaces.ts | Adds optional eventMap property to RuntimeContext interface for storing keyed events |
| packages/runtime/src/internal/compute/evaluate.ts | Implements EVENT_BY_KEY global variable with dynamic proxy for accessing events by key |
| packages/runtime/src/internal/bindListeners.ts | Creates and propagates eventMap when handlers have a key property |
| packages/runtime/src/internal/bindListeners.spec.ts | Adds comprehensive test coverage for nested event key access |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3 #4822 +/- ##
=======================================
Coverage 95.19% 95.19%
=======================================
Files 212 212
Lines 9336 9343 +7
Branches 1798 1799 +1
=======================================
+ Hits 8887 8894 +7
Misses 330 330
Partials 119 119
🚀 New features to boost your workflow:
|
next-core
|
||||||||||||||||||||||||||||
| Project |
next-core
|
| Branch Review |
steve/v3-event-by-key
|
| Run status |
|
| Run duration | 00m 24s |
| Commit |
|
| Committer | Shenwei Wang |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
17
|
| View all changes introduced in this branch ↗︎ | |
0aeed99 to
dff7e21
Compare
依赖检查
组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。
请勾选以下两组选项其中之一:
或者:
提交信息检查
Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。
破坏性变更:
feat作为提交类型。BREAKING CHANGE: 你的变更说明。新特性:
feat作为提交类型。问题修复:
fix作为提交类型。杂项工作:
即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:
chore,docs,test等作为提交类型。Summary by CodeRabbit
发布说明
新功能
测试