module: use compileFunction over Module.wrap by ryzokuken · Pull Request #21573 · nodejs/node (original) (raw)
@jdalton as I proposed,
I'd love to dive deeper into what the community is monkey-patching Module.wrapper for. If it's just the matter of changing the default params, I suppose that could be done by storing an array for the default params and making the setter set that array instead, while deprecating the setter itself to allow people to slowly migrate away.
I'm quite open to provide temporary setters and deprecating Module.wrap
and Module.wrapper
. That said, for making appropriate setters, I'd need to know why people are monkey-patching Module.wrap
in the first place, and if it's reasonable enough for us to support that use case.
Stating my personal opinion, I'm actually not thrilled by the idea of supporting monkey-patches because I believe that they promote such reckless behavior, and it feels a lot like digging ourselves a hole, but I do understand that the CJS community might not have had too many options, and am willing to support the setters if the use-case is reasonable enough.
If you could help me with a few examples from userland (how and why exactly are people monkey-patching module
), that'd be great.