-
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
repo: upgrade to TypeScript 4 #10355
Conversation
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.
The localization-manager
package also has a dependency to typescript
(as a runtime dependency), do you mind updating that one as well? I think we should keep them synchronized.
b845a1e
to
af7ef93
Compare
@paul-marechal I'm not against keeping up with typescript versions, but I'm getting a bit worried with the rate of changes we have in our build system. We don't want adopters to have to catch up every release. Would it be possible to update the tooling (which is what we want) and keep the syntax checking at 3.9? |
The build system shouldn't impact adopters that are consuming the npm packages we are publishing, like at all? Beside the potentially new type definition, which won't cause any issue until the moment someone makes a PR using new things from TypeScript. For those that build the repo themselves, doing |
Not AFAIK, we'd have to keep an eye out on what goes in but that doesn't sound super robust. |
Since we have no way to ensure that no > 4.0 constructs are used in Theia, they will effectively have to move to 4.0, as well eventually. Looking at the Typescript changelog, that might be a breaking change. |
@tsmaeder Yes, indeed. Although it should be a trivial change for downstream clients, should anything break. Last time we broke something related to TypeScript it was the compilation target and the community seem to have received it well? With the Node/Electron upgrade we might be able to bump it again btw. Also, the TypeScript version we've been using is a year old already. I don't think it's a crazy idea to try and not lag too much behind in the future. I think Anton had suggested targeting In other projects this dependency upkeep and build system care is usually called "chore" because it is, but it's necessary for a healthy project IMO. I had the pleasure of addressing parts of the build system that hadn't changed in a year or more, and the debt was painful to pay in full. Doing it incrementally should be better. |
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.
Looks fine to me. Minor comments on the @ts-expect-error
comments. Probably if we compiled Phosphor ourselves with a later TS version, we could get rid of those, but that doesn't seem worth it. I don't love the number of new any
's that are introduced, but they point to places where we're not being as clear about our intent as we should be, and I'm fine with them for now.
The upgrade didn't seem to improve my build or code browsing experience, but I agree with @paul-marechal that these are chores that we're stuck with - we can't really plan to lag behind indefinitely, so we'll have to do this at some point. Certainly open to discussion about the schedule on which we should upgrade our tools, but this doesn't seem hasty to me.
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.
By the way, I can confirm that running Find All References
with TypeScript 4.4.4 runs way faster in Theia now, compared to 3.9. However, the current default for the TypeScript extension seems to be 3.8, so I had to manually change it to the workspace version to verify this.
How? I thought the extension would use what VS Code bundles I thought it would be using 4.4? We also have the TypeScript version set to |
@paul-marechal I was confused as well, but we currently use the And you're right as well that we added the appropriate setting to use the
So the setting only tells the extension which workspace version should be used, but it doesn't tell it to use that one from the start. The user has switch manually. I just learned about that one as well. |
Thanks for pointing all of this out @msujew.
This means that the edit: Turns out we can't really delete it. |
I rebased this PR on master and also pushed TypeScript to 4.5. |
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.
Thanks Paul! Looks good to me, I have a small remark, but I'll approve this already 👍
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.
The changes look good to me 👍
I confirmed that
- editing in vscode still shows markers for tslint
- typescript functionality works (and feels quicker)
- the application builds and starts
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.
LGTM and seems to work at least as well. Excited to get better type check handling, and some day I may find the time to address the new any
's :-).
@paul-marechal : Let's merge this! |
@tsmaeder I remember saying we should avoid upgrading TypeScript, but I changed my mind.
I want to upgrade in order to build slightly faster and hope to fix an issue with our current version of
tsserver
being quite slow on our repo. Switching to TypeScript 4.4 I couldn't notice the lag anymore.Upgrading the TS version we use to build this repo might lead to breakage in downstream applications in the following case:
type SomeTuple = [a: string, b: number]
)The solution would be for them to also upgrade their version of TypeScript in such a case. I think this is manageable.
As @msujew mentioned: TypeScript doesn't follow semantic versioning. But patch versions shouldn't bring breaking changes.
Closes #10354.
How to test
Review checklist
Reminder for reviewers