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
base: master
from

Conversation

Projects
None yet
2 participants
@nhunzaker
Collaborator

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

nhunzaker added some commits Apr 8, 2016

Update custom attribute logic
- Only allow string attributes
- Remove custom attribute feature flag
- Add additional tests for data, aria, and custom attributes

@nhunzaker nhunzaker changed the title from Custom Attributes Scenario 2 to Custom Attributes Scenario 1 Aug 7, 2017

@nhunzaker nhunzaker changed the title from Custom Attributes Scenario 1 to Custom Attributes Scenario 1: Do not write badly cased attributes Aug 7, 2017

@nhunzaker nhunzaker changed the title from Custom Attributes Scenario 1: Do not write badly cased attributes to Custom Attributes Scenario 1: Do not write badly cased attributes. Keep Whitelist. Aug 7, 2017

@nhunzaker

This comment has been minimized.

Show comment
Hide comment
@nhunzaker

nhunzaker Aug 7, 2017

Collaborator

Closing this out in favor of #10385

Collaborator

nhunzaker commented Aug 7, 2017

Closing this out in favor of #10385

@nhunzaker nhunzaker closed this Aug 7, 2017

@gaearon gaearon deleted the nh-strip-whitelist branch Oct 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment