Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

alan-agius4
Copy link
Contributor

With this change we drop support for TypeScript 3.8 and remove all related tests.

BREAKING CHANGE:

TypeScript 3.8 is no longer supported, please update to TypeScript 3.9

@alan-agius4 alan-agius4 added state: blocked action: review The PR is still awaiting reviews from at least one requested reviewer breaking changes area: packaging Issues related to Angular's creation of npm packages target: major This PR is targeted for the next major release labels May 15, 2020
@ngbot ngbot bot modified the milestone: needsTriage May 15, 2020
@pullapprove pullapprove bot requested review from alxhub and IgorMinar May 15, 2020 07:40
@alan-agius4
Copy link
Contributor Author

alan-agius4 commented May 15, 2020

Blocking until a release that supports both 3.8 and 3.9 is cut, since this is required to move CLI off TS 3.8 and Components land their TS 3.9 changes

angular/components#19336
angular/angular-cli#17711

@alan-agius4 alan-agius4 changed the title refactor: remove support for TypeScript 3.9 refactor: remove support for TypeScript 3.8 May 15, 2020
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Couple of suggestions.

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you! @alan-agius4 you rock!

Reviewed-for: global-approvers

@kara kara added action: merge The PR is ready for merge by the caretaker action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 15, 2020
@kara
Copy link
Contributor

kara commented May 15, 2020

@alan-agius4 Can you look at the CI failure?

@googlebot

This comment has been minimized.

@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@IgorMinar
Copy link
Contributor

I rebased this PR and tried to use the latest green master SHA from the components repo. If that doesn't help, then we are likely dealing with some real incompatibility which will need to be investigated.

@alan-agius4
Copy link
Contributor Author

The failure is related to the emit helpers typescript bug microsoft/TypeScript#38501

In components TS 3.9 PR, they get around this by using importHelpers. So we either need to wait for that PR to land, or cheer-pick the importHelpers change.

@IgorMinar
Copy link
Contributor

@alan-agius4 what would the cherry-pick look like? what is this importHelpers change? And also does this mean that we'll see similar issues in the Angular ecosystem?

@alan-agius4
Copy link
Contributor Author

alan-agius4 commented May 16, 2020

The importHelpers change is this one: angular/components#19336 (comment), Ie: setting "importHelpers": true in the compilerOptions

The emitted helpers causes a runtime error in UMDs. I don’t see any reason why this could impact the Angular eco system for a couple of reasons.

  1. Applications should be using ES2015+ as a module and not UMD.
  2. In Angular CLI we always configure workspaces to use TypeScript helpers (tslib) vis importHelpers compiler option, as opposed to inlined/emitted helpers to reduce the final bundle size. This is because otherwise typescript will inline the required helpers in each file that requires it instead of importing from tslib, which would result in multiple identical copies of the same helper in the final bundle.
  3. When building the library in UMD, we do embed helpers, this is however done via Rollup and not TypeScript, for the same reason as above.

Side note: this issue will be solved in TS 3.9.3 via microsoft/TypeScript#38502

@IgorMinar
Copy link
Contributor

Awesome. Thank you @alan-agius4!

However I'm still confused about why is the CI job failing and what do we need to do to make it green?

Waiting for 3.9.3 is one option, but is there another option that would allow us to merge this PR sooner?

@alan-agius4
Copy link
Contributor Author

@IgorMinar, the CI is failing because we are cloning the material repo and run a number of tests. But their testing setup in master doesn’t yet work with TS3.9 and exposes the TS helper bug, which was worked-around by using importHelpers https://github.com/angular/components/pull/19336/files#diff-58385c517f2bdbfc43246daac79ba239R7. The previous SHA was using TypeScript 3.8, but we can now this can longer use it, because the FW doesn't support TS 3.8 with this PR.

The components team seem to be holding off their TS 3.9 PR (angular/components#19336) because there is no Angular versions that supports TS 3.9 on NPM yet. Following a convo with @kara, she mentioned that a release that supports both TS3.8 and TS 3.9 will be cut on Monday.

Fortunately, there are a number of options that we can go with to merged without a TS release.

Option 1:

  • Monday FW releases a version that supports 3.9
  • Update build: ensure build uses typescript 3.9 components#19336 with the latest FW next version.
  • When merged update SHA which should make this PR ready to get merged.
  • Try to do all of the above before Wednesday morning PST, so this PR is in Wednesday release.

Option 2:

Option 3

  • Create a PR that changes the importHelpers option in the material repo. (I am assuming that the tests will past after this change and there are further changes required in the material repo)
  • Once merged update tests SHA
  • Merge this PR after Monday’s release/Tuesday morning.

Option 4

  • Worst case as suggested by @devversion, temporary disable these tests.

Option 5

Note: whichever option we go for we always need this to land after the release on Monday, because to finish TS 3.9 support in the CLI we need a release a version that supports both because the current version of NGCC on NPM doesn't work with TS 3.9, thus the CLI TS 3.9 CI is red.

In a nutshell the problem here is, FW release is blocking CLI and Components from updating to TS 3.9. And FW is blocked from removing TS 3.8 support because the components repo doesn't yet work on TS 3.9. Moving everything into one repo is the ultimate goal, and would resolve issues like this.

@IgorMinar
Copy link
Contributor

Aha! I see. I made in incorrect assumption that components repo was already on 3.9 because I saw them merge the PR but I see that that PR didn't work so we are fixing that but now that is blocked on FW.

I suggest we:

  • disable the test + release FW
  • merge the Components PR + release
  • reenable the FW test
  • make all the changes we need in the CLI repo.

Some properties in the DOM lib interface `CSSStyleDeclaration` are not assignable such as `getPropertyPriority` and `getPropertyValue`. With this change we filter out properties which type is not `string` to fix the below error;

```ts
ERROR in src/app/layout/doc-viewer/doc-viewer.component.ts:202:43 - error TS2322: Type 'string' is not assignable to type 'string & ((property: string) => string) & ((property: string) => string) & ((index: number) => string) & ((property: string) => string) & ((property: string, value: string | null, priority?: string | undefined) => void)'.
  Type 'string' is not assignable to type '(property: string) => string'.

202               ? this.void$.pipe(tap(() => elem.style[prop] = to))
                                              ~~~~~~~~~~~~~~~~
```
Some tests currently fail with a TS error
```
TS2783: 'id' is specified more than once, so this usage will be overwritten.
```

This changes fixes that.
'components-repo-unit-tests'  CI job has been temporary disabled until the Components team support building and testing their repo with TypeScript 3.9. The TS 3.9 update is being done in angular/components#19336. Once this gets merged we should re-enable this CI job.

More context on why this had to be disabled can be found: #37129 (comment)
@alan-agius4 alan-agius4 removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: merge The PR is ready for merge by the caretaker labels May 18, 2020
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@kara kara added the action: merge The PR is ready for merge by the caretaker label May 18, 2020
@kara kara closed this in 6466fb2 May 18, 2020
kara pushed a commit that referenced this pull request May 18, 2020
Some properties in the DOM lib interface `CSSStyleDeclaration` are not assignable such as `getPropertyPriority` and `getPropertyValue`. With this change we filter out properties which type is not `string` to fix the below error;

```ts
ERROR in src/app/layout/doc-viewer/doc-viewer.component.ts:202:43 - error TS2322: Type 'string' is not assignable to type 'string & ((property: string) => string) & ((property: string) => string) & ((index: number) => string) & ((property: string) => string) & ((property: string, value: string | null, priority?: string | undefined) => void)'.
  Type 'string' is not assignable to type '(property: string) => string'.

202               ? this.void$.pipe(tap(() => elem.style[prop] = to))
                                              ~~~~~~~~~~~~~~~~
```

PR Close #37129
kara pushed a commit that referenced this pull request May 18, 2020
Some tests currently fail with a TS error
```
TS2783: 'id' is specified more than once, so this usage will be overwritten.
```

This changes fixes that.

PR Close #37129
kara pushed a commit that referenced this pull request May 18, 2020
'components-repo-unit-tests'  CI job has been temporary disabled until the Components team support building and testing their repo with TypeScript 3.9. The TS 3.9 update is being done in angular/components#19336. Once this gets merged we should re-enable this CI job.

More context on why this had to be disabled can be found: #37129 (comment)

PR Close #37129
@alan-agius4 alan-agius4 deleted the drop-ts3.8-support branch May 18, 2020 16:58
@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 Jun 18, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
With this change we drop support for TypeScript 3.8 and remove all related tests.

BREAKING CHANGE:

TypeScript 3.8 is no longer supported, please update to TypeScript 3.9.

PR Close angular#37129
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
Some properties in the DOM lib interface `CSSStyleDeclaration` are not assignable such as `getPropertyPriority` and `getPropertyValue`. With this change we filter out properties which type is not `string` to fix the below error;

```ts
ERROR in src/app/layout/doc-viewer/doc-viewer.component.ts:202:43 - error TS2322: Type 'string' is not assignable to type 'string & ((property: string) => string) & ((property: string) => string) & ((index: number) => string) & ((property: string) => string) & ((property: string, value: string | null, priority?: string | undefined) => void)'.
  Type 'string' is not assignable to type '(property: string) => string'.

202               ? this.void$.pipe(tap(() => elem.style[prop] = to))
                                              ~~~~~~~~~~~~~~~~
```

PR Close angular#37129
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
Some tests currently fail with a TS error
```
TS2783: 'id' is specified more than once, so this usage will be overwritten.
```

This changes fixes that.

PR Close angular#37129
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
'components-repo-unit-tests'  CI job has been temporary disabled until the Components team support building and testing their repo with TypeScript 3.9. The TS 3.9 update is being done in angular/components#19336. Once this gets merged we should re-enable this CI job.

More context on why this had to be disabled can be found: angular#37129 (comment)

PR Close angular#37129
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: packaging Issues related to Angular's creation of npm packages breaking changes 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.

7 participants