Meteor-Community-Packages / meteor-typescript

Typescript compiler package
https://packosphere.com/refapp/meteor-typescript
MIT License
5 stars 2 forks source link

No recompilation if file changed more than once #9

Open Avijobo opened 2 years ago

Avijobo commented 2 years ago

After each new 'meteor run', when a source file is edited then, compiler only reruns once for that file. A new edit of the same file does not trigger a new compilation:

This is the log after a first 'main.ts' change:

Typescript processing requested for web.browser using Typescript 4.6.2 
Compiling server/main.ts 
Writing .meteor/local/plugin-cache/refapp_meteor-typescript/0.3.8/v2cache/buildfile.tsbuildinfo 
Compilation finished in 0.1 seconds. 1 files were (re)compiled. 
Typescript summary: 0.3 seconds for sending 113 transpiled files on for bundling 
Typescript processing requested for os.linux.x86_64 using Typescript 4.6.2 
Typescript summary: 0.3 seconds for sending 40 transpiled files on for bundling 
=> Meteor server restartedTypescript processing requested for web.browser.legacy using Typescript 4.6.2 
Typescript summary: 0.3 seconds for sending 113 transpiled files on for bundling

This is the log after a second 'main.ts' change:

Typescript processing requested for web.browser using Typescript 4.6.2 
Typescript summary: 0.3 seconds for sending 113 transpiled files on for bundling 
Typescript processing requested for os.linux.x86_64 using Typescript 4.6.2 
Typescript summary: 0.3 seconds for sending 40 transpiled files on for bundling 
=> Meteor server restartedTypescript processing requested for web.browser.legacy using Typescript 4.6.2 
Typescript summary: 0.3 seconds for sending 113 transpiled files on for bundling 

As you can see, 'main.ts' is not recompiled anymore.

This happens for all source files, so they can only be changed once. A new 'meteor run' resets this behavior.

This behavior is here already for some time, could even be from the beginning when I started using this package about half year ago.
It works fine with the default meteor 'typescript' package, which recompiles correctly with any file change, however since this doesn't show any error logging I prefer this package.

Any ideas?

I'm currently running Meteor 2.7 on Linux Mint 19.2 (Ubuntu 18.04).

perbergland commented 2 years ago

I had the same problems until switching to

  "watchOptions": {
    "watchFile": "useFsEvents"
  },

in my tsconfig.json file so there seems to be errors in the Typescript watch implementation when not using native fs events which are only available on Mac and Windows.

Maybe this will be fixed in 4.8 along with the performance improvements?

https://devblogs.microsoft.com/typescript/announcing-typescript-4-8-beta/#build-watch-incremental-improvements

perbergland commented 1 year ago

TS 4.9 claims to have some improvements in this area and defaults to useFsEvents