Closed nlf closed 2 years ago
Hi @nlf thank you for the pull request. I agree, the lazy loading doesn't really add any value. I was curious when it was originally introduced and it looks like it was the time between our org ownership in commit https://github.com/jshttp/negotiator/commit/a3ceee50bbff78b6ee917609dc369baff1ced7be
I'll get this kicked out in a new release for you to consume upstream :)
Oops, as quickly as I posted that I realized that was just when require
was made to be a dynamic variable. I guess I'm just very sleepy right now 😴 . Anyhow, yes, no need for lazy loading 👍
thanks @dougwilson!
the lazy loading here caused us some minor grief when introducing this module to the npm CLI. the modules that are being lazy loaded do not have any requires of their own and are comprised of largely function definitions, which are pretty cheap in the grand scheme of things.
feel free to close this if the micro optimization is worth it for you! we just wanted to see if we could get this changed here instead of our current hacky workaround: https://github.com/npm/make-fetch-happen/pull/50