-
Notifications
You must be signed in to change notification settings - Fork 927
Use file hash to check for file changes before transpiling (#299) #313
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
Conversation
Please use tabs rather than spaces. You can use EditorConfig to automatically use the correct indentation configuration in Visual Studio. Also, please add a unit test testing this functionality :) |
/// <param name="inputFileContents">The contents of the input file.</param> | ||
/// <param name="outputPath">The output path of the (possibly previously) generated file.</param> | ||
/// <returns>Returns true if the file should be transpiled, false otherwise.</returns> | ||
public virtual bool MustTranspileFile(string inputFileContents, string outputPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer calling this ValidateCache
and making it return true
if the cache is valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ValidateCache is rather vague and unspecific - CacheIsValid would be a better name, since it better hints at what state the cache is actually in, when true/false is returned.
And I like flipping the true/false values, since it would enable me to turn around the if in your next comment ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, CacheIsValid
or CheckCacheValidity
would be fine.
Also please make it private
, and it does not need to be virtual
.
EditorConfig seems like a nice tool. Maybe you should add more .editorconfig files to the relevant parts of the solution ;) Sorry about the missing unit-test. That was a brain fart on my part. All in all good suggestions - I will get back to you with some updates ;) |
Ahh, my mistake, I didn't realise this project was missing an editorconfig file! This is the config I normally use: https://github.com/Daniel15/RouteJs/blob/master/.editorconfig. I must have forgotten to copy it across to this repository 😄 |
(although I've used tabs for a long time, I'm tempted to switch to spaces since at work we always use two spaces for indentation) |
Thanks for the config ;) I think that, in general, using spaces seems to cause the least hazzle ;) |
I think I'm done now ;) |
Thank you! :D |
In reaction to issue #299 I have added a hash based check, which then only transpiles the .jsx file if it has actually changed. This shortens build times considerably.