Skip to content

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

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.

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.

Activity

  1. added
    enhancement
    triage
    on Dec 17, 2025
  2. coderabbitai commented on Dec 17, 2025

    @coderabbitai

    📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    Examples
    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    🔗 Similar Issues

    Related Issues

    🔗 Related PRs

    #724 - docs: improve jsdoc for custom implementation of EdgeStyle [merged]
    #775 - refactor: reorganize builtin style elements [merged]
    #785 - feat!: improve tree-shaking of Perimeter [merged]
    #787 - feat: improve IDE guidance for style element registration [merged]
    #796 - refactor!: remove ARROW, EDGESTYLE, PERIMETER enums [merged]

    👤 Suggested Assignees


    🧪 Issue enrichment is currently in open beta.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord or schedule a call!

  3. changed the title [-]Reduce EdgeHandler dependency on EdgeStyle.EntityRelation for better tree shaking[/-] [+]Remove EdgeHandler dependency on EdgeStyle.EntityRelation for better tree shaking[/+] on Dec 17, 2025
  4. removed
    enhancement
    triage
    on Dec 18, 2025
  5. self-assigned this
    on Apr 3, 2026
  6. added this to the 0.24.0 milestone on Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions