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

Deleting a file doesn't delete its js output #125

Closed
dwickern opened this issue Feb 16, 2018 · 8 comments
Closed

Deleting a file doesn't delete its js output #125

dwickern opened this issue Feb 16, 2018 · 8 comments
Labels
bug build Ideas for or bugs with the build process duplicate

Comments

@dwickern
Copy link
Contributor

If you delete a typescript source file, its compiled js will still be there, potentially changing the app's behavior

@chriskrycho
Copy link
Member

Do we have any hooks that would even conceivably let us solve this? Or should we tackle it via documentation?

@championswimmer
Copy link

If the file is manually deleted, then there's no way we can delete the .js automatically.
It has to be documented only.

@dfreeman
Copy link
Member

Just to confirm, this is specifically for incremental rebuilds? The next time a fresh build is started the output will be gone?

We could try nuking the output directory when a new build starts, but I'm not sure we can do that in a non-race-conditiony way.

@championswimmer
Copy link

I think what is meant here is, if a .ts file is manually deleted and it's generated .js remains.

I don't think we can delete such a file.

@chriskrycho
Copy link
Member

@dfreeman have any of our changes to our build pipeline made this more viable? 🤔 If not, I’m thinking we should be able to solve it once we move to the Babel 7 implementation?

@dfreeman
Copy link
Member

Right now tsc doesn't clean up the output for removed files during incremental rebuilds, and we're essentially just symlinking its output back into the Broccoli flow.

We could use delete events from the file watcher as a cue to remove the corresponding .js file from the output if it existed, though I'm not positive it will always be easy to map the input file to its output location with things like paths in play. I don't know for sure, but I would guess that with Babel 7 we'd get proper deletion 'for free'.

@rtablada
Copy link

It also seems like even making a JS file instead doesn't solve the deleted file either.

@chriskrycho chriskrycho added bug build Ideas for or bugs with the build process labels Jul 6, 2018
@chriskrycho
Copy link
Member

See also #186, which is essentially the same thing but expanded to cover renames. (I'm closing this in favor of that.) Still seems likely that Babel 7 landing is what will finally fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build Ideas for or bugs with the build process duplicate
Projects
None yet
Development

No branches or pull requests

5 participants