TanStack / form

🤖 Powerful and type-safe form state management for the web. TS/JS, React Form, Solid Form, Lit Form and Vue Form.

Home Page:https://tanstack.com/form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mark internal methods as internal

Christian24 opened this issue · comments

Hey,

@crutchcorn and I have been chatting about how FieldApi.getSubField is only for internal usage in tests etc and should never be part of the API developers use to develop with Tanstack form. I googled a bit and it seems that adding the JSDoc comment @internal and using this compiler option prevents TypeScript from outputting these into the type definitions. So we should create a list here of API that is not supposed to be used outside of Tanstack Form and mark it appropriately.

I'm hesitant to add this. While getSubField has limited usage and can mostly be considered "internal", there's some usage to be found when combining with validating related fields: #494

However, that's a bit early to talk through. I'll be closing this, as we don't currently have any other methods or fields like this that are so publicly exposed to my knolwedge.

One I would think of is FormApi.state which literally has a comment above saying not to use it ;)