aws/graph-explorer

Migrate TypeScript `private` members to ECMAScript `#` private fields

Fechada

#1.845 aberto em 18 de jun. de 2026

 (1 comentário) (1 reação) (0 responsável)TypeScript (88 forks)auto 404
good first issuehelp wantedneeds-triagetech debt

Métricas do repositório

Stars
 (456 estrelas)
Métricas de merge de PR
 (Mesclagem média 3d 9h) (41 fundiu PRs em 30d)

Description

Description

Standardize class member privacy on ECMAScript # private fields instead of the TypeScript private keyword. # fields are enforced at runtime by the JS engine (not erased at compile time), aren't enumerable, and can't be reached via bracket access — so the privacy guarantee is real rather than type-check-only.

src/utils/testing/persistence.ts already uses # fields. This issue brings the rest of the codebase in line with that convention.

Scope

Member declarations currently using private (≈7 across 3 files):

  • packages/graph-explorer/src/utils/testing/DbState.tsprivate _activeSchema
  • packages/graph-explorer/src/utils/rdf/PrefixLookup.tsprivate readonly userMap, private readonly inferredMap, private constructor
  • packages/graph-explorer/src/connector/LoggerConnector.tsprivate readonly _baseUrl, private readonly _clientLogger, private _sendLog

Also drop the _ name-prefix convention on members that become # (the # already signals privacy).

Caveats / out of scope

  • private constructor (PrefixLookup.ts) has no # equivalent — JS has no private constructors. Leave it as private, or address the singleton pattern separately.
  • readonly can't be combined with # fields in TypeScript. Migrating private readonly# loses the compile-time readonly guarantee. Decide per-field whether runtime privacy outweighs losing readonly, or leave those as private readonly.
  • Constructor parameter properties (constructor(private x …)) have no # shorthand and would need a manual field + assignment.

Acceptance criteria

  • private/protected member declarations migrated to # where a faithful equivalent exists
  • Fields where # would lose readonly or hit the constructor caveats are either left as-is or explicitly converted with the tradeoff noted
  • pnpm checks and pnpm test pass

Related: #1830

[!IMPORTANT] If you are interested in working on this issue, please leave a comment.

[!TIP] Please use a 👍 reaction to provide a +1/vote. This helps the community and maintainers prioritize this request.

Guia do colaborador