Skip to content

Split components by context to reduce bundle size #555

@techniq

Description

@techniq

In many cases, a component is only used within a <Svg> or <Canvas> context. While it's very convenient to have a single component that works across all contexts, it does increase bundle size to load the Svg or Canvas implementations for all components when you are only using one of them.

The proposal is to still provide a unified component, but also provide context-specific instances, such as:

  • Text
    • simple facade that uses the the below
  • TextSvg
  • TextCanvas
  • TextHtml (future)
  • TextBase (possible to simplify the aforementioned)

This should significantly reduce bundle sizes. Will take some thought on how to do this surgically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions