-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Support flowtype definition for flow-typed (WIP) #5027
Conversation
Hi @kazupon , thank you for this contribution. I'm reporting my experience with integrating Flow with Vue. But I think this might be helpful to you.
Providing good typing experience would be very hard in flow. Mainly due to flow's inherent expressiveness: this-type: facebook/flow#452 Without this -type, we cannot define Vue's methods/data option. Without augmentation, we cannot extend Vue's option object (which is a practice quite common in Vue community). These two are simply deal breakers. Arguably TypeScript definition file does not provide decent experience (for now, will be better after TS2.3). But TS definition serves as a basic ground for library authors like vue-class-component. Sadly, class component like approach utilizes stage-1 decorator syntax, which flow just ignores now. This simply means flow-definition isn't needed. 😞 Other typing approach like chain-api isn't doable in flow due to this-typing problem stated above. Generally I would dare to say Flow is (naturally) React biased. It is very hard to integrate other frameworks with it... |
@HerringtonDarkholme When I'm implementing flow type definition of vue, I encountered to it. |
@kazupon @HerringtonDarkholme, hello. I'm kinda confused on this topic. I'm seeing some flowtype defs in |
@StreetStrider Vue core or Vue official plugins have some flowtype definitions, But these are for internal developement. in this reason, I'll try to improve, As I have mentioned in the above, I have encountered difficulties. |
@StreetStrider The definitions in the As @HerringtonDarkholme explained, that is hard to do currently, without a possibilty to type |
I see. 🤔 the main obstacle is Flow does not allow determine In light of |
@kazupon, any updates on this? I'd enjoy using Flow type checking with Vue but it actually looks like they are interested only in React ecosystem atm. |
This would be a nice feature indeed. |
@kazupon any news about that? Thanks! |
Until this-type: facebook/flow#452 and library augmentation: facebook/flow#396 are supported in Flow hardly can we take any further action. |
@kazupon what about providing partial I know, that we can not extend existing library definitions, but still. I had some experiments to be able to annotate
You can join me with my attempts here: https://github.com/sobolevn/vue-flow-typed |
Closing as we will be focusing on TS for userland type support. |
This is a flowtype definition for Vue.js
If this pull request does not need, feel free to close it.
Like a TypeScript, I would like to unite the way of providing these definition files.
Already in the
flow
directory, as @evan have said in here,but these definition files are defined that specialized in due to internal develop.
I feel these definition files don't give good development experimence to users, to say the least.
As well as typescript, I hope to provide the official flowtype definitions.
I'm considering the below specs:
decls
directory for flowtype definitionflow-bin
(already installed with package.json)package.json