Optimize Plugin API to Avoid Passing Full docx Module
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
docxcomponents it needs. - However, due to how
docxhandles exports, this is not currently possible.
Proposed Solution (Dependent on docx Fix):
- Once [dolanmiu/docx#2988](https://github.com/dolanmiu/docx/issues/2988) is resolved, update the plugin API:
- Modify the function signatures so plugins do not require the full
docxmodule. - Allow plugins to import only the necessary parts of
docx.
- Modify the function signatures so plugins do not require the full
📌 Next Steps:
- Monitor the upstream issue in
docx. - If a workaround is available, implement it before the official fix.
- Refactor
mdast2docxplugins accordingly once the issue is resolved.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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