Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] require("p-limit") backward compatibility #70

Closed
kkimdev opened this issue Sep 3, 2023 · 2 comments
Closed

[Feature Request] require("p-limit") backward compatibility #70

kkimdev opened this issue Sep 3, 2023 · 2 comments

Comments

@kkimdev
Copy link

kkimdev commented Sep 3, 2023

p-limit 4 dropped commonjs style import support. Though one very practical issue we encounter was that even if "our" project uses ESM, since there are still many libraries we use executes require("p-limit"), so we had no choice but forced to use p-limit 3.

I understand that ESM is the best practice and the future, but practically, the third party require("p-limit") issue will prevent us (and many others) from using p-limit 4 for many years, if not ever.

@sindresorhus
Copy link
Owner

since there are still many libraries we use executes require("p-limit"), so we had no choice but forced to use p-limit 3.

They should be able to continue using it. The whole dependency tree does not need to be ESM. npm will only hoist compatible (based on semver ranges) packages to the top-level. Node.js can have multiple versions of the same package running at the same time.

@kkimdev
Copy link
Author

kkimdev commented Sep 3, 2023

Oh ok, let me double check. IIRC, last week, we tried to upgrade p-limit to 4 but then encountered errors pointing to require("p-limit") in third party source codes that hadn't happened before, but haven't investigated in detail.

@kkimdev kkimdev closed this as completed Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants