typedoc-plugin-markdown
typedoc-plugin-markdown copied to clipboard
[docusaurus-plugin-typedoc] Inconsistent with docusaurus watch mode
Related to #271.
It seems that docusaurus (or webpack if you'd like) has its own watch mode, if in plugin's API you could specify what files you need to watch and what to do if a file changed. It's done by implementing https://docusaurus.io/docs/lifecycle-apis#getpathstowatch method in a plugin and every time a file from that list is changed the whole lifecycle will be run (for example, async loadContent function to generate content).
Looks like typedoc and docusaurus-plugin-typedoc runs on its own watch mode and it doesn't use docusaurus API at all. If produces quite strange bug that if you want to use watch mode for docusaurus you need to provide additional fields for this plugin, because otherwise typedoc could run its own watch mode and even if docusuaurus isn't going to run watch mode, the plugin will block the process from finishing because of its watch mode.
I do understand that it might be done because of advantages of typedoc (typescript) watch API, but it doesn't look so convenient for this plugin's users, because they need to control 2 flags separately.
Is it possible to move from typedoc's watch API to docusaurus watch approach instead?
Thanks @timocov - yes the implementation doesn't feel quite right.
We could listen to typescript source files with pathsToWatch, but the problem is we don't want to run the whole lifecycle again is it will rebuild the entire TypeDoc app again, but we want to take advantage of TypeDoc incremental build.
I will have to revisit the code again to see what can be done.
Don't think there is a way around the current implementation so closing.