-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Revert SVG passthrough and expand whitelist #6243
Conversation
zpao@22aacce is really the most obvious change. It's after the reverts and before any optimization attempts so is purely the new attributes over 0.14. |
@zpao updated the pull request. |
ok. We'll revisit if we need to in the future. |
We're using this value to check bits and null is 0 in that sense anyway. This shaves off a few bytes (though as expected, gzip is virtually unchanged)
@zpao updated the pull request. |
Revert SVG passthrough and expand whitelist
We will also need to update the docs before the release, right? |
Correct, we've done this in the past for the other releases and we just On Tuesday, March 15, 2016, Dan Abramov notifications@github.com wrote:
|
Based on some discussions, this reverts a few commits that changed our SVG behavior to pass through all attributes to the node directly. After a lot of discussion that came in after the RC (see #6211), we mostly agree that while the move to pass through was a great effort and ultimately might be where we should go with attributes, it left us in an inconsistent state for our HTML and SVG behaviors. That's not awesome as there are already a number of things that must be learned for React and throwing in another inconsitency doesn't help. So we'll backpedal for now but still continue to provide full SVG support by going back to our previous whitelist and expanding it.
The list here was compiled with (a version of) https://gist.github.com/zpao/4f5ce1d96b11b8a70e07 which scrapes MDN for all of its SVG attributes.
Some additional changes in here as an effort to reduce bytesize. Specifically, since there are a lot of things in SVG that need to be mapped, we're duplicating the keys a lot. We can take some shortcuts to build the config with code so I did that. I also replaced all the
null
s in our config with a zero.null
was a placeholder value that we weren't using (only using it to check masks and it's 0 anyway for that).