Skip to content
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

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

Open
RacyMind opened this issue Jul 31, 2022 · 3 comments
Open

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

RacyMind opened this issue Jul 31, 2022 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@RacyMind
Copy link

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

@Sopamo Sopamo added the bug Something isn't working label Jul 31, 2022
@Sopamo
Copy link
Owner

Sopamo commented Jul 31, 2022

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 Sopamo added the good first issue Good for newcomers label Jul 31, 2022
@RacyMind
Copy link
Author

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

@Sopamo
Copy link
Owner

Sopamo commented Jul 31, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants