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

Allow describedBy to be an async function #331

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

fcollonval
Copy link
Member

Follow-up of #322 (comment)

cc @bollwyvl

@afshin afshin added the enhancement New feature or request label Aug 4, 2022
@afshin afshin added this to the Lumino 2 milestone Aug 4, 2022
@afshin afshin mentioned this pull request Aug 4, 2022
16 tasks
@afshin afshin changed the title Allow describedBy to be a async function Allow describedBy to be an async function Aug 4, 2022
@afshin
Copy link
Member

afshin commented Aug 5, 2022

Maybe instead of special-casing describedBy to be either a Promise or a CommandFunc, we should have all command functions potentially return a promise?

export type CommandFunc<T> = (args: ReadonlyPartialJSONObject) => T | Promise<T>;

Or maybe that's a bad idea ... commands need to run synchronously, so maybe this special-casing is sound.

What do you think?

@fcollonval
Copy link
Member Author

Good question. I'm a bit reluctant to do that because most of them are for displaying information (in particular to build menus or command buttons). So I would rather not apply it as very slow asynchronous attributes may prevent displaying part of the UI or render in a weird way with popping e.g..

@afshin
Copy link
Member

afshin commented Aug 5, 2022

Thank you!

@afshin afshin merged commit d8ad8f4 into jupyterlab:main Aug 5, 2022
@fcollonval fcollonval deleted the ft/command-description-2 branch August 5, 2022 14:12
@afshin afshin changed the title Allow describedBy to be an async function Allow describedBy to be an async function Aug 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
Status: done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants