-
Notifications
You must be signed in to change notification settings - Fork 10
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
Editor type safety: type safety requires compile #4
Comments
@jdeanwaite you're right, actually. I just confirmed this issue myself. Turns out my code was recently compiled and I had mistakenly assumed that vscode correctly picked up the "runtime" type checks. Not sure why vscode doesn't pickup the project. Perhaps we should open up an issue over at vscode. |
Reported at microsoft/vscode#57242 |
Thanks for looking into this! If you are a Webstorm user, 2018.2 works great with typechecking without compiling (they had some release notes specific to Typescript 3 features they implemented). |
@jdeanwaite I see. Are you sure the run-time typechecking works across references? I just updated But did not see any errors in the consuming it's supposed to complain that ( By the way, when hovering over a function, I don't see any of the useful type information that vscode gives, like the return type and the jsdoc info ) |
First off, in order to see the useful information, hold down CMD (if you're on a mac) and hover over the function to see details: And you are right, it was only partially working. For instance, if I change a parameter, the new parameter shows up right away in the hints (type CMD + P on a mac while the cursor is inside of the parentheses to get hints). You can see in this image I added However, return types were not correctly updating (like what you showed). |
@jdeanwaite I tried When you're doing a large refactor, you know that some packages won't compile anymore; but to make them compile (i.e. fix them) you'd want to have typing information taken from other packages. Do you get my meaning? |
It's true in the circumstances of refactoring it is not very helpful -- however I haven't had any issues with it getting "stuck" when a file failed to compile. After I fix the issue it seems to move on just fine. So definitely the best scenario would be for the editors to be able to maintain type safety without needing to compile -- not sure where to begin here. It may just be that TS3 project references are too new and editors don't know how to handle them? EDIT: Even if that aspect does not get all the way resolved, the benefits of a monorepo and typescript still outweigh that slight disadvantage. I can live with struggling through refactors for a little bit since those are a small percentage of the time. |
@jdeanwaite let's wait for microsoft/vscode#57242 to get some attention |
Yes, sounds like a plan. Also I saw you posted an inquiry on serverless/serverless-plugin-typescript#110.. This would be better than using |
Another quick issue: you mentioned in the README that this had editor type safety that did not require a compile every time there is a change. I'm using VS Code and in order for it to have any type checking, it requires me to compile the projects first. Any thoughts on this? Are you using any special extensions?
Edit: for further information, Webstorm behaves in the same way -- a build is required before typechecking can occur.
Edit 2: I updated to Webstorm 2018.2 and it appears to do type checking without needing to recompile -- vs code is still an issue after updating.
The text was updated successfully, but these errors were encountered: