Skip to content

Use native private members in Heft - #5942

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

Use native private members in Heft#5942
Bharat Middha (bmiddha) wants to merge 5 commits into
mainfrom
bmiddha/native-private-fields-heft

Conversation

@bmiddha

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

Copy link
Copy Markdown
Member

Summary

  • convert TypeScript-private fields, methods, and accessors in @rushstack/heft to ECMAScript #private members
  • replace private-member destructuring with direct private access
  • keep package behavior and public APIs unchanged

Validation

  • rush build --to heft
  • rush test --only heft (9 tests)

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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
Convert private instance methods and get/set accessors in apps/heft
to ECMAScript # private syntax, complementing the earlier private
field conversion on this branch. Symbol-aware analysis reported 41
eligible members across 17 files with 0 skipped (private constructors
are correctly excluded since they have no valid #private syntax).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
The decoupled ESLint plugin does not recognize native private methods, causing no-new-null to report false positives.

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 Heft Use native private members in Heft 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-heft
@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 Heft internals from TypeScript-only privacy to native ECMAScript #private members without changing public APIs.

Changes:

  • Converts private fields, accessors, and methods to native private members.
  • Updates all internal references and cross-instance access.
  • Retains a temporary targeted ESLint suppression for null parameters.

Reviewed changes

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

Show a summary per file
File Description
apps/heft/src/utilities/WatchFileSystemAdapter.ts Migrates watcher state to native privacy.
apps/heft/src/utilities/GitUtilities.ts Migrates Git state and helpers.
apps/heft/src/plugins/RunScriptPlugin.ts Privatizes the script runner.
apps/heft/src/plugins/NodeServicePlugin.ts Migrates process state and helpers.
apps/heft/src/pluginFramework/StaticFileSystemAdapter.ts Privatizes virtual filesystem internals.
apps/heft/src/pluginFramework/logging/ScopedLogger.ts Migrates logger state and accessor.
apps/heft/src/pluginFramework/logging/LoggingManager.ts Migrates logging-manager state.
apps/heft/src/pluginFramework/InternalHeftSession.ts Migrates session caches and initialization.
apps/heft/src/pluginFramework/HeftTaskSession.ts Privatizes task-session state.
apps/heft/src/pluginFramework/HeftTask.ts Migrates task state and helpers.
apps/heft/src/pluginFramework/HeftPluginHost.ts Privatizes plugin-host bookkeeping.
apps/heft/src/pluginFramework/HeftPhaseSession.ts Migrates phase-session state.
apps/heft/src/pluginFramework/HeftPhase.ts Migrates phase state and helpers.
apps/heft/src/pluginFramework/HeftParameterManager.ts Migrates parameter caches and helpers.
apps/heft/src/pluginFramework/HeftLifecycleSession.ts Privatizes lifecycle-session state.
apps/heft/src/pluginFramework/HeftLifecycle.ts Migrates lifecycle state and loading.
apps/heft/src/operations/runners/TaskOperationRunner.ts Privatizes task-runner state.
apps/heft/src/operations/runners/PhaseOperationRunner.ts Privatizes phase-runner state.
apps/heft/src/metrics/MetricsCollector.ts Migrates timing state and direct reads.
apps/heft/src/configuration/RigPackageResolver.ts Migrates resolver state and helper.
apps/heft/src/configuration/HeftPluginDefinition.ts Privatizes plugin-definition internals.
apps/heft/src/configuration/HeftPluginConfiguration.ts Migrates definition caches and helpers.
apps/heft/src/configuration/HeftConfiguration.ts Migrates configuration caches and loader.
apps/heft/src/cli/HeftCommandLineParser.ts Migrates parser state and helpers.
apps/heft/src/cli/HeftActionRunner.ts Migrates action-runner state and helpers.
apps/heft/src/cli/actions/RunAction.ts Privatizes run-action state.
apps/heft/src/cli/actions/PhaseAction.ts Privatizes phase-action state.
apps/heft/src/cli/actions/CleanAction.ts Migrates clean-action state and helper.
apps/heft/src/cli/actions/AliasAction.ts Privatizes alias-action state.

💡 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