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

chore(deps): Bump typescript from 5.2.2 to 5.3.3 #7713

Closed

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 11, 2023

Bumps typescript from 5.2.2 to 5.3.3.

Release notes

Sourced from typescript's releases.

TypeScript 5.3.3

For release notes, check out the release announcement.

For the complete list of fixed issues, check out the

Downloads are available on:

TypeScript 5.3

For release notes, check out the release announcement.

For the complete list of fixed issues, check out the

Downloads are available on:

TypeScript 5.3 RC

For release notes, check out the release announcement.

For the complete list of fixed issues, check out the

Downloads are available on:

TypeScript 5.3 Beta

For release notes, check out the release announcement.

For the complete list of fixed issues, check out the

Downloads are available on npm.

Commits

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot requested a review from a team as a code owner December 11, 2023 09:49
@dependabot dependabot bot requested a review from NeilFraser December 11, 2023 09:49
@dependabot dependabot bot added PR: chore General chores (dependencies, typos, etc) PR: dependencies Pull requests that update a dependency file labels Dec 11, 2023
@github-actions github-actions bot added PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) labels Dec 11, 2023
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/develop/typescript-5.3.3 branch from e46c079 to 85569f1 Compare December 11, 2023 15:24
@github-actions github-actions bot added PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) labels Dec 11, 2023
@github-actions github-actions bot added PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) labels Jan 4, 2024
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.2.2 to 5.3.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v5.2.2...v5.3.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/develop/typescript-5.3.3 branch from 85569f1 to 8c57545 Compare January 4, 2024 19:31
@github-actions github-actions bot added PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) labels Jan 4, 2024
@cpcallen
Copy link
Contributor

Seems type checking has gotten slightly more strict causing build failures. In particular, the issue is that FieldDropdown is not assignable to Field<string | undefined>, because it's .validator_ is a FieldValidator<string> instead of a FieldValidator<string | undefined>, and this causes an error whenever we try to .appendField() a FieldDropdown:

blocks/lists.ts:413:20 - error TS2345: Argument of type 'FieldDropdown' is not assignable to parameter of type 'string | Field<string | undefined>'.
  Type 'FieldDropdown' is not assignable to type 'Field<string | undefined>'.
    Types of property 'validator_' are incompatible.
      Type 'FieldValidator<string> | null' is not assignable to type 'FieldValidator<string | undefined> | null'.

413       .appendField(modeMenu, 'MODE')
                       ~~~~~~~~

And yeah: it'd be bad to call a FieldDropdown's validator and pass it undefined, because they are declared strictly to accept strings—but the question is why does tsc think that .appendField wants a Field<string | undefined> here, since it's defined in core/inputs/input.ts as:

  appendField<T>(field: string | Field<T>, opt_name?: string): Input {
    this.insertFieldAt(this.fieldRow.length, field, opt_name);
    return this;
  }

(Aside: this declaration got the <T> added in #6603, but for some reason the generic type T appears only once in the definition of appedField, seemingly in violation of the golden rule of generics.)

It seems that .appendField should accept any kind of Field, not just a Field<string | undefined>.

@cpcallen
Copy link
Contributor

I notice that there are actually two additional errors not caused by .appendField calls but which instead occur within FieldDropdown itself:

core/field_dropdown.ts:286:39 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'Field<string | undefined>'.
  Type 'FieldDropdown' is not assignable to type 'Field<string | undefined>'.
    Types of property 'validator_' are incompatible.
      Type 'FieldValidator<string> | null' is not assignable to type 'FieldValidator<string | undefined> | null'.
        Type 'FieldValidator<string>' is not assignable to type 'FieldValidator<string | undefined>'.
          Types of parameters 'newValue' and 'newValue' are incompatible.
            Type 'string | undefined' is not assignable to type 'string'.
              Type 'undefined' is not assignable to type 'string'.

286     dropDownDiv.showPositionedByField(this, this.dropdownDispose_.bind(this));
                                          ~~~~

core/field_dropdown.ts:360:29 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'Field<string | undefined>'.

360     dropDownDiv.hideIfOwner(this, true);
                                ~~~~

This sort of makes it look like tsc thinks FieldDropdown is simultaneously both a Field<string> (as declared) and a Field<string | undefined> (presumably by inference), and therefor incompatible with itself.

@maribethb
Copy link
Contributor

when we do this bump, we should also update @microsoft/api-extractor and documenter to their latest versions as well. We can't update api-extractor right now because the new one uses ts 5.3 which we have problems with right at the moment.

@btw17
Copy link
Member

btw17 commented Feb 23, 2024

I notice that there are actually two additional errors not caused by .appendField calls but which instead occur within FieldDropdown itself:

core/field_dropdown.ts:286:39 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'Field<string | undefined>'.
  Type 'FieldDropdown' is not assignable to type 'Field<string | undefined>'.
    Types of property 'validator_' are incompatible.
      Type 'FieldValidator<string> | null' is not assignable to type 'FieldValidator<string | undefined> | null'.
        Type 'FieldValidator<string>' is not assignable to type 'FieldValidator<string | undefined>'.
          Types of parameters 'newValue' and 'newValue' are incompatible.
            Type 'string | undefined' is not assignable to type 'string'.
              Type 'undefined' is not assignable to type 'string'.

286     dropDownDiv.showPositionedByField(this, this.dropdownDispose_.bind(this));
                                          ~~~~

core/field_dropdown.ts:360:29 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'Field<string | undefined>'.

360     dropDownDiv.hideIfOwner(this, true);
                                ~~~~

This sort of makes it look like tsc thinks FieldDropdown is simultaneously both a Field<string> (as declared) and a Field<string | undefined> (presumably by inference), and therefor incompatible with itself.

This certainly seems to be an inference problem. A quick update that fixes this is to manually provide the type instead of inferring it. For example:

// dropDownDiv.hideIfOwner(this, true);
dropDownDiv.hideIfOwner<string>(this, true);

This should work for appendField, dropDownDiv.showPositionedByField, and likely any other case where you're seeing the |undefined problem.

It still doesn't explain why typescript is seeing this (a FieldDropdown which extends Field<string>) and infers Field<string|undefined>, which is then not compatible with itself.

Copy link
Contributor Author

dependabot bot commented on behalf of github Mar 11, 2024

Superseded by #7921.

@dependabot dependabot bot closed this Mar 11, 2024
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/develop/typescript-5.3.3 branch March 11, 2024 09:28
@btw17
Copy link
Member

btw17 commented Mar 15, 2024

Found the cause of the issue. It's tied to doClassValidation_ and how its implementation leads to the inference assuming type Field<string|undefined> instead of Field<string>.

See the fix here: #7939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: chore General chores (dependencies, typos, etc) PR: dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants