md2docx / md2docx/core

Optimize Plugin API to Avoid Passing Full docx Module

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Currently, when using plugins in mdast2docx, we must pass the entire docx module (import * as docx from "docx") to plugin functions.

🔗 Related Discussion: [#6](https://github.com/tiny-md/mdast2docx/discussions/6)
🔗 Blocking Issue in docx Library: [dolanmiu/docx#2988](https://github.com/dolanmiu/docx/issues/2988)

Problem:
  • This approach increases bundle size unnecessarily.
  • Ideally, each plugin should import only the docx components it needs.
  • However, due to how docx handles exports, this is not currently possible.
Proposed Solution (Dependent on docx Fix):

📌 Next Steps:

  • Monitor the upstream issue in docx.
  • If a workaround is available, implement it before the official fix.
  • Refactor mdast2docx plugins accordingly once the issue is resolved.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by monitoring the linked docx#2988 issue and reviewing the current mdast2docx plugin API and related discussion #6; the payload names no source files or tests. Done means the upstream export limitation is resolved or a workaround exists, and plugin signatures no longer require the full docx module.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.