funcool/promesa

promesa.core/then' is deprecated

rlhk opened this issue · 5 comments

rlhk commented

Tried the latest 10.0.507 version on a previously working project (9.0.507) and got compiler warning (shadow-cljs). Moved to 9.1.538 and there's no such issue:

------ WARNING #1 - :fn-deprecated ---------------------------------------------
 Resource: promesa/core.cljc:221:10
--------------------------------------------------------------------------------
 218 |
 219 | (defn chain'
 220 |   {:deprecated "9.3" :no-doc true}
 221 |   ([p f] (then' p f))
----------------^---------------------------------------------------------------
 promesa.core/then' is deprecated
--------------------------------------------------------------------------------
 222 |   ([p f & fs] (reduce pt/-map (pt/-promise p) (cons f fs))))
 223 |
 224 | (defn handle
 225 |   "Chains a function `f` to be executed when the promise `p` is completed

Yep, this function was deprecated in 10.0.x.

I really want a feedback on this, because I really only know how I personally use it; but don't know how people use it.
The main idea is if you want more performant version (withouth auto-unwrapping mechanism) is suggest use all the chaining functions designed to be used with ->>: map, mcat, hmap, hcat and merr.

But I'm open to feedback and reconsider keeping the then' and similar variants.

rlhk commented

My bad. I just posted too quick. I thought the message prevented my project from compiling while it's just a warning. I don't use the fn myself. Maybe keep this open and see if others have any feedback?

yep, let's keep this open for some time

just for curiosity, which dependency you are using?

rlhk commented

Just a simple project with very little deps:
https://github.com/rlhk/logseq-url-plus/blob/main/shadow-cljs.edn

Finally i have reconsidered this, so I reverted some deprecation's and bumped 10.0.571
So I close this issue.