Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

WIP: [MM-12741] Refactor emoji picker #3648

Closed
wants to merge 16 commits into from

Conversation

cometkim
Copy link
Collaborator

@cometkim cometkim commented Sep 11, 2019

Summary

  • Rewrite around of EmojiPicker with TypeScript
  • Rewrite around of EmojiPicker with FC/Hooks
  • Cleanup component tree
  • Virtualize emoji list using react-window
  • Code-split for emoji picker component
  • Fix a bug that moves to wrong emoji position when arrow keys down.
  • Benchmark

Ticket Link

GitHub: mattermost/mattermost#10346
Jira: MM-12741

Related Pull Requests

@cometkim cometkim added the Work in Progress Not yet ready for review label Sep 11, 2019
@cometkim cometkim self-assigned this Sep 11, 2019
@mattermod
Copy link
Contributor

This issue has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

/cc @jasonblais @hanzei

@jasonblais
Copy link
Contributor

Hi @cometkim! 👋 Let us know if you have any questions - sounds like this might have been a starter PR for initial review based on a note here? mattermost/mattermost#10346 (comment)

@cometkim
Copy link
Collaborator Author

Hey @jasonblais , currently I'm working on this only weekend. so this would be delayed.

I will make some progress and mention you.

@jasonblais
Copy link
Contributor

No worries! Thank you for the heads up 👍

@cometkim cometkim force-pushed the refactor-emoji-picker branch 3 times, most recently from 3347585 to 246751f Compare October 3, 2019 14:49
@cometkim
Copy link
Collaborator Author

cometkim commented Oct 3, 2019

Awaiting #3866 PR to be merged.

@HarshaLaxman
Copy link

Any update on this?
Emoji picker freezes the app 50% of the time for me.

@cometkim
Copy link
Collaborator Author

cometkim commented Dec 10, 2019

Hey @HarshaLaxman, thank you for watching at this.

I've been very busy at work for couple months, so would resume any contribution later this month.

And probably going to go ahead from react-bootstrap related issues first because It blocks the use of react's context API. you can see the context from #3866 and #4185 (comment)

I think you can just lazy load the picker component in another PR.

@esethna
Copy link
Contributor

esethna commented Jun 25, 2020

Hi @cometkim, anything we can help with here?

@cometkim
Copy link
Collaborator Author

cometkim commented Jun 28, 2020

Hi @esethna.

Since this PR is very old, it is better to rewrite it from scratch. (Another contributor may take it)

Sharing here some of what I've researched before.

Approaches

I benchmarked a similar component before starting this.

emoji-mart vs slack

Emoji Mart takes full advantage of HTML/CSS features, so there are almost no JS re-rendering. the initial mount/unmount cost is bit high, but the DOM structure is that not complicated, so it shows quite good performance with less codes and also accessibility is quite good because it is based on basic HTML elements.

Slack seems to have chosen Virtualization for more interaction, and sticky section headers etc. have also been implemented directly using JS. Since the DOM structure is not intuitive, it seems like a hack for the A11y will be necessary, but it could perform better and may be better if it optimizes the re-render more.

I suggest using the community version of emoji-mart for maintainability.

License issue

Another issue is the fact that the images contained in the emoji data used by Mattermost violate Apple's license terms. It is important to understand that contributing to code that uses it poses a risk to individual contributors.

So I want to migrate it to open source emoji-data and use other images/emoji-fonts or just system fonts, but Mattermost's emoji codebase is pretty complicated.

It seems better suited for the core team. After resolving issues across the webapp and the redux, it will be easier for other contributors to improve the emoji picker.

@esethna
Copy link
Contributor

esethna commented Jun 29, 2020

Thanks for the details @cometkim, closing this PR. I agree it would make sense to bring this in the core team

@esethna esethna closed this Jun 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Work in Progress Not yet ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants