-
-
Notifications
You must be signed in to change notification settings - Fork 552
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 JSDoc for all configuration options as webpack #4241
Comments
The type of rspack options is inferred by |
It seems that JSDoc can work in some cases: |
it indeed hurt DX for users,we will try to find better ways to do this |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
the zod type definition is too complex to maintain and read in d.ts, we may consider go back to handwritten json schema with comment support |
@hardfist handwritten json schema or handwritten config types? |
In addition to the missing documentation, it's extremely hard to understand the generated zod types when looking at the |
I have some ideas about this.
interface Address {
id?: string
addressText: string
line1: string
line2?: string
city: string
state: string
postalCode: string
country: string
}
const addressSchema = z.object( {
id: z.string().optional(),
addressText: z.string(),
line1: z.string(),
line2: z.string().optional(),
city: z.string(),
state: z.string(),
postalCode: z.string(),
country: z.string(),
} ) satisfies z.ZodType<Address> see colinhacks/zod#1870 more detail. Actually, if we can transform ts to zod or zod to ts, it's a better way. But Rspack Configuration types is so complex, So I prefer second way. But the drawback is we need maintain a another types. |
The second one LGTM 👍 If we take this approach, we can incrementally migrate types and add JSDoc comments. |
What problem does this feature solve?
Can we add JSDoc for all configuration options as webpack?
What does the proposed API of configuration look like?
Same as webpack:
The text was updated successfully, but these errors were encountered: