-
Notifications
You must be signed in to change notification settings - Fork 198
Description
Is your feature request related to a problem? Please describe.
EdgeStyle.EntityRelation is currently a direct dependency inside EdgeHandler.
This creates a strong coupling in the codebase:
- It limits tree shaking.
- Even if
EntityRelationis not used, it is still bundled in the final application. - This reduces the benefits of previous tree shaking work, especially the improvements introduced in Make
Graph.createEdgeHandlerandGraph.isOrthogonalconfigurable and independent from EdgeStyle implementation #767.
As a result, applications pay a bundle size cost for a feature they may not use.
Describe the solution you'd like
Explore a way to remove the direct dependency between EdgeHandler and EdgeStyle.EntityRelation.
One possible solution to explore:
- Introduce new metadata when registering an
edgeStyle. - This metadata could be used by
EdgeHandlerto determine whether it needs to apply the special processing that is currently hardcoded forEntityRelation. - This would follow the same approach already used in feat!: improve tree-shaking of EdgeStyle #809.
The goal is to:
- Decouple
EdgeHandlerfrom specific edge style implementations. - Improve tree shaking.
- Avoid bundling
EntityRelationwhen it is not used.
In addition, this will allow for the same treatment of applications that provide an alternative implementation to EntityRelation or other EdgeStyle, if necessary. This will provide greater flexibility and possibilities.
Describe alternatives you've considered
- Keeping the current direct dependency, but this continues to limit tree shaking.
- Moving logic elsewhere without metadata, but this risks reintroducing implicit coupling.
Additional context
This request is directly related to bundle size optimization and long term maintainability.
It also aligns with previous efforts to make connectors and edge styles more modular and tree-shaking friendly.