Skip to content

refactor!: replace is-promise dependency with instanceof check - #137

Open
jonkoops wants to merge 1 commit into
pillarjs:masterfrom
jonkoops:drop-is-promise
Open

jonkoops wants to merge 1 commit into
pillarjs:masterfrom
jonkoops:drop-is-promise

Conversation

@jonkoops

Copy link
Copy Markdown
Contributor

Replaces the is-promise dependency with an instanceof Promise check.

BREAKING: drops support for non-native promises

Closes #136

@jonkoops

Copy link
Copy Markdown
Contributor Author

This PR should likely not be merged until the next major.

@jonkoops

jonkoops commented Dec 2, 2024

Copy link
Copy Markdown
Contributor Author

Just ping me whenever a new major is in the works and I will take a moment to rebase the work here.

@wesleytodd

Copy link
Copy Markdown
Member

Really sorry to have left this one hanging for so long. You are right this is a breaking chance since it would drop support for some of the legacy promise forms that package supports. And looking back at the timing we had already cut the 2.x release line by the time this was opened anyway.

So, what can we do? I think the best option we could do is to check if it is anything other than a native Promise and print a deprecation warning in the 2.x branch. That would set us up to remove this package and fully drop support for anything but native promises in the 3.x line which will ship with express@6. Does that sound like a good next step to you?

@jonkoops

jonkoops commented Mar 5, 2025

Copy link
Copy Markdown
Contributor Author

Sure, I can go ahead and make a PR that logs a deprecation for this. Do you have any examples of how deprecations should be logged that I could use as inspiration?

@wesleytodd

Copy link
Copy Markdown
Member

We have used depd for this in the past. This is what I could find in this repo, but we for sure used it in express as well.

@bjohansebas

Copy link
Copy Markdown
Member

I like the idea of showing that warning

@jonkoops

jonkoops commented Mar 6, 2025

Copy link
Copy Markdown
Contributor Author

Created a PR to add the message under #154

@ethanashfordzzz

Copy link
Copy Markdown

Could this be merged and included in the next release?
cc: @UlisesGascon

BREAKING: drops support for non-native promises

Closes pillarjs#136

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops

Copy link
Copy Markdown
Contributor Author

Went ahead and rebased this in case there is interest in landing it. The new version differs a little in that it also eliminates depd as a dependency since it is no longer needed, as well as inlining the Promise checks, since they are now a simple one-liner.

If there is interest in landing a new major, there are more enhancements we could be doing. If that is the case, ping me and I can open some PRs/issues with some cleanup.

@UlisesGascon UlisesGascon self-assigned this Oct 27, 2026

@UlisesGascon UlisesGascon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go in the next major

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider dropping is-promise as a dependency

5 participants