Skip to content

Optimize Plugin API to Avoid Passing Full docx Module#1

Description

@mayank1513

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

馃敆 Related Discussion: [#6](md2docx/mdast2docx#6)
馃敆 Blocking Issue in docx Library: [dolanmiu/docx#2988](dolanmiu/docx#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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions