Skip to content

Google's feedback for TypeScript 5.3 Beta #56053

Closed
@h-joo

Description

@h-joo

Acknowledgement

  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

This GitHub issue contains feedback on the TS 5.3 Beta release from the team
that is responsible for keeping Google's internal software working with the
latest version of TypeScript.

Executive summary

  • We do not expect to have significant difficulty in upgrading Google to TS 5.3.
  • Some changes to our TypeScript code are required to make it compile with TS 5.3.
  • Detail sections below explain the changes to our code we expect to make to unblock the upgrade.

Impact summary

Change description Announced Libraries affected
lib/d.ts changes yes 0.003%
Warning about duplicate keys in object literals (TS1117) no 0.006%

The Announced column indicates whether we were able to connect the observed change with a section in the TS 5.3 Beta announcement.

The following sections give more detailed explanations of the changes listed above.

We expect to fix our codebase mostly by adding // @ts-ignore to silence the errors and apply proper fixes over time.

Changes which were announced

lib/d.ts Changes

We support the typing improvements. It required minimal changes and generally
it's clear what's changing.

Changes which were not announced

TS1117: An object literal cannot have multiple properties with the same name

This seems to be a nice improvement, which discovered some bugs in our codebase.

Other changes

We also observed some breakages in our tooling caused by internal compiler API changes. In particular, the internal API getResolvedModule was accessible via ts.getResolvedModule, but now is accessible via ts.Program.getResolvedModule. We will migrate to the new internal API to move forward.

A request to include emit changes in the regular upgrade announcements

We'd like to ask if along with the regular TypeScript upgrade announcements, if it's possible to include changes of the emit behavior.

This feedback is not for the current upgrade, but rather for the past. We've noticed in the past two upgrades (5.1 and 5.2) that there were some changes in the emit behavior of TSC, only after we sent feedback for the beta version.

Emit changes usually takes more time for us because:

  • We discover these changes only after fixing most new TypeScript diagnostics,
    which is too late to include in the beta feedback.
  • It takes us time to attribute test breakages to the specific emit change. We
    want to do that to ensure we produce correct fixes.

Recent examples of emit changes were :

We have two build tools that are in our pipeline that are affected by the emit changes, one is the closure compiler to minimize JS and the other is tsickle to transpile TS type annotation to closure annotation which is very susceptible to changes in the emit behavior.

For that reason, we'd like to ask if along with the regular announcement, if it's possible to include changes in the emit behavior. I feel that this might not be that relevant for other people, but we've lately seen many of the emit changes, which we would have benefited a lot if we would have known this in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DiscussionIssues which may not have code impact

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions