-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(server-functions): omitted any from fieldErrors #6720
Conversation
Typescript crashes because any could be infinite fix QwikDev#6719
|
|
Name | Link |
---|---|
🔨 Latest commit | 271baaf |
@gioboa @shairez Looks like I've tripped myself up. We sometimes use any because we have multi-step forms. Typescript unfortunately can't handle it. Showing: I rewrote it so that the type never ends up in fieldErrors because Zod ignores any anyway. I hope one of you can write typescript a little better than I can. I have patched it with the small change to |
commit:
|
starters/apps/qwikcity-test/src/routes/(common)/actions/issue5463/index.tsx
Outdated
Show resolved
Hide resolved
@fabian-hiller just to let you know the ValidatorErrorKeyDotNotation wasn't capturing Record types. Added IsAny to the types.ts in the runtime and added tests. Maybe you can catch up with me some time talking about rewriting this a bit more. |
Have you seen my PR #6752? |
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.
@fabian-hiller I'd like to merge this already, it will cause your pr to get merge conflicts though. Ok? |
: `${Prefix}${K}`; | ||
}[keyof T & string] | ||
: never; | ||
export type IsAny<T> = 0 extends T & 1 ? true : false; |
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.
I think the IsAny
type is just a internal util type similar to the Prettify
type above and should not be exported.
@fabian-hiller I'm fine with it, but I copied your type and your type includes any as type string. So I added a bit more logic. I'm fine merging the prs together. |
Ahh... So you recommend that I should also copy your entire |
I think that's a good idea |
> > Co-authored-by: Tobi <[email protected]>
Co-authored-by: Tobi <[email protected]>
Done |
@fabian-hiller perfect! |
…#6752) * feat: add valibot$ validator and fix types of zod$ implementation * fix: brand typed data validators * fix: update API documentation of Qwik City * feat: copy code from PR #6720 to merge PRs Co-authored-by: Tobi <[email protected]> * fix: document change with changeset * chore: change version declaration of Valibot dependency * chore: change version declaration of Valibot dependency * fix: change text of changeset * chore: Add alpha preview warning to valibot$ API --------- Co-authored-by: Tobi <[email protected]>
…#6752) * feat: add valibot$ validator and fix types of zod$ implementation * fix: brand typed data validators * fix: update API documentation of Qwik City * feat: copy code from PR #6720 to merge PRs Co-authored-by: Tobi <[email protected]> * fix: document change with changeset * chore: change version declaration of Valibot dependency * chore: change version declaration of Valibot dependency * fix: change text of changeset * chore: Add alpha preview warning to valibot$ API --------- Co-authored-by: Tobi <[email protected]>
Typescript crashes because any could be infinite
fix #6719
What is it?
Description
See
Checklist: