Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[node-core-library] Replace static classes with exported module namespace objects

Offen
#5,434 0 Kommentare 1 Reaktion 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

Summary

While preserving the implementations and outward-facing API shape (All consumers of the refactored APIs should not need any code changes to compile and test successfully), replace static classes like:

./FileSystem.ts
export class FileSystem {
  public static someApi(...): TResult { ... }
}

with a reexported module namespace object that forwards individual exports for single files:

./FileSystem.ts
import * as FileSystem from './fileSystem/index';
./fileSystem/index.ts
export { someApi } from './someApi';
./fileSystem/someApi.ts
export function someApi(...): TResult { ... }

The Disposables and Objects APIs are existing examples of the new pattern. FileSystem and Text are examples of the old pattern to be replaced.

The reason for this conversion is that module namespace objects can be tree-shaken by modern bundlers, but static members on classes cannot.

Vorherrschende Sprache
TypeScript
Sterne
6.5k
Forks
708
Ø Merge
4 T. 7 Std.
Gemergte PRs (30 T.)
61

Entwicklungsumgebung

Die Einrichtungsdateien dieses Projekts haben wir noch nicht geprüft. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/rushstack

Alle Issues in microsoft/rushstack

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

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