Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Upgrade to Emoji-Mart v5 #128

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

[WIP] Upgrade to Emoji-Mart v5 #128

wants to merge 7 commits into from

Conversation

rugk
Copy link
Owner

@rugk rugk commented Jun 15, 2022

Attention: This is a draft and does not work yet.

Fixes #116

FYI @tdulcet sorry and thanks for making me aware of the priority here (keep doing that), I already had a branch in progress, so I just created this draft PR. It does not wokr and I got stuck though, see below.

@@ -5,6 +5,8 @@
*/

import * as EmojiSelect from "./EmojiSelect.js";
import data from "/node_modules/@emoji-mart/data";
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem in the official guide was that this is not an ECMAstandard apparently. This here should load a combined JSON, but dpoes not work in Firefox like this.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I now tried using the unpkg version, but it did not work in my testing before, too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, one cannot yet import JSON files as a module (see here). I believe the solution would be to remove this line and then use a hack like this below:

const emojiPicker = new EmojiMart.Picker({ ...initProperties, data: async () => {
    const response = await fetch(browser.runtime.getURL("/node_modules/@emoji-mart/data/sets/14/native.json"));
    return response.json();
}});

"homepage": "https://github.com/rugk/awesome-emoji-picker#readme",
"dependencies": {
"@emoji-mart/data": "^1.0.1",
"emoji-mart": "^5.0.0"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

console.log(data);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: rmeove when finished ebugging :O

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emoji v13/v13.1/v14/v15/v15.1 support
2 participants