profile
viewpoint
Andreas Svensson syranide Cetrez Sweden

gaearon/react-deep-force-update 97

Force-updates React component tree recursively

syranide/react-swf 67

Shockwave Flash Player component for React

syranide/shivie8 12

Minimal HTML5 element shiv for IE8

syranide/surgical 6

Surgical is a declarative JavaScript library with native DOM flexibility and performance, for building fast UIs.

syranide/react-root-store 4

React per-root store provider

syranide/react-unmount-listener-mixin 4

React mixin for listenable componentWillUnmount

syranide/swf-player-version 4

Shockwave Flash Player version utility

issue commentfacebook/react

Bug: styles object using css variables and both a shorthand and a specific property renders incorrectly

Just to illustrate; it used to be, and I assume it still is, that setting a shorthand property incurs the same cost as if you individually set all the properties it decomposes into. So if you have e.g. font + font-size and change either of them, it would effectively incur something like 1+7 property updates instead of just 1, on-top of that you have the additional non-trivial cost of having React check for the overlap. And it is even worse when it comes to e.g. border which decomposes in several steps.

It could be that given the improved state of browsers nowadays that the cost might be negligible when compared to the related rendering costs. But I haven't done any tests lately so I wouldn't know.

joaomoleiro

comment created time in 2 months

issue commentfacebook/react

Bug: styles object using css variables and both a shorthand and a specific property renders incorrectly

@bvaughn Hey! I can't speak for the CSS-variable part of this question. But not supporting overlapping styles is simply put a performance/complexity problem. If React does not support overlapping styles it can naively iterate the prev/next and apply any changes as a property, very quick and simple. If overlapping styles are supported then React must have knowledge of how shorthand properties are decomposed and to be able to figure out whether a changed property shadows/overlaps another property and apply them in correct order. This is significantly slower, more complex and rather fragile. I'm not aware of any way of solving this issue without incurring significant overhead costs given the current set of features exposed by browsers, which depending on what kind of performance/use-case one expects out of React makes it unacceptable.

Since I'm not actively involved nowadays I can't speak for why there still isn't a warning, but I would positively think it's because "no one has got around to building it" as you say. The warning should be rather straightforward to implement for at least the current/common set of properties.

joaomoleiro

comment created time in 2 months

issue commentfacebook/react

Warning: Unknown DOM property autocomplete. Did you mean autoComplete?

@michael-freidgeim-webjet https://github.com/facebook/react/blob/f85aadefc0c059648ee53842ba948a7d7cba468b/packages/react-dom/src/shared/possibleStandardNames.js is probably what you are looking for.

mockdeep

comment created time in 4 months

more