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

Async processing in plugins #185

Closed
meirgottlieb opened this issue Jan 29, 2016 · 0 comments
Closed

Async processing in plugins #185

meirgottlieb opened this issue Jan 29, 2016 · 0 comments

Comments

@meirgottlieb
Copy link

Hello,

A plugin I wrote process PlantUML diagrams in comments and generates links to images in the comments for those diagrams. The supporting libraries that do the image generation are async. Is there a way to tell TypeDoc to wait until the async processing in the plugin has completed before continuing? Or at least before reporting that document generation has completed? As it is now it works but TypeDoc reports that it is finished before the images have actually finished generating.

Thanks!
Meir

@Gerrit0 Gerrit0 added this to To do in Guides (#247) - v0.24 via automation Sep 5, 2021
@Gerrit0 Gerrit0 moved this from To do to Done in Guides (#247) - v0.24 Jul 25, 2022
achingbrain added a commit to achingbrain/typedoc that referenced this issue Dec 9, 2022
[5ddbbf6](TypeStrong@5ddbbf6)
added a documentation note that says plugins can return a promise from their `load` function,
but that promise needs to be awaited otherwise it'll resolve outside of the normal execution
flow and can cause `unhandledPromiseRejection`s.

The change here is to await the result of `initFunction`, which means making the `loadPlugins`
function async and cascading that asynchronicity upwards.

Also adds tests for loading sync/async and very slow plugins as I couldn't see where these
were tested.

Refs: TypeStrong#185
@Gerrit0 Gerrit0 added this to the v0.24 milestone Mar 11, 2023
@Gerrit0 Gerrit0 closed this as completed in 5ddbbf6 Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants