Ligerx / TachiWeb-React

React front end for TachiWeb-Server
10 stars 4 forks source link

Flow typing seems broken in VSCode #66

Closed Ligerx closed 5 years ago

Ligerx commented 5 years ago

See comments in PR https://github.com/Ligerx/TachiWeb-React/pull/58

If you wanna be super legit about Redux typing, it gets complicated https://blog.callstack.io/type-checking-react-and-redux-thunk-with-flow-part-2-206ce5f6e705

That said I think VSCode flow integration is kinda broken right now for some reason, so it's difficult to see if any types I'm adding are working... =(

Was running into some problems with Flow not starting in VSCode flowtype/flow-for-vscode#224

^ that fixed one problem, but hover still doesn't seem to work for me =(((( flowtype/flow-for-vscode#146

I'm going to have to push off additional typing until after I get Flow fixed

and https://github.com/Ligerx/TachiWeb-React/pull/58/commits/6df6151af76240883431919f069004a535292076

Ligerx commented 5 years ago

https://stephenmann.io/post/how-to-setup-flow-with-create-react-app-and-visual-studio-code/

Ligerx commented 5 years ago

The issue seems to be from Flow itself. An update seemed to break hover type information. https://github.com/flowtype/flow-for-vscode/issues https://github.com/flowtype/flow-for-vscode/issues/310 https://github.com/facebook/flow/issues/7723

I'm going to try downgrading flow and see if that fixes anything

Ligerx commented 5 years ago

Downgraded to v0.72.0 in 18e0f3d9198e205bdba91d08e171c8a450d7e563. I also disabled the LSP (language server protocol) in vscode-flow.

Hook definitions didn't get added until v0.87.0 though https://github.com/facebook/flow/releases/tag/v0.87.0

Check back in later when this gets fixed. Then upgrade flow version and reenable LSP

Ligerx commented 5 years ago

There seems to be a PR that was accepted to fix the issues with the latest Flow version and LSP. https://github.com/facebook/flow/commit/44f313b1ecd

After a new release gets pushed, update (v0.102.0). They seem to release pretty often. https://github.com/facebook/flow/releases


Side Note: Just as I was wrapping up typing redux, the VSCode flow plugin decided to break =( https://github.com/flowtype/flow-for-vscode/issues/341

Mayank1791989 commented 5 years ago

@Ligerx You should use plugin with useLSP=true. LSP mode is much better (feature and performance wise) compared to useLSP=false. useLSP=false is there mainly to support old version of flow (<0.75).

Ligerx commented 5 years ago

Oh hey thanks for checking in @Mayank1791989. I downgraded to 0.72 because hover type definitions weren't working in vscode, but I saw that someone fixed this for the next flow release.

So once flow and flow for vscode get their next releases, everything should be working smoothly.

Ligerx commented 5 years ago

Fixed in 0bdf81cc7f8842e8b0f5f6e048fb790d2fced135 and 51617294b7e01d44340c7d0ed770ad11e2d1d349