-
-
Notifications
You must be signed in to change notification settings - Fork 28
2.1 beta #81
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
Conversation
Note: This is necessary in order to preserve directory exclusions like declarations and .yarn-cache to keep the IDE fast
Hi @danielpza ! Lots of edits - but good ones ☺ RefactoringI realized after adding the elision code, that the file size had grown a bit more than is ideal for a single file, so a refactor seemed like a good idea. You can see a summary above of what was done. The refactoring was to make the code easy to read and manage. If you want to pull the latest and have a look, I think you'll find that it should be easy to maintain moving forward. Test RefactorsRegarding tests, I refactored the structure to be more modular to allow for adding specific unit testing and more easily adding new project dirs & more versions of TS as needed. Overall, the changes should make it easier to scale and add testing in the future should we need to. MergingBecause there are a few changes, I wanted to wait on your input before merging. If you're busy, here's a short list of the things I'd love to get some feedback on:
The goal of the readme was to organize, remove redundancy, and simplify. I also added a maintainers section. Looking forward to your thoughts! |
Note: There are a couple of odd issues with the current implementation. I was hoping to lean on the API for the import/export clause rather than re-create the logic it uses, but it looks like this may not be possible. For now, I'm going to go ahead and recreate the elision functionality found in TS: |
Thanks, I'll be taking a look in the next few days |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok to drop travis config?
Yes.
Do we need appveyor? If so, we'll need to drop node 8 as prettier is complaining.
We had a trouble once with paths on windows. That's why we included appveyor, It should be fine to drop node 8 support
Does the new readme look okay?
Yes, it does.
@nonara great work on this, as always :) Could you provide some info on Type-Elision? perhaps link to some related discussions if they were public? |
Thanks! I appreciate that!
I don't think that there's anything official written up about it. It's one of the areas of the compiler that you'd need to know what you're looking for, which is why I'm grateful for Andrew Branch's help on pointing me to the right area! This thread should be very informative on that: microsoft/TypeScript#40603 Also, you can have a look at the code /src/compiler/transformers/ts.ts, which is pretty easy to follow and track down its behaviour. As a quick summary - what it's basically doing is checking the So, for example, if we import three things If we say Alternatively, if all three are types, it will elide the entire import declaration, as the original node had an What's happening for us is that whenever you update a node during transform, it effectively creates a brand new node, with the |
Interesting! If you'd like to consolidate to a single CI, I believe we can do this: jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [10.x, 12.x, 14.x] |
hmm, yeah, that would be better, didn't know about that. |
Should be all sorted!
I see appveyor is still failing. Is it setup somewhere in GitHub or elsewhere ? Or maybe it's just set to use the previous config until the deleted config file is known on master. Otherwise - this is ready. Let me know if there's anything you'd like to address, and when you're good, I'll publish! |
I just removed some appveyor config, I think next builds wont use appveyor anymore.
|
Ha. Yeah sorry about that last commit message, I realized it just after hitting the button. This will follow spec. |
Summary
typescript
) (Fixes Plugin uses module 'typescript' instead of the instance instantiating the plugin #80)ts-patch
andttypescript
Note: No official minimum version was set, so I've set it to 3.6.5 and we're testing using that version as well as the latest, which covers the old and new factory style API.
Update on Type-Elision Debacle
I spent some time in the TS compiler codebase and was able to dialog a bit with one of the MSFT TypeScript team members, who was kind enough to point me in the right direction.
Initially, I was planning to do a PR for TypeScript, but it turns out that because of the way type elision is written, the decision on how or if to move forward ultimately falls to the TS team.
The good news, however, is that I was able to locate the code which performs type elision and determine why it doesn't work for updated nodes. This lead to determining a route for recreating the behaviour in a way that will not circumvent the API.
Relevant changes:
ToDo