-
Notifications
You must be signed in to change notification settings - Fork 13.8k
regression: combined picker emojis split into separate symbols #41534
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # emoji | ||
|
|
||
| Generates the emoji test fixture used by `@rocket.chat/message-parser`'s coverage test. | ||
|
|
||
| ## `generateEmojiFixture.mjs` | ||
|
|
||
| Writes `packages/message-parser/tests/fixtures/allEmoji.ts` โ the full list of every emoji `emojibase-data` ships. The message-parser coverage test parses each one and asserts it is recognized as a single emoji. | ||
|
|
||
| ### When to run it | ||
|
|
||
| After bumping the `emojibase-data` dependency to a newer Unicode version: | ||
|
|
||
| ```bash | ||
| node scripts/emoji/generateEmojiFixture.mjs | ||
| ``` | ||
|
|
||
| ### Why | ||
|
|
||
| The fixture is a committed snapshot, not generated at test time. Regenerating it after a bump adds the newly-introduced emojis to the sweep, so any that the parser grammar doesn't yet recognize fail the test and flag exactly what needs a new grammar rule. Without regenerating, new emojis simply wouldn't be covered. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Regenerates the emoji test fixture (packages/message-parser/tests/fixtures/allEmoji.ts) from | ||
| // emojibase-data โ the canonical set the coverage test parses. Snapshot: rerun after bumping the | ||
| // dependency. Run: node scripts/emoji/generateEmojiFixture.mjs | ||
|
|
||
| import { writeFileSync } from 'node:fs'; | ||
| import { createRequire } from 'node:module'; | ||
|
|
||
| const require = createRequire(import.meta.url); | ||
| const data = require('emojibase-data/en/data.json'); | ||
| const { version } = require('emojibase-data/package.json'); | ||
|
|
||
| // Every base emoji + skin-tone variant, de-duplicated. | ||
| const set = new Set(); | ||
| for (const e of data) { | ||
| if (e.emoji) { | ||
| set.add(e.emoji); | ||
| } | ||
|
|
||
| for (const s of e.skins ?? []) { | ||
| if (s.emoji) { | ||
| set.add(s.emoji); | ||
| } | ||
| } | ||
| } | ||
| const emojis = [...set]; | ||
|
|
||
| // One space-separated string split at runtime โ a single compact line, not thousands. No emoji | ||
| // contains a space, and prettier-ignore keeps it off Prettier's long-line wrapping. | ||
| const out = `// Auto-generated by scripts/emoji/generateEmojiFixture.mjs โ do not edit by hand. | ||
| // Full emoji set from emojibase-data@${version} (${emojis.length} entries: base + skin-tone variants). | ||
| // Regenerate after bumping emojibase-data: node scripts/emoji/generateEmojiFixture.mjs | ||
|
|
||
| export const EMOJIBASE_VERSION = '${version}'; | ||
|
|
||
| // prettier-ignore | ||
| export const ALL_EMOJI: readonly string[] = '${emojis.join(' ')}'.split(' '); | ||
| `; | ||
|
|
||
| const target = new URL('../../packages/message-parser/tests/fixtures/allEmoji.ts', import.meta.url); | ||
| writeFileSync(target, out); | ||
| console.log(`Wrote ${emojis.length} emojis (emojibase-data@${version}) to ${target.pathname}`); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.