You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
This is question and discussion regarding design decisions around symbols. Relevant docs document
Local symbols make it harder for developers to monkey patch/access private fields, as they require more work than a property prefixed with an _. Monkey patching private API that were not designed to be monkey-patchable make maintaining and evolving Node.js harder, as private properties are not documented and can change within a patch release. Some extremely popular modules in the ecosystem monkey patch some internals, making it impossible for us to update and improve those areas without causing issues for a significant amount of users.
Describe the solution you'd like
I would like to remove all internals monkey-patching in foreseeable future. This would fix #22498
Therefore, I would propose:
Move all internal properties to symbols or private fields.
Expose getters/setters under current names, emit deprecation warning about monkey-patching internals.
Identify use cases of these libraries and provide alternative way to do these things
Remove getters/setters over time
This is probably work for at least 2 LTS releases to allow libraries to adopt. It's obviously semver-major.
Describe alternatives you've considered
Make _hiddenProperty non-enumerable (proposed by @refack in #22498).
This discussion was converted from issue #35868 on December 27, 2020 12:42.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is your feature request related to a problem? Please describe.
This is question and discussion regarding design decisions around symbols. Relevant docs document
Describe the solution you'd like
I would like to remove all internals monkey-patching in foreseeable future. This would fix #22498
Therefore, I would propose:
This is probably work for at least 2 LTS releases to allow libraries to adopt. It's obviously semver-major.
Describe alternatives you've considered
Make
_hiddenProperty
non-enumerable (proposed by @refack in #22498).Beta Was this translation helpful? Give feedback.
All reactions