element-hq / element-hq/element-web

Could probably improve a whole lot of performance by running custom annotations on IProps and IState for components

Open
#14,742 0 comments 0 reactions 0 assignees View on GitHub
A-Performance T-Enhancement T-Task
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

Many (most?) of our components expect to receive a static set of props and either don't react well to changes or no-op them. We can abuse `shouldComponentUpdate` to reduce the number of renders by decorating our properties and state with whether or not we care about them updating. For example, we could annotate the `tagId` of a RoomSublist with `@ignoreChanges` which signals to our custom `Component` implementation that it should no-op updates to that property.

Changes to state are generally useful though, so we might want to consider not actually doing this for that.

Contributor guide

Open the contributing guide

Research direction

Start by locating the custom Component implementation, its IProps/IState definitions, and the RoomSublist component referenced in the issue. Read how shouldComponentUpdate currently handles prop and state changes, then determine the annotation behavior and coverage needed before validating that unchanged props avoid unnecessary renders without suppressing useful state updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.