-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Improving Flow types #4410
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
Comments
Yep, it could definitely use some improvements! The declarations were added mid-way when a pure ES codebase was already in place, so there are quite a few places I was just trying to get by. My Flow knowledge is also limited so I'd appreciate PRs. |
@thejameskyle have you any link about using flow with vuejs? @yyx990803 It would be great to have documentation like the one that was made for TS. |
Is currently someone working on this? If not I would like to try it. |
@MarkusToe Thanks for offering to help! :) Currently we are not actively working on improving the typings - we only add/change stuff we find while working on other parts, fixing bugs etc. So it would be great if you can improve the situation here! |
In files like https://github.com/vuejs/vue/blob/dev/flow/component.js there's a lot of uses of
any
,Object
, andFunction
.These types aren't actually type-safe. They are there for convenience purposes.
any
you should usemixed
(or a more specific type).Function
you should use(type, type) => type
Object
you should use{ prop: type }
or{ [key: type]: type }
(for maps)This will drastically improve user's experience with Vue using Flow.
The text was updated successfully, but these errors were encountered: