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

[docusaurus-plugin-typedoc] Incorrect plugin definition #271

Closed
timocov opened this issue Dec 1, 2021 · 3 comments
Closed

[docusaurus-plugin-typedoc] Incorrect plugin definition #271

timocov opened this issue Dec 1, 2021 · 3 comments

Comments

@timocov
Copy link

timocov commented Dec 1, 2021

According to docusaurus types a plugin's module should be a function (with optional properties), but a function which returns a result synchronously. But in docusaurus-plugin-typedoc plugin's code this function is asynchronous, what could cause some interesting issues like when a plugin couldn't generate all files in time and docusaurus will ignore them.

For now it seems that it works fine in trivial cases, but I believe it might break anytime and most likely you won't be noticed about that.

It seems that the simplest solution could be moving at least this code inside loadContent function of returned plugin so docusaurus will wait until all work is done and only after that will continue.

@slorber
Copy link

slorber commented Dec 3, 2021

Hey, good catch

We don't support async plugin inits but we definitively want to in the future (even our core plugins need this in a few places)

Surprised that current code works though 🤷‍♂️

@timocov timocov changed the title [docusaurus-plugin-typedoc]: Incorrect plugin definition [docusaurus-plugin-typedoc] Incorrect plugin definition Dec 5, 2021
@tgreyuk
Copy link
Member

tgreyuk commented Dec 7, 2021

thanks @timocov .. I can't quite remember why it was implemented that way originally but i think it was to do with some odd race conditions .However everything seems to work using the 'correct' implementation as per your suggestion.

@timocov
Copy link
Author

timocov commented Dec 9, 2021

@tgreyuk It seems that it should be fixed in the latest version according to the changelog so we can close the issue now?

@tgreyuk tgreyuk closed this as completed Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants