feat!: improve tree-shaking of EdgeStyle by tbouffard · Pull Request #809 · maxGraph/maxGraph
Remove hard-coded EdgeStyle references throughout the codebase to enable proper tree-shaking. Previously, all built-in EdgeStyle implementations were always included in application bundles. Now, only registered EdgeStyle implementations are bundled, reducing application size by up to 17kB when no EdgeStyles are used. This is implemented by: - Creating a dedicated EdgeStyleRegistry to register EdgeStyle with metadata - Introducing PerimeterRegistry to manage Perimeter registrations separately - Removing StyleRegistry which previously handled both concerns Additional improvements: - Add dedicated unregister functions for each registry type, allowing independent management of EdgeStyle and Perimeter registrations - Create BaseRegistry to share common functionality between all style registries BREAKING CHANGES: `StyleRegistry` has been removed. Use `EdgeStyleRegistry` and `PerimeterRegistry` instead. The methods of the new registries are also named differently.
No longer tries to do it with object in GraphViewCodec. The related registries only hold function. In addition, the logic was wrong. It should have been a OR instead of a AND when checking for 'function' and 'object'.
tbouffard
deleted the
feat/introduce_EdgeStyleRegistry
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters