Conversation
|
I'm planning to start cutting v4 releases soonish. What's your ETA on finishing this work @climba03003 ? |
I assume it will be done on next week. If it can not catch up on schedule, I am fine to go with next release. |
|
no worries, I think we can wait a bit. |
|
I think most of the original types is done. Now, I am facing the issue of it breaks the TypeProvider type resolve. |
|
I'm planning to look at it soon (Today or tomorrow). |
|
@climba03003 Hi, good work on the refactorings. It's a big job. Just had a quick look at the branch. I think there could be an issue with the Schema (formally export interface FastifyRequest<
Optional extends FastifyInstanceRouteGenericInterface = DefaultFastifyInstanceRouteGenericInterface,
Generic extends FastifyInstanceRouteGenericInterface = OverrideRouteGeneric<Optional, DefaultFastifyInstanceRouteGenericInterface>,
RequestType extends FastifyRequestType = ResolveFastifyRequestType<Generic>
> {
// **added**
genericType: Generic,
schemaType: GetRouteSchema<Generic>
id: any;
params: RequestType['params'];
raw: GetRequest<Generic>;
query: RequestType['query'];
headers: GetProp<GetRequest<Generic>, 'headers'> & RequestType['headers']; // this enables the developer to extend the
// ... omitted
}Then created a implementation on the on the type provider tests to see what they were. interface NumberProvider extends FastifyTypeProvider { output: number } // all schemas are numbers
expectAssignable(server.withTypeProvider<NumberProvider>().get(
'/',
{
schema: { body: '' }
},
(req) => {
const G = req.genericType // DefaultFastifyInstanceRouteGenericInterface: expected specialized interface type
const S = req.schemaType // FastifySchema: expected { body: '' }
}
))The Type Providers will need to see the schema provided by the user, however There was a brief mention to the FastifySchema vs SchemaCompiler mapping requirements here #3397 (comment), but I think the trick will be ensuring that the schema appropriately gets passed through the types such that the Type Provider can see and resolve from it. Hope that helps! |
I think I will go for updating the route option and split the |
|
Here comes another problem and why it is always the |
|
@climba03003 I've put together a small prototype for the object generics and taken a bit of a look at the current overloads for |
|
I may not be actively fixing this in the coming few days. I have bunch of work stacked and planed to finish before the coming long holiday (of my country) in next week. I will start the work again during weekend and next week. |
|
@climba03003 any updates? I would like to ship the first rc asap. |
I think you can just cut the line. I don't think it can be done in a short time based on my schedule. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
cc @sinclairzx81
Just let you know that I am start working on refactoring the old types into a single generic param.
It will be a large change on the ecosystem and may not be doing so fast.
Checklist
npm run testandnpm run benchmarkand the Code of conduct