Skip to content

Use native private members in core tooling - #5943

Open
Bharat Middha (bmiddha) wants to merge 5 commits into
mainfrom
bmiddha/native-private-fields-core-api
Open

Use native private members in core tooling#5943
Bharat Middha (bmiddha) wants to merge 5 commits into
mainfrom
bmiddha/native-private-fields-core-api

Conversation

@bmiddha

@bmiddha Bharat Middha (bmiddha) commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary

  • convert TypeScript-private fields, methods, and accessors across API Extractor, API Documenter, and core shared libraries to ECMAScript #private members
  • replace private-member destructuring with direct private access
  • retain node-core-library TypeScript-private members whose rolled-up declarations are consumed by ES5-target fixtures, where native private declarations fail with TS18028
  • keep package behavior and public APIs unchanged

Validation

  • built the full affected dependency graph, including about 187 downstream projects
  • tested all 15 affected packages with test suites

Dependency

Stacked on #5947, which fixes @rushstack/no-new-null handling for ECMAScript private members. Narrow suppressions remain because these packages consume the released decoupled plugin; they can be removed after the patched plugin is published and adopted.

Convert TS private class property declarations to native #private
fields across api-extractor, api-documenter, and core libraries,
stripping the conventional leading underscore. Excludes
node-core-library: its bundled rollup .d.ts is consumed by ES5-target
build-test fixtures, and #private syntax anywhere in that file breaks
their typecheck (TS18028).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
Convert TypeScript private method and getter/setter declarations to
native #private syntax across api-documenter, api-extractor,
api-extractor-model, credential-cache, debug-certificate-manager,
heft-config-file, lookup-by-path, npm-check-fork, operation-graph,
package-extractor, stream-collator, terminal, ts-command-line,
typings-generator, worker-pool, and doc-plugin-rush-stack, stripping
the conventional leading underscore. Extends the prior #private field
conversion to methods and accessors using the same symbol-aware tool.

Adds an eslint-disable-next-line @rushstack/no-new-null suppression to
SourceMapper#getSourceMap, matching the existing suppression on its
sibling private field, since converting the method to native #private
syntax exposed it to the same decoupled-lint-rule gap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
@bmiddha Bharat Middha (bmiddha) changed the title Use native private fields in core tooling Use native private members in core tooling Aug 20, 2026
Treat PrivateIdentifier class keys like TypeScript private members so no-new-null does not report private API types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
…rivate' into bmiddha/native-private-fields-core-api
@bmiddha
Bharat Middha (bmiddha) changed the base branch from main to bmiddha/fix-no-new-null-native-private August 20, 2026 06:05
@mojaza
Mo Jazayeri (mojaza) requested a balanced review from Copilot August 21, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates internal TypeScript-private members to native ECMAScript #private members without changing public APIs or behavior.

Changes:

  • Converts private fields, methods, and accessors across 15 tooling packages.
  • Replaces private-member destructuring with direct access.
  • Adds narrow ESLint suppressions pending the dependency update.

Reviewed changes

Copilot reviewed 111 out of 111 changed files in this pull request and generated no comments.

Show a summary per file
File Description
repo-scripts/doc-plugin-rush-stack/src/RushStackFeature.ts Migrates navigation state and helper.
libraries/ts-command-line/src/test/test-cli/WidgetCommandLine.ts Migrates test CLI state.
libraries/ts-command-line/src/test/test-cli/RunAction.ts Migrates test action state.
libraries/ts-command-line/src/test/test-cli/PushAction.ts Migrates test action parameters.
libraries/ts-command-line/src/test/ScopedCommandLineAction.test.ts Migrates scoped-action test fields.
libraries/ts-command-line/src/test/ConflictingCommandLineParser.test.ts Migrates parser test fields.
libraries/ts-command-line/src/test/CommandLineParser.test.ts Migrates parser test flag.
libraries/ts-command-line/src/test/AliasedCommandLineAction.test.ts Migrates alias test fields.
libraries/ts-command-line/src/providers/TabCompletionAction.ts Migrates completion state and helpers.
libraries/ts-command-line/src/providers/ScopedCommandLineAction.ts Migrates scoped parser internals.
libraries/ts-command-line/src/providers/CommandLineParser.ts Migrates parser internals.
libraries/ts-command-line/src/providers/CommandLineAction.ts Migrates action parser storage.
libraries/ts-command-line/src/providers/AliasCommandLineAction.ts Migrates alias parameter map.
libraries/ts-command-line/src/parameters/CommandLineStringParameter.ts Migrates string value storage.
libraries/ts-command-line/src/parameters/CommandLineStringListParameter.ts Migrates string-list storage.
libraries/ts-command-line/src/parameters/CommandLineRemainder.ts Migrates remainder storage.
libraries/ts-command-line/src/parameters/CommandLineIntegerParameter.ts Migrates integer value storage.
libraries/ts-command-line/src/parameters/CommandLineIntegerListParameter.ts Migrates integer-list storage.
libraries/ts-command-line/src/parameters/CommandLineFlagParameter.ts Migrates flag storage.
libraries/ts-command-line/src/parameters/CommandLineChoiceParameter.ts Migrates choice value storage.
libraries/ts-command-line/src/parameters/CommandLineChoiceListParameter.ts Migrates choice-list storage.
libraries/ts-command-line/src/parameters/BaseClasses.ts Migrates short-name storage.
libraries/tree-pattern/src/TreePattern.ts Migrates stored tree pattern.
libraries/terminal/src/TextRewriterTransform.ts Migrates rewriter state and helpers.
libraries/terminal/src/test/ProblemCollector.test.ts Migrates matcher test regex.
libraries/terminal/src/TerminalWritable.ts Migrates open-state tracking.
libraries/terminal/src/TerminalTable.ts Migrates table state and destructuring.
libraries/terminal/src/TerminalStreamWritable.ts Migrates stream write callback.
libraries/terminal/src/Terminal.ts Migrates providers and write helpers.
libraries/terminal/src/StringBufferTerminalProvider.ts Migrates output buffers.
libraries/terminal/src/StdioSummarizer.ts Migrates summarizer state.
libraries/terminal/src/StdioLineTransform.ts Migrates accumulated-line state.
libraries/terminal/src/SplitterTransform.ts Migrates destination set.
libraries/terminal/src/ProblemCollector.ts Migrates matcher and problem state.
libraries/terminal/src/PrefixProxyTerminalProvider.ts Migrates prefix-provider state.
libraries/terminal/src/DiscardStdoutTransform.ts Migrates transform state.
libraries/terminal/src/CallbackWritable.ts Migrates callback storage.
libraries/stream-collator/src/StreamCollator.ts Migrates collator state and helpers.
libraries/stream-collator/src/CollatedWriter.ts Migrates writer internals.
libraries/stream-collator/src/CollatedTerminal.ts Migrates destination storage.
libraries/rig-package/src/RigConfig.ts Migrates resolved-path caches.
libraries/package-extractor/src/SymlinkAnalyzer.ts Migrates analysis caches.
libraries/package-extractor/src/scripts/createLinks/cli/CreateLinksCommandLineParser.ts Migrates CLI terminal storage.
libraries/package-extractor/src/scripts/createLinks/cli/actions/RemoveLinksAction.ts Migrates action terminal storage.
libraries/package-extractor/src/scripts/createLinks/cli/actions/CreateLinksAction.ts Migrates action state.
libraries/package-extractor/src/PackageExtractor.ts Migrates extraction helpers.
libraries/package-extractor/src/AssetHandler.ts Migrates asset state and helper.
libraries/package-extractor/src/ArchiveManager.ts Migrates archive storage.
libraries/operation-graph/src/WorkQueue.ts Migrates queue and signal state.
libraries/operation-graph/src/WatchLoop.ts Migrates watch-loop state and helpers.
libraries/operation-graph/src/Stopwatch.ts Migrates timing state.
libraries/operation-graph/src/OperationGroupRecord.ts Migrates group execution state.
libraries/operation-graph/src/OperationExecutionManager.ts Migrates manager state.
libraries/operation-graph/src/Operation.ts Migrates execution state and helper.
libraries/npm-check-fork/src/NpmRegistryClient.ts Migrates registry configuration.
libraries/module-minifier/src/WorkerPoolMinifier.ts Migrates worker-pool state.
libraries/module-minifier/src/MessagePortMinifier.ts Migrates callback map.
libraries/module-minifier/src/LocalMinifier.ts Migrates local minifier state.
libraries/heft-config-file/src/ProjectConfigurationFile.ts Migrates path and rig helpers.
libraries/debug-certificate-manager/src/CertificateStore.ts Migrates certificate paths and caches.
libraries/debug-certificate-manager/src/CertificateManager.ts Migrates certificate helpers.
libraries/credential-cache/src/CredentialCache.ts Migrates cache state and validation.
libraries/api-extractor-model/src/model/TypeParameter.ts Migrates parent storage.
libraries/api-extractor-model/src/model/SourceLocation.ts Migrates URL components.
libraries/api-extractor-model/src/model/Parameter.ts Migrates parent storage.
libraries/api-extractor-model/src/model/ModelReferenceResolver.ts Migrates resolver state and helpers.
libraries/api-extractor-model/src/model/ApiPackage.ts Migrates package configuration state.
libraries/api-extractor-model/src/model/ApiModel.ts Migrates resolver and lookup caches.
libraries/api-extractor-model/src/model/ApiInterface.ts Migrates inherited-interface storage.
libraries/api-extractor-model/src/model/ApiClass.ts Migrates implemented-interface storage.
libraries/api-extractor-model/src/mixins/Excerpt.ts Migrates token and text state.
libraries/api-extractor-model/src/items/ApiItem.ts Migrates parent and reference caches.
libraries/api-extractor-model/src/items/ApiDocumentedItem.ts Migrates TSDoc storage.
libraries/api-extractor-model/src/items/ApiDeclaredItem.ts Migrates excerpt and location state.
apps/api-extractor/src/collector/SourceMapper.ts Migrates source-map caches with suppressions.
apps/api-extractor/src/collector/CollectorEntity.ts Migrates export metadata state.
apps/api-extractor/src/cli/RunAction.ts Migrates CLI parameters.
apps/api-extractor/src/cli/ApiExtractorCommandLine.ts Migrates debug state and helper.
apps/api-extractor/src/api/ExtractorMessage.ts Migrates message state.
apps/api-extractor/src/api/ExtractorConfig.ts Migrates report lookup helper.
apps/api-extractor/src/analyzer/PackageMetadataManager.ts Migrates metadata caches.
apps/api-extractor/src/analyzer/AstSymbol.ts Migrates symbol analysis state.
apps/api-extractor/src/analyzer/AstDeclaration.ts Migrates declaration analysis state.
apps/api-documenter/src/plugin/MarkdownDocumenterAccessor.ts Migrates implementation storage.
apps/api-documenter/src/nodes/DocTableRow.ts Migrates table-cell storage.
apps/api-documenter/src/nodes/DocTable.ts Migrates table-row storage.
apps/api-documenter/src/markdown/CustomMarkdownEmitter.ts Migrates model storage.
apps/api-documenter/src/documenters/OfficeYamlDocumenter.ts Migrates Office documenter state.
apps/api-documenter/src/documenters/ExperimentalYamlDocumenter.ts Migrates TOC state and helpers.
apps/api-documenter/src/cli/YamlAction.ts Migrates YAML CLI parameters.
apps/api-documenter/src/cli/BaseAction.ts Migrates shared parameters and helpers.
apps/api-documenter/src/cli/ApiDocumenterCommandLine.ts Migrates action-population helper.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Base automatically changed from bmiddha/fix-no-new-null-native-private to main August 21, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

2 participants