Visitar URL original
feat: add support for TypeScript 4.0 by alan-agius4 · Pull Request #38076 · angular/angular · GitHub
The Wayback Machine - https://web.archive.org/web/20211020035826/https://github.com/angular/angular/pull/38076
Skip to content
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

feat: add support for TypeScript 4.0 #38076

Closed
wants to merge 7 commits into from
Closed

Conversation

@alan-agius4
Copy link
Contributor

@alan-agius4 alan-agius4 commented Jul 15, 2020

No description provided.

@ngbot ngbot bot added this to the needsTriage milestone Jul 15, 2020
@ngbot ngbot bot added this to the needsTriage milestone Jul 15, 2020
@angular angular deleted a comment from googlebot Jul 15, 2020
@alan-agius4 alan-agius4 force-pushed the ts-4 branch 12 times, most recently from 1553efd to 93e995b Jul 16, 2020
@alan-agius4 alan-agius4 force-pushed the ts-4 branch 6 times, most recently from fb8fae4 to 7fc77a3 Jul 17, 2020
@alan-agius4 alan-agius4 force-pushed the ts-4 branch 2 times, most recently from 8909a59 to 23470e3 Aug 19, 2020
Copy link
Member

@jelbourn jelbourn left a comment

LGTM

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from AndrewKushnir Aug 24, 2020
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Reviewed-for: public-api

@mhevery mhevery closed this in 0fc44e0 Aug 24, 2020
mhevery added a commit that referenced this issue Aug 24, 2020
With Typescript 4, `ts.updateIdentifier` is no longer available.
Calling `ts.updateIdentifier` used to return the same node when
`typeArguments` was `undefined` because `node.typeArguments`
was also `undefined`.

Relevant TS code:
```js
function updateIdentifier(node, typeArguments) {
  return node.typeArguments !== typeArguments
      ? updateNode(createIdentifier(ts.idText(node), typeArguments), node)
      : node;
}
```

PR Close #38076
mhevery added a commit that referenced this issue Aug 24, 2020
This version supports TypeScript 4.0

PR Close #38076
@alan-agius4 alan-agius4 deleted the ts-4 branch Aug 24, 2020
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 29, 2020
With this change we add support for TypeScript 4.0

PR Close angular#38076
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 29, 2020
…r#38076)

With Typescript 4, `ts.updateIdentifier` is no longer available.
Calling `ts.updateIdentifier` used to return the same node when
`typeArguments` was `undefined` because `node.typeArguments`
was also `undefined`.

Relevant TS code:
```js
function updateIdentifier(node, typeArguments) {
  return node.typeArguments !== typeArguments
      ? updateNode(createIdentifier(ts.idText(node), typeArguments), node)
      : node;
}
```

PR Close angular#38076
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 29, 2020
This version supports TypeScript 4.0

PR Close angular#38076
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 31, 2020
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 31, 2020
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 31, 2020
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 31, 2020
With this change we add support for TypeScript 4.0

PR Close angular#38076
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 31, 2020
…r#38076)

With Typescript 4, `ts.updateIdentifier` is no longer available.
Calling `ts.updateIdentifier` used to return the same node when
`typeArguments` was `undefined` because `node.typeArguments`
was also `undefined`.

Relevant TS code:
```js
function updateIdentifier(node, typeArguments) {
  return node.typeArguments !== typeArguments
      ? updateNode(createIdentifier(ts.idText(node), typeArguments), node)
      : node;
}
```

PR Close angular#38076
subratpalhar92 added a commit to SUBRATPALHAR-ALL-JAVASCRIPT/angular that referenced this issue Aug 31, 2020
This version supports TypeScript 4.0

PR Close angular#38076
profanis added a commit to profanis/angular that referenced this issue Sep 5, 2020
With this change we add support for TypeScript 4.0

PR Close angular#38076
profanis added a commit to profanis/angular that referenced this issue Sep 5, 2020
…r#38076)

With Typescript 4, `ts.updateIdentifier` is no longer available.
Calling `ts.updateIdentifier` used to return the same node when
`typeArguments` was `undefined` because `node.typeArguments`
was also `undefined`.

Relevant TS code:
```js
function updateIdentifier(node, typeArguments) {
  return node.typeArguments !== typeArguments
      ? updateNode(createIdentifier(ts.idText(node), typeArguments), node)
      : node;
}
```

PR Close angular#38076
profanis added a commit to profanis/angular that referenced this issue Sep 5, 2020
This version supports TypeScript 4.0

PR Close angular#38076
@KapilSachdev
Copy link

@KapilSachdev KapilSachdev commented Sep 15, 2020 •

It seems 0fc44e0 added TS 4.0 support to 10.1 and i'm assuming it works fine, but getting the below error.

ERROR in src/app/some/some.component.ts:26:81 - error TS2729: Property 'some_id' is used before its initialization.

26   public data: any = {some_id: this?.some_id, date: new Date()};
                                                                                   ~~~~~~~~~~~~~~~

  src/app/some/some.component.ts:22:12
    22   @Input() some_id
                  ~~~~~~~~~~~~~~~
    'some_id' is declared here.

As it is evident, the variable is defined before its being used.
Also it works fine with 3.9.
I'm not sure if TS 4.0 introduced something that could cause this issue, but i think its ng so just wanted to confirm. I tried to look into issue tracker for similar reports, though not that deeply, but didn't found any.

@fxck
Copy link

@fxck fxck commented Oct 9, 2020 •

Property 'serviceStackId$' is used before its initialization.ts

image

happens only with TS 4

@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Nov 9, 2020

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 Nov 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.