Skip to content

Remove EdgeHandler dependency on EdgeStyle.EntityRelation for better tree shaking #978

@tbouffard

Description

@tbouffard

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:

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 EdgeHandler to determine whether it needs to apply the special processing that is currently hardcoded for EntityRelation.
  • This would follow the same approach already used in feat!: improve tree-shaking of EdgeStyle #809.

The goal is to:

  • Decouple EdgeHandler from specific edge style implementations.
  • Improve tree shaking.
  • Avoid bundling EntityRelation when it is not used.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions