You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, I commend all the maintainers & creators for such a great library. It has sped up and eased my work 100X if not more.
The context I'm working with is a typescript monorepo with roughly 50 packages within it. I've currently got caching enabled and this speeds up compile times considerably as well as run-many to execute the tsc transpilation. However I am looking to squeeze even more performance out of it by leverage typescript build mode.
I do note that the above pages does list that executing tasks in batch mode is experimental, so in the interim I'm trying to test upgrading to the tsc-batch mode on a subset of packages to confirm it works. The respective project has 6 dependencies and takes roughly 20 seconds to run without caching.
I am unsure about the following when doing this change:
Do I need to remove the tsc command from my package.json file? I see many of the examples don't have a tsc script command in their package.json file
If I should keep it, do I need to update it with --build for the tsc compiler to use build mode. (I've found in my testing that this is needed)
Do I need to update my .tsconfig file in each project to include the incremental:true and composite:true flags on each project's config file? I've seen this is also inconsistent between some examples. I've also found I needed to update it with the rootdir:"./src" setting since the composite setting changes how some paths are calculated.
Previously, since I was using tasks, I just had a nx.json file at my root level. Do I now need a project.json within each projects' base directory?
Do I need to change my caching settings to specify to include the .tsbuildinfo file? When I did manually define the cache output to include this I didn't see a noticeable difference between a cache with a .tsbuildinfo file and one without a .tsbuildinfo file.
How do I verify that the batch mode is working as expected? With the above config of using tsc within the package.json scripts, I can pass a --verbose flag and see that each tsc call for each project is not recompiling. However the overall execution time is basically on par with not enabling batch mode and just using a run-many command on the relevant project.
Basically, I'm really confused on how to actually implement the TSC Batch mode alongside caching when coming from a NX Tasks centered approach. Maybe I'm really misunderstanding the docs but it seems somewhat light in terms of exact specifics on how to implement it. Currently, caching seems much easier to implement and the Batch mode has lots of caveats which makes it difficult to implement.
The text was updated successfully, but these errors were encountered:
Documentation issue
I'm primarily referring the TSC batch mode functionality.
https://nx.dev/showcase/benchmarks/tsc-batch-mode
Additional context or description
First off, I commend all the maintainers & creators for such a great library. It has sped up and eased my work 100X if not more.
The context I'm working with is a typescript monorepo with roughly 50 packages within it. I've currently got caching enabled and this speeds up compile times considerably as well as run-many to execute the tsc transpilation. However I am looking to squeeze even more performance out of it by leverage typescript build mode.
I've been trying to implement tsc batch mode however the current docs on the pages seem to not offer enough info:
https://nx.dev/recipes/tips-n-tricks/enable-tsc-batch-mode
https://nx.dev/showcase/benchmarks/tsc-batch-mode
I do note that the above pages does list that executing tasks in batch mode is experimental, so in the interim I'm trying to test upgrading to the tsc-batch mode on a subset of packages to confirm it works. The respective project has 6 dependencies and takes roughly 20 seconds to run without caching.
I am unsure about the following when doing this change:
tsc
script command in their package.json fileincremental:true
andcomposite:true
flags on each project's config file? I've seen this is also inconsistent between some examples. I've also found I needed to update it with therootdir:"./src"
setting since the composite setting changes how some paths are calculated.tsc
within the package.json scripts, I can pass a --verbose flag and see that eachtsc
call for each project is not recompiling. However the overall execution time is basically on par with not enabling batch mode and just using a run-many command on the relevant project.Some examples I've used to try help myself:
Basically, I'm really confused on how to actually implement the TSC Batch mode alongside caching when coming from a NX Tasks centered approach. Maybe I'm really misunderstanding the docs but it seems somewhat light in terms of exact specifics on how to implement it. Currently, caching seems much easier to implement and the Batch mode has lots of caveats which makes it difficult to implement.
The text was updated successfully, but these errors were encountered: