Split out emoji library from emoji picker. π»
See original GitHub issueJust want to get a comment form the emoji-mart contributors.
Iβm going to work on a fork that will split out using Higher Order Components the rendering of the emoji-picker and the datasource.
At present, they are all bundled together, the picker imports directly the generate data.js
file. However, I believe this complicates the the release cycle as often the underlying dataset will change more than the picker does.
Secondly, in my use case, the application uses the emoji dataset elsewhere. For example, in an rich text editor autocomplete. And in string replace to replace emoji with images when viewed on a older platform, or Windows. So it doesnβt make sense to have two copies of the emoji library.
Since making the changes required would likely result in an API change I wanted to get a feel for comments first before I started, especially related to component naming.
Something like:
Works as normal, uses localstorage and internal data library.
<Picker />
Picker
would just wrap the SimplePicker
and provide it with the internal data and localstorage functions. However, my application could consume the lower level component directly, which Iβve called SimplePicker
which would expect the storage/dataset functions to be injected into it.
const data = application.loadEmojiDataLib();
const saveSkinTone = skinTone => application.storeUserPreference({ skinTone });
<SimplePicker data={data} onSkinTonePreferenceChange={saveSkinTone} />
This means that by referencing only the SimplePicker, webpack would not bundle the included emoji dataset in my application code.
Thoughts / comments? π¬
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:24 (6 by maintainers)
Iβm also seeing all.json show up together with twitter.json when I use the NimblePicker and set it to use the twitter.json data.
Using emoji-mart 2.6.1 with webpack 3.11.0, all the following ways of importing result in all.json Γ‘nd twitter.json in the bundle:
import { NimblePicker } from 'emoji-mart'
import { NimblePicker } from 'emoji-mart/dist-es'
import NimblePicker from 'emoji-mart/dist/components/picker/nimble-picker'
import NimblePicker from 'emoji-mart/dist-es/components/picker/nimble-picker'
Any ideas/suggestions for a patch/solution are welcome π Or is Webpack 3 not supported? Current situation doesnβt allow me to upgrade to Webpack 4.
This is still an issue. The NimblePicker also includes the all.json file.