8000 feat(core): support TypeScript 4.4 by crisbeto · Pull Request #43281 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content

feat(core): support TypeScript 4.4 #43281

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

Closed
wants to merge 1 commit into from
Closed

Conversation

crisbeto
Copy link
Member
@crisbeto crisbeto commented Aug 28, 2021

Adds support for TypeScript 4.4. High-level overview of the changes made in this PR:

  • Bumps the various packages to typescript@4.4.2 and tslib@2.3.0.
  • The useUnknownInCatchVariables compiler option has been disabled so that we don't have to cast error objects explicitly everywhere.
  • TS now passes in a third argument to the __spreadArray call inside child class constructors. I had to update a couple of places in the runtime and ngcc to be able to pick up the calls correctly.
  • TS now generates code like (0, foo)(arg1, arg2) for imported function calls. I had to update a few of our tests to account for it. See Indirect calls for imported functions microsoft/TypeScript#44624.
  • Our ngtsc test setup calls the private matchFiles function from TS. I had to update our usage, because a new parameter was added.
  • There was one place where we were setting the readonly hasTrailingComma property. I updated the usage to pass in the value when constructing the object instead.
  • Some browser types were updated which meant that I had to resolve some trivial type errors.
  • The downlevel decorators tranform was running into an issue where the Closure synthetic comments were being emitted twice. I've worked around it by recreating the class declaration node instead of cloning it.

@google-cla google-cla bot added the cla: yes label Aug 28, 2021
@crisbeto crisbeto force-pushed the ts-4.4 branch 4 times, most recently from 3dd89b2 to 7634b1e Compare August 28, 2021 09:22
@JoostK
Copy link
Member
JoostK commented Aug 28, 2021

Just a heads up from the ngcc perspective: it has some integration tests that use TypeScript to compile TS sources to JS as that was generally a good way to know that ngcc is capable of processing the output from TS, but now that we're transitioning to Ivy partial compilation and compiling libs with View Engine will not be supported in v13 there isn't necessarily a need for ngcc to process libraries that have been compiled using TS 4.4. We may want to revise the tests to stick to TS 4.3, or maybe there's an alternative approach (or maybe it doesn't break with this update).

@crisbeto crisbeto force-pushed the ts-4.4 branch 8 times, most recently from d5d706e to d6609dd Compare August 29, 2021 11:22
@crisbeto crisbeto marked this pull request as ready for review August 29, 2021 11:43
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the framework runtime target: major This PR is targeted for the next major release labels Aug 29, 2021
@ngbot ngbot bot modified the milestone: Backlog Aug 29, 2021
@crisbeto crisbeto requested review from alxhub and IgorMinar August 29, 2021 12:09
Copy link
Contributor
@atscott atscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-router

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 22, 2021
@AndrewKushnir
Copy link
Contributor
AndrewKushnir commented Sep 22, 2021

Presubmit + Global Presubmit.

@AndrewKushnir AndrewKushnir removed the action: presubmit The PR is in need of a google3 presubmit label Sep 23, 2021
@AndrewKushnir
Copy link
Contributor

FYI presubmits (including a global one) are successful, so I'm removing the "presubmit" label.

Copy link
Member
@alxhub alxhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: global-approvers

Copy link
Contributor
@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for Elements

@crisbeto crisbeto removed the request for review from JiaLiPassion September 23, 2021 18:13
@alxhub alxhub closed this in ea61ec2 Sep 23, 2021
crisbeto added a commit to crisbeto/angular that referenced this pull request Sep 27, 2021
In angular#43281 I had to add a `resolutions`for `typescript` due to the `api-extractor` being locked down to an older version. Now that it has been updated, we don't need the workaround anymore.
alxhub pushed a commit that referenced this pull request Sep 27, 2021
In #43281 I had to add a `resolutions`for `typescript` due to the `api-extractor` being locked down to an older version. Now that it has been updated, we don't ne
8000
ed the workaround anymore.

PR Close #43563
@LayZeeDK
Copy link
Contributor
LayZeeDK commented Sep 27, 2021

So... Are TypeScript 4.2 and 4.3 going to be supported by Angular 13?

@crisbeto
Copy link
Member Author

They won't. There will be a follow-up PR to this to drop support once the other repos have upgraded.

@LayZeeDK
Copy link
Contributor

Thanks, @crisbeto!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the framework runtime cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0