Open jasonkuhrt opened 4 years ago
I'm running into this when we do type checking in CI. Maybe once I'm able to build this won't be an issue, but as things stand I can't run tsc
in CI.
Maybe once I'm able to build this won't be an issue
@chrisdrackett In CI, this is what you would want to do. If that isn't working for you, could you open a new issue about it?
yeah, I've raised it here for now, but I can add an issue as well: https://github.com/graphql-nexus/nexus/discussions/701
Perceived Problem
when checking out a nexus project
or starting a new one
or any flow where node_modules has been deleted
or any flow where typegen has not been run
then user sees TypeScript errors where there actually are none (e.g nexus-prisma
t.model.*
, graphql object type string-style references, ...)then user does not see TypeScript errors where there actually are (Nexus types fall back to any)
examples in the wild:
Ideas / Proposed Solution(s)
create vscode extension that is always running typegen in the background
thread in slack
show
``` flavian:frog: Yesterday at 12:38 PM Worked on a small prototype today to see what it’d look like to run the typegen in a vscode extension. Here’s the result: https://www.loom.com/share/001b4abb518f4578a01a9fbe1b3af650 I think there’s a lot of potential but we def. need to work on performance if we want the experience to be great! (edited) Loom 14 March, 2020 - Loom Recording 12 replies schickling 16 hours ago Nice first step! One question though: you seem to have auto save enabled: does it still work with the file unsaved? flavian:frog: 15 hours ago I can make all your dreams come true Johannes :grin: flavian:frog: 15 hours ago Right now it's using the onSave vscode event, but we can do whatever we want with our own watcher or maybe another vscode event flavian:frog: 15 hours ago Actually, if everything's kept is memory until you save, I'm not sure that'll work even with our own watcher schickling 9 hours ago well, TS also works without saving, right? :+1: 1 Jason Kuhrt:sauropod: 9 hours ago We could have a recipe or like describing how to configure vscode optimally, or, if user does not want, at least they know, on save is the "trigger". Maybe buys us time while we look at even more elaborate options. And how much they are needed (open gh issue, collect +1s) (edited) Jason Kuhrt:sauropod: 9 hours ago well, TS also works without saving, right? Yep, at least within a single buffer, just checked. schickling 9 hours ago Yup, I like that idea @Jason Kuhrt Jason Kuhrt:sauropod: 9 hours ago But if I have multiple buffers unsaved, not sure how TS will react. I assume right now that it will react as if they were saved though. Will check right now too... Jason Kuhrt:sauropod: 9 hours ago Confirmed across unsaved files too: image.png image.png Jason Kuhrt:sauropod: 9 hours ago It seems that TS integration is not working off disk alone but a fancy (ish?) combination of disk + state of open files. (edited) Jason Kuhrt:sauropod: 9 hours ago I suppose it wouldn't read off disk at all except for 1) on boot and 2) on tsconfig change. After either of those events I guess it can just work on file events, patching its in memory content... Anyways, if they can do it so can we, reassuring (edited) :100: 1 ```