Add processor cleanup function #125
Unanswered
remcohaszing
asked this question in
Ideas
Replies: 2 comments 6 replies
-
Oh and of course the processor would then have cleanup methods: const processor = unified();
// $ExpectType Promise<void>
processor.cleanup();
// $ExpectType void
processor.cleanupSync(); |
Beta Was this translation helpful? Give feedback.
3 replies
-
Interesting @remcohaszing! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Yesterday I wrote remark-mermaidjs. Basically this code does the following:
This works fine (well, not 100% consistent, but that’s a detail) in the tests.
I’m working on appsemble I have created the following script to generate JSX from the docs there:
This works as well.
In reality, I want to use this with
@mdx-js/loader
. This causes random failures due to puppeteer timeouts. I believe these timeouts are caused by the combination of Webpack bundling a fairly large project and opening Chrome 6 times in the background (once for each file that’s processed and contains mermaid graphs).I think the solution would be if unified processorts get a cleanup function. Then I could deduplicate the heavy work in
remark-mermaidjs
, i.e. something like this:Beta Was this translation helpful? Give feedback.
All reactions