-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add injected isomorphic environment #4
Conversation
oh hold on there are tests I need to change |
router/server.ts
Outdated
const context: ProcedureContext<object> = { | ||
environment, | ||
state: service.state, | ||
}; | ||
|
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.
isn't this a ServiceContext
? would also be good to have a mapping of service -> ServiceContext
so that we avoid constructing it on each request
environment/types.ts
Outdated
log: (...args: unknown[]) => void; | ||
error: (...args: unknown[]) => void; |
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.
can we add a comment here about declaration merging and then add a test that adds something to the environment?
not sure how to do the declaration merging test without affecting the exported type |
okay, this should be good to go |
comments addressed after discussion in-person the day before :) |
This makes it so that when you create a server, you need to provide an environment to the server. The server will then pass this environment to all procedures that are called. Environments are always the same shape.