Skip to content
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: inject node:event dependencies through SetupServerApi first argument in constructor #1880

Closed

Conversation

mattcosta7
Copy link
Contributor

@mattcosta7 mattcosta7 commented Nov 22, 2023

An alternative take on #1879

This uses a modified first argument to SetupServerApi that optionally uses a config object instead of a straight array of interceptors.

Ideally, i think an api like

SetupServerApi(interceptors, config, ...handlers) might be clearer, but that would be a breaking change I'm trying to avoid, and the pure additive approach here seems reasonable as an iterative step

I don't have a strong preference between this version and the one in the other referenced pr, which provides a context setter

@mattcosta7 mattcosta7 changed the title Move setup server api dependencies outward v2 fix: inject node:event dependencies through SetupServerApi first argument in constructor Nov 22, 2023
@mattcosta7 mattcosta7 marked this pull request as ready for review November 22, 2023 16:48
new (): Interceptor<HttpRequestEventMap>
}>,
interceptorsOrConfig:
| Interceptors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of overly dynamic call signatures. Node has had enough of me. I think your approach to solve this problem in #1879 is better.

@mattcosta7 mattcosta7 closed this Nov 22, 2023
@kettanaito kettanaito deleted the move-setup-server-api-dependencies-outward-v2 branch March 15, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants