BlueBaseJS / BlueBaseJS/core

Component Memoization Support

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Requirements

To improve the performance of BlueRain projects, we need to figure out a way to add component memoization. This means for some components if they are passes same props, again and we expect the same output every time, we don't need to process the render again. We instead return a previous render result, that was cached during the first render.

## Approach

The simplest solution at this time seems to be as follows:
- Add a cache or memoize property for each component in registry.
- During component resolution, for every component that has cache (or memoize) property set to ture, just wrap the component in an hoc from one a memoize library (e.g. [moize](https://github.com/planttheidea/moize)

## Not Doing

- Implementing custom memoization logic

## Possible Memoize libraries

- [moize](https://github.com/planttheidea/moize)

## Useful Links

- https://medium.com/@planttheidea/memoize-react-components-33377d7ebb6c

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.