[node-core-library] Replace static classes with exported module namespace objects
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
Description
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.
- Dominant language
- TypeScript
- Stars
- 6.5k
- Forks
- 708
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 62
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/rushstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in microsoft/rushstack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
IBM/node-sdk-core#373 ·
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 88/100