Repository navigation
⚡️ Major Refactor: Say Goodbye to Async in block and inline Parsers
#15
mayank1513
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey folks! 👋
I'm excited to share a major refactor that’s underway for mdast2docx and the surrounding plugin ecosystem. This change simplifies the core plugin structure and makes the system much more deterministic and easier to use. I'm rolling out a major optimization to the
mdast2docxplugin system — and it's a big one for both performance and developer experience.😬 The Issue
To support image processing (e.g., downloading or decoding images), the
blockandinlineplugin methods were originally madeasync. This meant that every plugin, even those that didn’t need async, had to return promises — leading to extra overhead, unnecessary complexity, and slower execution overall.🚀 The Optimization
We’re moving image processing into a separate, dedicated pipeline, handled during the
preprocessphase — before any block or inline rendering begins.This unlocks a huge win:
✅ All block and inline plugin methods can now be fully synchronous.
🔧 Updated Plugin Interface
⛔️ Before (Async-heavy):
✅ After (Optimized and sync):
⚡️ Why This Matters
awaiteverything.This change might require minor tweaks in your custom plugins — just remove
async/awaitfromblockandinlinemethods. Everything else stays familiar.I’m genuinely excited about how much leaner and faster things already feel with this change — especially for large document generation and batch processing. Let me know what you think or if you hit any edge cases!
Cheers 🙌
All reactions