refactor: remove emoji-datasource from dependcies#7174
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3132ee7 to
edd2a9e
Compare
74d11f5 to
ceec410
Compare
edd2a9e to
b0d1975
Compare
b0d1975 to
c958369
Compare
|
🧪 Flashlight Performance Report (AWS Device Farm) 🔀 Commit: ade1831
|
|
Nice cleanup! Didn't fully review yet, but one thought I had was if we should not keep commiting the generated file to git? If we commit it:
I know we do compile time generation of e.g networks.json, but this is a non-deterministic generation fetching data from a live api vs the emoji process which is a pure deterministic transform. |
| const emojiDatasource = require('emoji-datasource'); | ||
| const { CATEGORY_ID_BY_CATEGORY_NAME } = require('../src/features/emoji/constants'); | ||
|
|
||
| const OUTPUT_PATH = path.resolve(__dirname, '../src/features/emoji/models/emojis.json'); |
There was a problem hiding this comment.
I think we should keep generated files out of features. Mixing generated files with actual src is confusing and makes it hard to judge what is actual source and what is not. Also gitignoring things deep inside src seems wrong (that goes away if we commit the file though which I rec, see my overall comment on the PR).
src/references is the canonical place for generated data today, keeping it there is more predictable IMO. Optimally, it should prob be named assets or similar, and the generated graphql should move there too, but that's for another time.
|
|



Description
emoji-datasourcewas only being used as a static source for emoji lookups and avatar picker data, but it adds unnecessary dependency, which results intoadditional 0.96Mb for bundle size.This PR replaces that dependency with a compact in-repo emoji catalog (
emojiByName+avatarEmojis) so emoji resolution and avatar selection keep the same behavior while cutting the large JSON dataset and removing the external package.As a result of these changes the bundle size is decreased by 0.96Mb!