HomePhabricator
Diffusion Comm 5011d6a78baf

[lib] Introduce chat mention context

Description

[lib] Introduce chat mention context

Summary:
In the previous implementation, we were correctly memoizing computations, but it was done using hooks, so in each component where these were used, we were doing the same computations again. In this approach, the memoization is moved to a new context, so that computations aren't repeated.

Depends on D9465

https://linear.app/comm/issue/ENG-5224/ashoats-js-thread-freezes-on-app-start-on-build-268

Test Plan:
Check if getChatMentionCandidates function invocations happen every time with new inputs (by adding code that saves the input to a global variable, compares new arguments with the previous ones, and console logs the result).
Check if chat mentioning works correctly on the web and native.

Reviewers: kamil, inka, atul, ashoat

Reviewed By: ashoat

Subscribers: wyilio

Differential Revision: https://phab.comm.dev/D9466

Details

Provenance
tomekAuthored on Oct 12 2023, 6:46 AM
Reviewer
ashoat
Differential Revision
D9466: [lib] Introduce chat mention context
Parents
rCOMM0fe842367d0d: Revert "[lib] Disable chat mentioning"
Branches
Unknown
Tags
Unknown