Skip to content

Conversation

@tbouffard
Copy link
Member

@tbouffard tbouffard commented Apr 22, 2025

Create CustomGraph that registers only the features needed by our examples instead of loading all built-in styles and shapes.

This prepares for future tree-shaking improvements in maxGraph which will reduce bundle size.

Notes

Covers maxGraph/maxGraph#760

Bundle sizes

Note

The new implementation sightly increase the size of the bundle, mainly because it:

  • now includes the declaration of the builtin styles and plugins used by the application
  • temporary includes the implementation of EdgeMarker.createArrow which is not exported by maxGraph 0.17.0. It will be removed when using maxGraph 0.18.0 which exports it.
Example defaults selected features
farm 453.9 kB 454.2 kB
lit with vite 461.5 kB 462.4 kB
parcel 528.1 KB 529.3 kB
rollup 438.3 kB 439.2 kB
rsbuild 417.3 kB 416.9 kB
vite 442.2 kB 443.1 kB

Contents

  • defaults: main branch, commit 4d866cc
  • selected features: this PR, commit 09d27dd

Create `CustomGraph` that registers only the features needed by our examples instead of loading all built-in styles and shapes.

This prepares for future tree-shaking improvements in maxGraph which will reduce bundle size.
@sonarqubecloud
Copy link

@tbouffard tbouffard marked this pull request as ready for review April 23, 2025 04:49
@tbouffard tbouffard merged commit dbaff70 into main Apr 23, 2025
1 check passed
@tbouffard tbouffard deleted the feat/only_load_features_needed_by_examples branch April 23, 2025 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant