double-vue icon indicating copy to clipboard operation
double-vue copied to clipboard

double.d.ts isn't updated after remove files

Open RacyMind opened this issue 2 years ago • 3 comments

If I remove some files, double.d.ts still contains data of a removed file

RacyMind avatar Jul 31 '22 08:07 RacyMind

Thanks for reporting this! Due to how double works internally, this is not trivial to fix, because we only ever get events for when a file is imported, but we don't get notifications when files are removed. We might be able to hook into vite's / webpack's file watcher to get events for deleted files though...

Edit: This wouldn't take care of files that are deleted while the bundler isn't running though. Maybe we need some kind of "cleanup" process that runs when the bundler is started as well.

Sopamo avatar Jul 31 '22 08:07 Sopamo

I think you could clear the whole file if a server is starting. Then, you'd be sure that file contains the current state

RacyMind avatar Jul 31 '22 10:07 RacyMind

That doesn't actually do it, because vite only gets called if you actually import a file, and for most projects, the different pages are lazy loaded, so you would then only get types after you've opened the respective page in the browser. It would have to be a cleanup process which only removes the types where the file doesn't exist anymore.

Sopamo avatar Jul 31 '22 16:07 Sopamo