palantir / eclipse-typescript

An Eclipse plug-in for developing in the TypeScript language.
Apache License 2.0
339 stars 74 forks source link

Last modified of generated js files #303

Open StephanRepublika opened 8 years ago

StephanRepublika commented 8 years ago

Hi,

This is a great plugin, however, it recompiles and changes dates of every referenced TypeScript file almost always. That's not the problem, it's good to check more often than less.

But... the problem is the lastModified time of the generated JavaScript files, these files get a timestamp of the generated things. Even when nothing has changed.

Is it possible to change it so that it will set the lastModified time of the generated JavaScript files to the lastModified time of the TypeScript files?

Like this?

diff --git a/com.palantir.typescript/src/com/palantir/typescript/TypeScriptBuilder.java b/com.palantir.typescript/src/com/palantir/typescript/TypeScriptBuilder.java index c12235f..8af44d5 100644 --- a/com.palantir.typescript/src/com/palantir/typescript/TypeScriptBuilder.java +++ b/com.palantir.typescript/src/com/palantir/typescript/TypeScriptBuilder.java @@ -300,10 +300,17 @@ String filePath = EclipseResources.getFilePath(eclipseFile); File file = new File(filePath);

Kind regards,

Stephan van Loendersloot.

StephanRepublika commented 8 years ago

I should have clarified the reason... apologies..

If caching is important on websites, usually file times, sizes and such are used to determine whether a file has changed or not. Even when combining resources, such as JS and CSS files; in this case generated JS files.

Hence the request to apply this.

Thanks.

Stephan.

derekcicerone-zz commented 8 years ago

The timestamps of the TypeScript files should not be touched by any automated processes, right?

I'd be cool with this as a PR if you'd like to submit it.