-
Notifications
You must be signed in to change notification settings - Fork 454
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
Remove diagnostics, reflection support, debug info generation #529
Comments
On diagnostics and reflection support:
|
What do you think about forking this and publishing under a new name (
|
Hm, I'm not sure. It's an opt-in performance problem though, only. So does it really matter? Yeah I'm okay with keeping it in a seperate fork. I think I saw a bot that published PR's on npm under namespaces at some point, e.g. ts-jest@pr-ts-language-server for any outstanding PR's. could that work too? Let's keep it in for now I think. I'll spend some time investigating why it only works sporadically when I have the time. |
|
|
how do you want to proceed? |
First one to rip the code out and put it in another branch gets a cookie? I'll try to figure out if we can publish branches automatically somehow. I'm at https://www.npmjs.com/~geewee if you want to give me publish access (brand new account - aww yeah!) How does that sound? |
What's the (2) reflection / language server issue? Is the goal to spawn a single instance of the languageService, then allow all processes in Jest's worker pool to read from it? |
@GeeWee I've added you on npm. A couple of things (for security reasons)
I think this should work - on a branch, set the package version to something like |
@cspotcode I think that's correct but I'm not 100% certain. |
Yeah optimally we'd allow all workers to read from the same languageServer. It seems like the languageServer transpiles a lot of different files for each file, and I'd hate to do a lot of IO for each file, for each process. |
This PR uses the jest infrastructure for sourcemaps. It completely removes any dependance on source-map-support from our part. Note that removing the languageServer is a breaking change - however it was never documented. A language-server branch has been created based off master. This PR is based on #552 so merge that in first. It closes #340. Surprisingly enough it also closes #240 - passing the sourcemaps explicitly to babel means that the line# are correct in the other end - you'll see that in one of the updated tests. It fixes part of #529 Note that no line# has changed, but some column names have in the tests. I'm not sure the original column names were ever accurate.
I was using the Language Service for a couple of days, in a large project. From what I learned is;
To say the truth, I am a bit disappointing that it was removed, as now my tests will take way longer considering I want to be able to use diagnostics, as this was one of the coolest and exciting features of ts-jest. |
Yeah it potentially solves const enum. I think we'll add it back in, but we're not there quite yet I think. |
First of all, I did read the whole thread rapidly, sorry if I missed something.
@cspotcode the new ts compiler part of ts-jest's code has been heavily inspired from ts-node. Here an ugly but quite understandable diagram of how ts-jest works in beta branch: |
Yes, with the beta (which will become the regular release the next major version), this issue isn't that relevant. It can be closed after the next major version is released |
...and I'm actually realizing that in the compiler one part needs to be added: custom AST transformers are called. For now only the one to hoist jest.mock calls, but plan is to read some other files. It could be useful for modules using ts-jest to build jest presets such as react and especially angular. What's missing in beta for that is only the "read from config which files to use as custom transformers and use them!". Format for those files should actually be the same format as the on in |
Do you want to use my hoisting implementation or do you have your own?
One thing to keep in mind, jest's Babel hoister does 2 things: it hoists
calls and it throws diagnostics when hoisted declarations access variables
that they shouldn't. In TypeScript this is best handled by a language
service plugin, so I started writing one.
…On Sun, Sep 2, 2018, 10:15 AM Huafu Gandon ***@***.***> wrote:
...and I'm actually realizing that in the compiler one part needs to be
added: custom AST transformers are called. For now only the one to hoist
jest.mock calls, but plan is to read some other files. It could be useful
for modules using ts-jest to build jest presets such as react and
especially angular. What's missing in beta for that is only the "read from
config which files to use as custom transformers and use them!". Format for
those files should actually be the same format as the on in
src/transformers/ dir.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#529 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAW-uP7rV42QOulY1hcdiPTwwMGwByChks5uW-f-gaJpZM4UGEv5>
.
|
@cspotcode you should definitely come on slack so we can talk about this ;-) Briefly: hoisting is done, I've tried your PR (quickly, or at least I think it was your PR) but couldn't make it work - anyway I saw it after I implemented mine :-/ But yeah, please come over slack so we can chat better about it ;-) |
Most of the new issues users are facing are due to these.
Diagnostics
Reflection support
Debug info generation
The intent behind this is to trim the codebase to the parts that work and cut out the rest of it because all it does is make maintenance difficult.
The text was updated successfully, but these errors were encountered: