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

Custom Attributes Scenario 1: Do not write badly cased attributes. Keep Whitelist. #10397

Closed
wants to merge 23 commits into from

Conversation

nhunzaker
Copy link
Contributor

@nhunzaker nhunzaker commented Aug 7, 2017

Follow-up work from #7311. This PR implements scenario 1 for custom attributes, as described in #7311 (comment):

  1. The attribute whitelist enforces casing for all known attributes
  2. Badly cased entries in the attribute whitelist are not written to the DOM
  3. Attributes not within the whitelist are assigned regardless of casing
  4. The ARIA whitelist has been moved to a developer-only enforcement (but the logic is the same as master)

This approach is more strict than scenario 2. Badly cased attributes will not show up in the DOM. However this enforcement means that we can not remove many entries in the attribute whitelist.

Build size:

react-dom.production.min.js: 116.33 KB (37.01 KB gz)

screen shot 2017-08-07 at 8 12 26 am

- Only allow string attributes
- Remove custom attribute feature flag
- Add additional tests for data, aria, and custom attributes
@nhunzaker nhunzaker changed the title Custom Attributes Scenario 2 Custom Attributes Scenario 1 Aug 7, 2017
@nhunzaker nhunzaker changed the title Custom Attributes Scenario 1 Custom Attributes Scenario 1: Do not write badly cased attributes Aug 7, 2017
@nhunzaker nhunzaker changed the title Custom Attributes Scenario 1: Do not write badly cased attributes Custom Attributes Scenario 1: Do not write badly cased attributes. Keep Whitelist. Aug 7, 2017
@nhunzaker
Copy link
Contributor Author

Closing this out in favor of #10385

@nhunzaker nhunzaker closed this Aug 7, 2017
@gaearon gaearon deleted the nh-strip-whitelist branch October 6, 2017 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants