-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
WIP [poc] get rid of ts-node #2563
Conversation
5669a65
to
0db82c4
Compare
For me personally, it is fine (and I even prefer) to have a tsc watching instead of relying on ts-node. |
What do you mean by "we should be watching the tests when testing"? After reading a bit, my understanding is that we currently didn't build the tests, but rather interpreted the Typescript files ( edit: I would definitely like this optimisation, as your benchmarks are very interesting! |
Yes, that is what you do without ts-node. But since it adds a step to your turnarounds some developers prefer ts-node. But I think tsc watch is just as good but closer to what the build does. |
when you work on a package, then you should recompile it before running tests
It is what happens with this PR during the build and why it is faster. |
Ok I understand better now, I was worried about starting |
How about mentioning these results on the dev meeting? We can add it to the agenda to know if people would mind or not having to build their tests using |
@marechal-p sounds good with the dev meeting, this PR will need some love to completely get rid of ts-node |
Also, after we switch to project references with ts 3, watching of the whole repo should be super fast. |
af4d44f
to
b747147
Compare
I personally prefer |
@akosyakov, can I still test and debug one single module from VS Code after this PR gets merged to master? |
@kittaakos I will need to look how it can be done, but we for sure want to be able to debug the single module from VS Code. |
Signed-off-by: Anton Kosyakov <[email protected]>
Signed-off-by: Anton Kosyakov <[email protected]>
Signed-off-by: Anton Kosyakov <[email protected]>
b747147
to
8545a8f
Compare
@kittaakos I've figured out how to debug Mocha tests without ts-node: https://github.com/akosyakov/ts-mocha-debugging
Regarding this. Generally, it improves subsequent compilations, but watching in the build mode all packages is still a way slower than watching for an individual package without package references. I won't incorporate it into watch npm script because of it, only in the build script. |
I will open separate PRs for getting rid of ts-node and enabling project references. Please don't touch the branch though i need it. |
It is not to merge but compare results.
I've noticed that our tests are running slow during the build, because we recompile them with ts-node, even for packages which don’t have any. More dependencies package has more time it takes, to compare for
@theia/core
:Tests execution itself takes 8-9s. All other packages take even longer.
Also, latest ts-node does not really work with our setup. They don’t look at files attribute in tsconfig anymore to speed up tests, but it breaks us since we specify there how d.ts files should be resolved.
I wonder whether we can get rid of it. Does anybody object?
Test execution form VS Code and from cli would be faster as well, plus no need to struggle with ts-node during switching to newer ts version. The only drawback that we should watch the package under testing, but most of the time it is the case.