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

Add parent components and data property for components that reference data.js Issue#86 #178

Merged
merged 11 commits into from
Apr 30, 2018

Conversation

davidcilley
Copy link

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!

@EtienneLem EtienneLem merged commit 1edf3ea into missive:master Apr 30, 2018
@EtienneLem
Copy link
Member

Thanks a bunch for the work on that @davidcilley 🤘

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.

2 participants