Closed Eskibear closed 5 months ago
Is this private property standard widely adopted by JS libraries? Do we know the usage of old version browsers that do not support it?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties#browser_compatibility It's supported by almost all popular browser/runtimes in 2021. So I don't worry about compatibility.
As for how widely adopted, as far as I can tell there is quite a portion from a yearly survey:
And some repos under Azure org are starting to adopt it after a quick search, e.g. https://github.com/Azure/cadl-ranch/blob/c611311c3d36a3048a3077137cbd4e6be762d034/packages/cadl-ranch-coverage-sdk/src/client.ts#L12
See #29 Use ECMAScript private for better guarantee of the property isolation.
private => remove "private" and prepend
#
. public => remove "public" as it's the default.