-
Notifications
You must be signed in to change notification settings - Fork 90
Conversation
🦋 Changeset detectedLatest commit: 9465a6b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
7d56db5
to
127b16f
Compare
127b16f
to
9465a6b
Compare
type EventPluginContext<Env, P extends string, Data, PluginArgs> = { | ||
request: Request; | ||
functionPath: string; | ||
waitUntil: (promise: Promise<any>) => void; | ||
next: (input?: Request | string, init?: RequestInit) => Promise<Response>; | ||
env: Env & { ASSETS: { fetch: typeof fetch } }; | ||
params: Params<P>; | ||
data: Data; | ||
pluginArgs: PluginArgs; | ||
}; |
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.
What do you think about using an intersection type here?
type EventPluginContext<Env, P extends string, Data, PluginArgs> = { | |
request: Request; | |
functionPath: string; | |
waitUntil: (promise: Promise<any>) => void; | |
next: (input?: Request | string, init?: RequestInit) => Promise<Response>; | |
env: Env & { ASSETS: { fetch: typeof fetch } }; | |
params: Params<P>; | |
data: Data; | |
pluginArgs: PluginArgs; | |
}; | |
type EventPluginContext<Env, P extends string, Data, PluginArgs> = EventContext<Env, P, Data> & { | |
pluginArgs: PluginArgs; | |
}; |
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.
Yup, totally might. Just was keeping it separate whilst in development while we worked out the commonality.
When we merge the Plugin template and the Worker template, we'll probably make these an intersection :)
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.
Awesome! 🙂
Adds the
PagesPluginFunction
type and the internalfunctionPath
to Functions' context.