Skip to content

Add support to split data in chunks to reduce memory pressure #47

Open
@resaldiv

Description

@resaldiv

Describe the problem
When a extremely large output of text is being rendered, React cannot seem to handle the memory pressure and crashes the app. Chunking the outputs to allow react to handle them in pieces seems to relieve the memory pressure. However, this creates a problem with ansi-to-react using <code> which changes how the chunks are now rendered.

Describe the solution you'd like
If the data length passes a high threshold of character count, we split the output into chunks and then render the chunks as span using the ansi-to-react change and wrap it outside as code.

In order to do this, we will need to modify two nteract repos:

  1. outputs: add support to split the props.data in multiple chunks, map the array, and make sure to call ANSI in each iteration to render that piece of data.
  2. ansi-to-react: add support to treat each piece of chunk as a <span> element and let media plain wrap it in a <code> element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions