-
Notifications
You must be signed in to change notification settings - Fork 985
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
Add Promesa to simplify working with promises #18767
Conversation
Jenkins BuildsClick to see older builds (12)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. We need to make sure that we eventually move all async callbacks to promesa going forward.
@shivekkhurana when/if merged, will make an issue to collect & track promises that are hidden behind callbacks so that anybody could get some practice using it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something definitely needed in our codebase, thanks for adding it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @clauxx. I remember two other external contributors also asked if promesa
was available or if they should add it.
Let's keep an eye on guidelines too. I see you changed from .then
to p/then
, and .catch
to p/catch
. Consistency is important, so if we are going in that direction, maybe soon we should have a guideline specifying to prefer to not use promises with interop. p/then
for instance automatically promisifies code, which is handy.
88% of end-end tests have passed
Failed tests (5)Click to expandClass TestCommunityMultipleDeviceMergedTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (42)Click to expandClass TestDeepLinksOneDevice:
Class TestCommunityOneDeviceMerged:
Class TestActivityMultipleDevicePRTwo:
Class TestCommunityMultipleDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
|
90% of end-end tests have passed
Failed tests (4)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestGroupChatMultipleDeviceMergedNewUI:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (43)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestActivityMultipleDevicePRTwo:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestDeepLinksOneDevice:
Class TestActivityMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
|
2c4cbbe
to
283e323
Compare
@clauxx thanks for the PR. Ready for merge. |
283e323
to
64db69b
Compare
Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>
Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>
64db69b
to
eed0a88
Compare
fixes #18758
Summary
This PR adds a new tool for working seamlessly with promises in clj/cljs, named promesa. As this is a follow-up to the promesa proposal/discussion PR, which describes the motivation behind this PR, I'm looking to get it in as it got some positive feedback and interest from several CCs. If merged, I will create an issue to track the migration to promesa, as it can be done incrementally.
To summarise, here's some of
promesa
's functionality:p/then
,p/->
,p/->>
);async/await
- (p/let
);Promise.all
- (p/all
,p/plet
);To read more on it, check out the introduction to working with promesa. Most of its syntax shouldn't be challenging to devs already working with clojure, as it uses familiar patterns:
let
,->
,->>
,(.then)
, etc.Aside from adding the
promesa
dependency, I added a simple example to show how it's used. For a more complex example that shows the value of this addition, checkout the original promesa discussion PR.In case you have questions/hesitations, please leave a review, I'll be happy to discuss.
Review notes
Testing notes
This PR touches the chat photo selection code, so we should make that photo selection and displaying them in the chat works as before. I tested it, but who knows.
Platforms
Areas that maybe impacted
Functional
Steps to test
status: ready