microsoft / microsoft/TypeScript

Some Playwright types now reported as `any` after upgrading to 5.7.2

Offen
#60,619 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Domain: check: Type Inference Help Wanted Possible Improvement
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

🔎 Search Terms

I manually scrolled through all issues reported since the release of 5.7.2.

🕗 Version & Regression Information
  • This changed between versions 5.6.3 and 5.7.2
⏯ Playground Link

https://github.com/mrmckeb/pw-repro

💻 Code

Minimal repro available here:
https://github.com/mrmckeb/pw-repro

The Playwright team are also able to reproduce:
https://github.com/microsoft/playwright/issues/33763

The affected code (from the repro) is:

import { test as base, expect } from "@playwright/test";

const test = base.extend({
  // baseUrl, page, use are now `any`
  page: async ({ baseURL, page }, use) => {
    await page.goto(baseURL);
    await use(page);
  },
});
🙁 Actual behavior

Types that were previously available are now typed as any. JSDoc continues to work as expected.

🙂 Expected behavior

Types behave as they did in TypeScript 5.6.3.

Additional information about the issue

We found this issue when upgrading from 5.6.3 to 5.7.2. I couldn't find a related issue here, so raised it at the Playwright repo to at least verify that they could reproduce and that they didn't think it was an issue with their types.

The Playwright team also confirmed that they have 71 new errors across 41 files when moving to TypeScript 5.7.2.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der minimalen Reproduktion im verlinkten pw-repro-Repository und vergleiche sein Verhalten unter TypeScript 5.6.3 und 5.7.2. Verwende den betroffenen Playwright-Erweiterungscode als fokussierten Fall und ziehe anschließend das verlinkte Playwright-Issue sowie das Regressionsverhalten von TypeScript zu Rate. Als erledigt gilt die Aufgabe, wenn die betroffenen Werte nicht mehr als any gemeldet werden und die Type-Checking-Fehler in 5.7.2 behoben sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
compilers
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.