-
Notifications
You must be signed in to change notification settings - Fork 15
Add pluggable activity context #288
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
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 introduces a pluggable activity context system that allows plugins to add typed values to the activity context. The implementation adds a new buildActivityContext
method to the plugin interface and updates all activity context types to support generics for plugin-provided context values.
Key changes:
- Adds
buildActivityContext
method to the plugin interface for injecting typed context values - Updates all activity context interfaces and route types to accept generic context parameters
- Implements context merging logic in the app processing pipeline
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/apps/src/types/plugin/plugin.ts | Adds generic type parameters and buildActivityContext method to plugin interface |
packages/apps/src/contexts/activity.ts | Updates activity context interfaces to support generic plugin context types |
packages/apps/src/app.process.ts | Implements plugin context building and merging in activity processing |
packages/apps/src/routes/*.ts | Updates all route type definitions to support generic context parameters |
packages/apps/src/router.ts | Updates router class to support typed plugin contexts |
packages/apps/src/app.ts | Updates app class to use typed plugin contexts in router |
packages/apps/src/types/app-routing.ts | Adds utility type for extracting plugin context types |
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.
left questions, this is a good first draft let me know when its ready for another review!
Updated it with your suggestions @aacebo . Take a look! |
This PR introduces the ability for plugins to add typed values to the activity context. It does this by adding a dedicated
buildActivityContext
function that gets called inapp.process
. Then via a bunch of generics plumbing we merge the plugin's context values with the default ones.We can use this to separate graph out into other packages, but keep the contextual objects for the activity-handlers unchanged (aka.
appGraph
, anduserGraph
will still be available). However,graph
object onapp
would most likely be part of the theGraphPlugin
- (maybe we make that accessible via a newapp.getPlugin('graph')
method?)Here's a mini demo:
Screen.Recording.2025-08-04.at.8.35.09.AM.mov
PR Dependency Tree
This tree was auto-generated by Charcoal