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

"Fast" compile does not work as cache is cleared on every compile #328

Open
paullessing opened this issue Feb 2, 2016 · 7 comments
Open

Comments

@paullessing
Copy link

When I run grunt-ts in a setup with grunt-contrib-watch, the fast compile does not work. Every time a file is changed, I see the following message:

Cleared fast compile cache for target: app

I did some debugging and it appears the compile.js module is re-run every time, which clears the map which stores which files are cached for fast compile.

This results in a minor file change taking 45 seconds to recompile, which makes my entire grunt-ts setup rather pointless.

My setup is as follows:

@nycdotnet
Copy link
Contributor

Hi,
Thanks for the report. I'm slowly overhauling grunt-ts and haven't gotten to watch/fast yet. I appreciate you looking into the code.
I'll be honest - the fast feature was written for a time before the TypeScript language service got good. If you're looking for incremental compilation, that's probably your best bet with today's TypeScript. The workflow would be compile on save with a good TypeScript editor like VS, VS Code, or Atom and then watch the emitted JS for the rest of your build tasks. Use grunt-ts as part of your full build target.

All that said, I'd like to make sure fast works if indeed it is bugged, so let's keep this open.

@basarat
Copy link
Member

basarat commented Feb 3, 2016

@nycdotnet feel free to remove the hacky fast code if it becomes a maintenance problem 🌹

@basarat
Copy link
Member

basarat commented Feb 3, 2016

Basically grunt-contrib-watch should be the one telling us which files changed. We had to get it to work because failure was not an option, but now the burden can really be pushed to grunt as this is something that should be generally supported by their ecosystem 🌹

@nsgundy
Copy link

nsgundy commented Feb 25, 2016

Just wanted to chime in and say that I am really looking forward to having grunt-ts work with grunt-contrib-watch :) At the moment the only way to get it working seems to be to have fast turned off.

@vapits
Copy link

vapits commented Mar 22, 2016

For me too.
Fast fails with grunt-contrib-watch actually it cannot find modules if I work in a big project and not all the requires are in the file that is changed so the only option for me for now is to turn of the fast option.

@wcdeich4
Copy link

I have the same problem - and I'm not even using fast compile

@nycdotnet
Copy link
Contributor

Hi - at this point I highly recommend using the built-in TSC fast compile infrastructure. Grunt-ts is quite out of date and not maintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants