Skip to content

refactor: export mxGraph objects directly instead of via mxgraph namespace#3491

Draft
tbouffard wants to merge 1 commit intomasterfrom
refactor/simplify_mxgraph_object_exports
Draft

refactor: export mxGraph objects directly instead of via mxgraph namespace#3491
tbouffard wants to merge 1 commit intomasterfrom
refactor/simplify_mxgraph_object_exports

Conversation

@tbouffard
Copy link
Member

Destructure mxGraph objects from the mxgraph factory export so internal
code imports them directly (e.g. mxGraph, mxConstants) rather than
accessing them through mxgraph.mxGraph, mxgraph.mxConstants.

This enables tree-shaking since bundlers can track individual named
imports, improves readability by removing the repetitive mxgraph.
prefix, and makes imports explicit about which mxGraph objects each
module actually depends on.

mxGraph is exported separately with an explicit typeof annotation to
work around api-extractor losing constructor type information during
.d.ts rollup, which caused TS2507 in downstream type checks.

…space

Destructure mxGraph objects from the mxgraph factory export so internal
code imports them directly (e.g. `mxGraph`, `mxConstants`) rather than
accessing them through `mxgraph.mxGraph`, `mxgraph.mxConstants`.

This enables tree-shaking since bundlers can track individual named
imports, improves readability by removing the repetitive `mxgraph.`
prefix, and makes imports explicit about which mxGraph objects each
module actually depends on.

mxGraph is exported separately with an explicit `typeof` annotation to
work around api-extractor losing constructor type information during
.d.ts rollup, which caused TS2507 in downstream type checks.
@tbouffard tbouffard added the refactoring Code refactoring label Mar 17, 2026
@github-actions
Copy link

github-actions bot commented Mar 17, 2026

🎊 PR Preview 24f045f has been successfully built and deployed to https://process-analytics-bpmn-visualization-js-doc_preview-pr-3491.surge.sh

🕐 Build time: 0.011s

🤖 By surge-preview

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

🎊 PR Preview 24f045f has been successfully built and deployed to https://process-analytics-bpmn-visualization-js-demo_preview-pr-3491.surge.sh

🕐 Build time: 0.013s

🤖 By surge-preview

@sonarqubecloud
Copy link

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

Labels

refactoring Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant