Giter Site home page Giter Site logo

Comments (11)

derekcicerone-zz avatar derekcicerone-zz commented on May 31, 2024

We could probably remove the clean code but won't writing new files run into the same issue? I haven't heard of any scenarios in which it would be desirable to track the output files before, what is the use case?

from eclipse-typescript.

barakka avatar barakka commented on May 31, 2024

At least in my case, writing to the file did not create any problem, while failing on the delete would stop the incremental build for any file.

With respect to why tracking generated files it is needed for two reasons:

  1. our build tool-chain is maven based, and the typescript support for maven is quite reduced (there is an half decent plugin, with a some issues however). Therefore I have to ensure that my build server receives the generated output from source control, as it will not be able to regenerate it outside eclipse (in Jenkins in this case). There several ways in which I could fix, the plugin above, some ant script using tsc from the command line, etc. buy the all bring hassles.
  2. I'm the only person working with typescript on my team, but the other teammates still need the generated output to the test the app in their environment. If I don't track the generated output, the only other way is to force all of my teammates to install the eclipse plugin (and node!!! By the way, it would be great if node could be in some way directly packaged with the plugin, without requiring a separate download).

from eclipse-typescript.

derekcicerone-zz avatar derekcicerone-zz commented on May 31, 2024

Ok, I think the best thing to do is probably just remove the clean logic for now then to unblock you.

I'm not sure how we could package up node with the plug-in since it requires different binaries for each platform. I suspect it would greatly increase the size of the download. If you find any info out though, please let me know.

from eclipse-typescript.

barakka avatar barakka commented on May 31, 2024

If I'm the only one having this type of problems, don't worry about changing the current behavior. I've already put deleting behind a preference in my repo, so I'm not blocked.

You might wan't to try/catch the deleting of resources in any case, just to play it safe.

from eclipse-typescript.

derekcicerone-zz avatar derekcicerone-zz commented on May 31, 2024

I've always considered the deletion logic a bit suspect so I think it should probably go. The only cleanup we should really be doing is deleting corresponding JavaScript and source map files when a .ts file is deleted (or renamed).

from eclipse-typescript.

barakka avatar barakka commented on May 31, 2024

It looks like this issue has re-emerged in last versions of the plugin, when using the "Compile all TypeScript files on build" option. This also happens with svn, and it seems limited to full builds.

from eclipse-typescript.

derekcicerone-zz avatar derekcicerone-zz commented on May 31, 2024

What behavior are you seeing specifically?

from eclipse-typescript.

barakka avatar barakka commented on May 31, 2024

We have a project with typescript activated, with only the source folder configured (all other paths are empty). We commit every file, both the .ts and the generated .js and .map.js and the workspace is clean.

We then close eclipse and restart it. As soon as eclipse completes rebuilding the project, the generated files are either marked as changed (in case of .git repo), or marked as deleted (in svn repo).

Git seems smarter, 'cos attempting a synchronize afterwards shows no changes. But the svn team provider includes the resources for deletion. Please note that the generated files are there, they are just marked as deleted (and will be deleted if one commits). Changing a source to force the update of the generated ones has the same effect, with the generated file being physically there but marked for delete.

The problem, I believe, depends on the fact that cleaning the project removes the generated files (which would be normal in the general case, but a problem in out setup), and a full build seems to issue a clean and then a compile.

Originally I had patched the plugin to delete the generated files only if the source file was deleted, but we have since then switched to the original plugin to receive the new updates.

Honestly I don't know which could be a good solution satisfying all use cases. Maybe a configuration switch that would avoid cleaning generated resources during a clean (as silly as it might be)?

from eclipse-typescript.

derekcicerone-zz avatar derekcicerone-zz commented on May 31, 2024

For a full build, I believe that delete and rebuild is the expected behavior, right? Restarting eclipse shouldn't automatically trigger a full rebuild though - is that a workspace option perhaps?

from eclipse-typescript.

barakka avatar barakka commented on May 31, 2024

Don't think so. We just have the workspace set up with "Build automatically" and I believe that triggers the build (for instance after a svn checkout).

But the problem is unrelated with re-opening eclipse. We can just commit everything, call for a full build without touching any source and we would get the generated files not only marked as modified (which we could live with) but also marked as deleted (with svn), which then generates all types of commit problems.

The problem might be with the svn team provider, that once it detects the file has been deleted it keeps it marked deleted even if regenerated. But I've not found any svn option to change this behavior.

from eclipse-typescript.

derekcicerone-zz avatar derekcicerone-zz commented on May 31, 2024

Hmm, I'm looking at the code now and I don't see where the compiled JavaScript file would be deleted during normal compilation. They would definitely be deleted during a clean build but that should be it.

from eclipse-typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.