-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
P2sprint readyThis issue should be included in sprint planning viewsThis issue should be included in sprint planning views
Description
We have had many issues with Zod schemas. Ideally, we would use schemas in the simplest possible way.
We should investigate:
- Do we need to document best practices around how to declare types, or can we enforce them programmatically?
- Can we avoid workarounds in open source code to suit Google's monorepo? Can we just change the compiler settings in Google's mono repo instead?
Google monorepo issue
When imported into google's mono repo, the compiler there erases the types in some circumstances, breaking stuff at runtime
See #872 which addresses this, but adds extra boilerplate.
Lit type inference issue
@ditman has hit issues getting type inference to work properly for Lit. This may affect React too.
He recommends
export const ButtonApi = {
name: "Button",
schema: z.object({
...
}).strict(),
} satisfies ComponentApi;
Instead of:
export const ButtonApi: ComponentApi = {
...
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2sprint readyThis issue should be included in sprint planning viewsThis issue should be included in sprint planning views
Type
Projects
Status
Todo