-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the suffix of class names deterministic based on their values.
Summary: Use a hash of the styles for each class name to determine the suffix added to the name. This means that if multiple styles are created in different places with the same values, they will use the same class. This is mostly useful for ensuring that the suffixes are generated the same on both servers and clients. I'm still not 100% sure that `JSON.stringify` necessarily produces the same results on all clients. It looks like ES2015 compliant browser engines have defined property order that we can count on, but I'm not sure if there are any of those yet? But Ben Alpert has made a convincing case that Facebook would break if browsers didn't have consistent ordering so.... Test Plan: - `npm run test` Reviewers: jlfwong, csilvers Reviewed By: jlfwong, csilvers Subscribers: alpert, csilvers, john Differential Revision: https://phabricator.khanacademy.org/D24493
- Loading branch information
Showing
5 changed files
with
213 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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