What is the current state of private fields in ES6 classes?

This page summarizes the projects mentioned and recommended in the original post on /r/learnjavascript

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • proposal-private-methods

    Discontinued Private methods and getter/setters for ES6 classes

  • Ah you're right. Looks like private methods are in 'stage 3' of proposal, whatever that means: https://github.com/tc39/proposal-private-methods

  • proposals

    Tracking ECMAScript Proposals

  • Current status of proposals

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • proposal-class-fields

    Discontinued Orthogonally-informed combination of public and private fields proposals

  • Class Public Instance Fields & Private Instance Fields

  • proposal-static-class-features

    Discontinued The static parts of new class features, in a separate proposal

  • Static class fields and private static methods

  • proposal-private-fields-in-in

    Discontinued EcmaScript proposal to provide brand checks without exceptions

  • Ergonomic brand checks for Private Fields

  • proposal-private-declarations

    A proposal to allow trusted code _outside_ of the class lexical scope to access private state

  • There one or two additional addon specs like Private Declarations, but the other private specs are not dependent on this. I believe, and I haven't been keeping up with them as much lately (they've been hanging at stage 3 for sooo long), that brand checks was something they wanted to have ready before the rest going out.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts