Skip to content

feat: update to TS 2.9 and enable strictFunctionTypes #12182

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

Merged
merged 1 commit into from
Aug 28, 2018

Conversation

crisbeto
Copy link
Member

Bumps the project to TypeScript 2.9, enables the strictFunctionTypes everywhere and fixes the various errors.

Fixes #12177.

@crisbeto crisbeto added the in progress This issue is currently in progress label Jul 12, 2018
@crisbeto crisbeto self-assigned this Jul 12, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 12, 2018
@crisbeto crisbeto force-pushed the ts-2.9 branch 4 times, most recently from 3fe0cdb to 331feee Compare July 14, 2018 13:12
Copy link
Contributor

@amcdnl amcdnl left a comment

Choose a reason for hiding this comment

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

LGTM

// Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed
// back into the zone because matchMedia is only included in Zone.js by loading the
// webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not
// have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js
// patches it.
(listener: MediaQueryListListener) => {
(listener: Function) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there no type more specific than Function that we can use here?

Copy link
Member Author

@crisbeto crisbeto Jul 16, 2018

Choose a reason for hiding this comment

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

I don't think so. The strictFunctionTypes seem to resolve it to Function. A workaround is to have as MediaQueryListener before calling, but that seemed a little ugly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Aright, sg

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jul 16, 2018
@ngbot
Copy link

ngbot bot commented Jul 16, 2018

I see that you just added the pr: merge ready label, but the following checks are still failing:
    failure missing required label: "target: *"
    failure status "ci/circleci: build" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@josephperrott josephperrott removed the action: merge The PR is ready for merge by the caretaker label Jul 16, 2018
@josephperrott
Copy link
Member

@crisbeto Is this still a WIP? If not go ahead and update the title and mark it merge ready again.

@crisbeto
Copy link
Member Author

It is still is, I haven't been able to track down the Bazel issue yet.

@crisbeto crisbeto force-pushed the ts-2.9 branch 3 times, most recently from e467cde to 6fd2afb Compare July 17, 2018 19:17
@crisbeto
Copy link
Member Author

Looks like we're blocked here until angular/angular#24521 is resolved. cc @jelbourn

@ngbot
Copy link

ngbot bot commented Jul 18, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@ngbot
Copy link

ngbot bot commented Jul 24, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@ngbot
Copy link

ngbot bot commented Aug 20, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

2 similar comments
@ngbot
Copy link

ngbot bot commented Aug 20, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@ngbot
Copy link

ngbot bot commented Aug 20, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@ngbot
Copy link

ngbot bot commented Aug 21, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

1 similar comment
@ngbot
Copy link

ngbot bot commented Aug 21, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed in progress This issue is currently in progress labels Aug 27, 2018
@crisbeto crisbeto changed the title wip: update to TS 2.9 and enable strictFunctionTypes feat: update to TS 2.9 and enable strictFunctionTypes Aug 27, 2018
@jelbourn
Copy link
Member

jelbourn commented Aug 27, 2018

@crisbeto getting this:

src/cdk/scrolling/virtual-scroll-viewport.ts:146:15 - error TS2345: Argument of type 'MonoTypeOperatorFunction<void>' is not assignable to parameter of type 'OperatorFunction<Event, void>'.
  Types of parameters 'source' and 'source' are incompatible.
    Type 'Observable<Event>' is not assignable to type 'Observable<void>'.
      Type 'Event' is not assignable to type 'void'.

146               startWith<void>(null!),

Probably new code introduced since your original change?

/** Combined type for a categorized method member document. */
type CategorizedMemberDoc = CategorizedMethodMemberDoc & CategorizedPropertyMemberDoc;
/** Sorts method members by deprecated status, member decorator, and name. */
export function sortCategorizedMethodMembers(docA: CategorizedMethodMemberDoc,
Copy link
Member

@devversion devversion Aug 27, 2018

Choose a reason for hiding this comment

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

Why do we need to duplicate the logic that actually is the same for properties and methods?

Did you run into any issue with the types that we should revisit later?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it's something that started throwing after I enabled the strictFunctionTypes.

@jelbourn
Copy link
Member

@crisbeto I looked at that error w/ Miles and it goes away if we change that line to:

startWith<Event | null>(null),

@crisbeto
Copy link
Member Author

That's odd @jelbourn. I had fixed that error yesterday and I don't get any diff changes or compilation errors locally. Re-pushing to see if that fixes it.

@jelbourn
Copy link
Member

Still failing on that line- it must be something different about Google's internal TS setup

Bumps the project to TypeScript 2.9, enables the `strictFunctionTypes` everywhere and fixes the various errors.

Fixes angular#12177.
@crisbeto
Copy link
Member Author

Could be. I've changed it to Event | null.

@jelbourn jelbourn merged commit d424c70 into angular:master Aug 28, 2018
crisbeto added a commit to crisbeto/material2 that referenced this pull request Aug 30, 2018
Removes a workaround that was initially introduced to get angular#12182 through. The root issue has been resolved in angular#12876.
jelbourn pushed a commit that referenced this pull request Aug 30, 2018
Removes a workaround that was initially introduced to get #12182 through. The root issue has been resolved in #12876.
@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 Sep 9, 2019
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 cla: yes PR author has agreed to Google's Contributor License Agreement target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript version advancement to 2.9.x
7 participants