-
Notifications
You must be signed in to change notification settings - Fork 85
Drop duplicate CSS property definitions when curating data #555
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
Conversation
This adds a new data curation step that drops duplicate CSS property definitions from CSS extracts whenever possible, in other words when we know which definition is the authoritative one. The code contains a list of known superseding relationships between specs to choose the right one. See discussion in #127 for details. CSS properties that get re-defined in a delta spec are ignored, meaning that a naive merge of all curated CSS extracts will still contain such duplicates. A typical solution to end up with a consistent merge would be to exclude delta specs from that merge. This is left to data consumers as some may choose to rather live on the bleeding edge. The curated data may still contain duplicate CSS property definitions, but these will get caught by tests. The new tests also check that CSS extracts contain a base CSS property definition for all CSS properties that get extended (through `newValues`).
Hmm, there is actually a bug in the code, because Two additional notes:
|
The `requireFromWorkingDirectory` function used `require`, which caches objects in memory. That is good for modules and functions. That is usually a bad idea for JSON objects that code often modifies in place. The new loadJSON reads and parses JSON files from storage to avoid conflicts.
This adds unicity of CSS property definitions and presence of base CSS property definitions to the list of guarantees that we make for CSS extracts.
I also completed the READMEs to mention the new guarantees. The whole thing does not introduce any backward incompatibility, but should we still consider that this should trigger a major bump of the CSS package given that it drops (duplicate) property definitions from a number of CSS extracts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to major bump
This adds a new data curation step that drops duplicate CSS property definitions from CSS extracts whenever possible, in other words when we know which definition is the authoritative one. The code contains a list of known superseding relationships between specs to choose the right one. See discussion in #127 for details.
CSS properties that get re-defined in a delta spec are ignored, meaning that a naive merge of all curated CSS extracts will still contain such duplicates. A typical solution to end up with a consistent merge would be to exclude delta specs from that merge. This is left to data consumers as some may choose to rather live on the bleeding edge.
The curated data may still contain duplicate CSS property definitions, but these will get caught by tests. The new tests also check that CSS extracts contain a base CSS property definition for all CSS properties that get extended (through
newValues
).