Migrate TypeScript `private` members to ECMAScript `#` private fields
#1,845 opened on Jun 18, 2026
Repository metrics
- Stars
- (456 stars)
- PR merge metrics
- (Avg merge 3d 9h) (41 merged PRs in 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.ts—private _activeSchemapackages/graph-explorer/src/utils/rdf/PrefixLookup.ts—private readonly userMap,private readonly inferredMap,private constructorpackages/graph-explorer/src/connector/LoggerConnector.ts—private 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 asprivate, or address the singleton pattern separately.readonlycan't be combined with#fields in TypeScript. Migratingprivate readonly→#loses the compile-time readonly guarantee. Decide per-field whether runtime privacy outweighs losingreadonly, or leave those asprivate readonly.- Constructor parameter properties (
constructor(private x …)) have no#shorthand and would need a manual field + assignment.
Acceptance criteria
-
private/protectedmember declarations migrated to#where a faithful equivalent exists - Fields where
#would losereadonlyor hit the constructor caveats are either left as-is or explicitly converted with the tradeoff noted -
pnpm checksandpnpm testpass
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.