proposal-private-methods
Private methods and getter/setters for ES6 classes (by tc39)
proposal-static-class-features
The static parts of new class features, in a separate proposal (by tc39)
Our great sponsors
proposal-private-methods | proposal-static-class-features | |
---|---|---|
8 | 3 | |
344 | 130 | |
- | - | |
2.7 | 0.8 | |
over 2 years ago | over 2 years ago | |
HTML | HTML | |
- | - |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proposal-private-methods
Posts with mentions or reviews of proposal-private-methods.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-04-22.
-
10 Must-Know Patterns for Writing Clean Code with React and TypeScript✨🛀
But with the new ECMAScript class fields proposal we can do this easily and gracefully by using private fields as seen below:
-
Updates from 82nd meeting of TC39
Private instance methods and accessors Class Public Instance Fields & Private Instance Fields Static class fields and private static methods
-
JavaScript Records and Tuples Proposal is in ECMAScript stage 2
Don't forget that abomination of syntax which is https://github.com/tc39/proposal-private-methods
-
log
This is not currently true. But there are proposals, currently in stage 3 for allowing this.
-
What is the current state of private fields in ES6 classes?
Private instance methods and accessors
-
New to JS : Can constructors/methods have private functions?
There is a proposal for private methods but its not yet standard. However, they are currently supported in chromium browsers and in firefox after enabling a flag. These, however, only work using the class syntax, not in constructor functions like that used in your example.
proposal-static-class-features
Posts with mentions or reviews of proposal-static-class-features.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-04-01.
-
Tree shaking for JavaScript library authors
I’ll illustrate, what I mean, with a simple class having a static field. (Static class fields will become an official part of the language with the upcoming ES2021 specification, but they are already widely used by developers.)
-
log
This is not currently true. But there are proposals, currently in stage 3 for allowing this.
-
What is the current state of private fields in ES6 classes?
Static class fields and private static methods
What are some alternatives?
When comparing proposal-private-methods and proposal-static-class-features you can also consider the following projects:
proposal-class-fields - Orthogonally-informed combination of public and private fields proposals
proposal-private-declarations - A proposal to allow trusted code _outside_ of the class lexical scope to access private state
proposal-symbols-as-weakmap-keys - Permit Symbols as keys in WeakMaps, entries in WeakSets and WeakRefs, and registered in FinalizationRegistries
proposals - Tracking ECMAScript Proposals
proposal-private-fields-in-in - EcmaScript proposal to provide brand checks without exceptions
proposal-record-tuple - ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change!
proposal-private-methods vs proposal-class-fields
proposal-static-class-features vs proposal-private-declarations
proposal-private-methods vs proposal-symbols-as-weakmap-keys
proposal-static-class-features vs proposal-class-fields
proposal-private-methods vs proposals
proposal-private-methods vs proposal-private-fields-in-in
proposal-private-methods vs proposal-record-tuple