-
Notifications
You must be signed in to change notification settings - Fork 47k
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
[ReactDOMFactories] Reduce byte size #5759
[ReactDOMFactories] Reduce byte size #5759
Conversation
This was meant to be safe against Closure advanced mode. Is this actually smaller after gzip? |
I don't see how that would not be safe againts GCC advanced mode, but I'll make sure everything works and that the gzip size is better. |
Because app code that does |
@zpao |
Yes, we don't but the goal with the GCC support was so that somebody could if they wanted (eg clojurescript). |
|
@zpao, thx for the data! I've been a bit lazy with this PR. |
@fabiomcosta Did you verify it works with GCC? |
AFAIK anyone relying on |
@syranide Yeah, I agree, we don't want to break that. |
@syranide from my understanding this is unrelated to this change. This change won't change the component names from |
@fabiomcosta |
@fabiomcosta I just looked at the example you posted, I think @syranide is correct, this doesn't minify safely for properties like |
@syranide @jimfb, cool, I see, I can see now that it does the same for If the current code wants to be safe with GCC it would have to use the key from the "big object" as the key that is added to |
mapObject preserves keys. |
@spicyj, I don't know what I was thinking, you're right. Sorry for the confusion. |
Since the object keys and valus are always the same I decided to transform that to an array.
That should save some bytes from the JS package.
Traversing an array should also be faster than
mapObject
, which should make this module initialize faster.