-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update attributes list with latest additions and removals from react …
…attribute whitelist (#23)
- Loading branch information
1 parent
5eb31f2
commit 767f39b
Showing
3 changed files
with
36 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// this script diffs the react attribute whitelist with the one react html parser maintains | ||
// to determine if it is out of date | ||
// the build:lib task must have been run before this can work | ||
|
||
const currentProperties = require('../lib/dom/attributes/ReactAttributes').default; | ||
const reactProperties = require('react-dom/lib/HTMLDOMPropertyConfig').Properties; | ||
|
||
const changes = {}; | ||
|
||
const currentKeys = Object.keys(currentProperties).map(key => currentProperties[key]); | ||
const reactKeys = Object.keys(reactProperties); | ||
|
||
// attributes that have been added to react | ||
reactKeys.forEach(key => { | ||
if (currentKeys.indexOf(key) === -1) { | ||
changes[key] = 'add'; | ||
} | ||
}); | ||
|
||
// attributes that have been removed from react | ||
currentKeys.forEach(key => { | ||
if (reactKeys.indexOf(key) === -1) { | ||
changes[key] = 'remove'; | ||
} | ||
}); | ||
|
||
console.log(changes); // eslint-disable-line no-console |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ export default [ | |
'muted', | ||
'novalidate', | ||
'open', | ||
'playsinline', | ||
'readonly', | ||
'required', | ||
'reversed', | ||
|
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