Skip to content

[EuiErrorBoundary] Use lighter components for EuiErrorBoundary #9691

@cleydyr

Description

@cleydyr

Problem Statement

I'm digging a bit on optimizing our bundles for an app that uses EUI. I noticed that we're loading EuiCodeBlock in EuiErrorBoundary only to wrap the error message and its title.  But EuiCodeBlock is very powerful and often results in code that is rarely used (mainly for syntax highlighting).

Proposed Solution

Use a lighter component to help render the error message and title.

Value / Impact

  • Reduce the app bundle size for consumers
  • Reduce the amount of unused Javascript

Urgency

Not urgent.

Do alternatives or workarounds exist?

Lazily-loading EuiCodeBlock and EuiErrorBoundary to render them only when an actual error happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions