Add parent components and data property for components that reference data.js Issue#86 #178
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.
While using EmojiMart at Trello, we found the need to input our own i18n'd data. This pull request is an attempt to create all of the original emoji-mart component behavior, while decoupling it from the large dataset contained in data.js.
This adds a parent-like component prefixed with "Nimble" for the following objects:
Picker, Category, Emoji, Preview, Search
The parent components now have a required data property so that a partial or changed version of the original data.js output can be used. The child components pass the original data.js output to maintain backwards compatibility.
This also updates several of the util methods to allow for data passage. One possible breaking change, "emoji-index.js" now has an instanced version of the original globals, and uses a new instance of NimbleEmojiIndex with data.js as it's input.
I've attempted to keep data.js from being referenced throughout all of the new Nimble components, but in my test app, WebPack was still outputting the original data, even though I was referencing the components directly. This may still need some tweaking to fully address Issue #86
This version differs from my original attempt by maintaining as much of the original codebase, while adding parent-child relationships, and renaming when possible. The file with the most changes is "emoji-index.js" because it's been turned into a reusable object. Turning off whitespace diffs makes it easier to see what's actually changed.
Also, there were a bunch of changes since I started on this, and I've attempted to maintain as much of them as I can, but it's possible that I've missed something. Please let me know if you'd like any changes!