You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReSpec has "prepare" code like this or this in many modules. My idea is to add a async prepare(conf) in such modules, and do a pass where all modules run their prepare(), followed by our existing run() pass.
Why?
I was trying to reorder some plugins to make overall ReSpec appear to load faster (mainly create ToC before content below the fold). But some plugins add headings dynamically (not available until they run()), but ToC requires those headings (so we've a dependency chain making ToC render late). If we can generate those headings in a prepare, then we can easily generate ToC earlier (See this demo of impact: https://respec-run-toc-early.netlify.app).
ReSpec has "prepare" code like this or this in many modules. My idea is to add a
async prepare(conf)
in such modules, and do a pass where all modules run theirprepare()
, followed by our existingrun()
pass.Why?
run()
), but ToC requires those headings (so we've a dependency chain making ToC render late). If we can generate those headings in a prepare, then we can easily generate ToC earlier (See this demo of impact: https://respec-run-toc-early.netlify.app).Thoughts? @saschanaz @marcoscaceres
The text was updated successfully, but these errors were encountered: