Re: [css-houdini-drafts] [css-properties-values-api] Registering properties in JS could have performance impact (#940)

The Houdini Task Force just discussed `perf concerns of custom properties`.

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: perf concerns of custom properties<br>
&lt;TabAtkins> github: https://github.com/w3c/css-houdini-drafts/issues/940<br>
&lt;iank_> smfr: One if the issues w/ this being a JS api, is that there isn't a good time to register the properties.<br>
&lt;iank_> smfr: e.g. stylesheet loads, prop registered, need to recalc stylesheet potentially.<br>
&lt;iank_> smfr: Similar to style recalc thrashing.<br>
&lt;iank_> smfr: Has been a proposal for a declarative version of registered custom properties.<br>
&lt;heycam> q+<br>
&lt;iank_> TabAtkins: It seems like you have the same issues, e.g. if the properties come later in a sheet, or a later style sheet.<br>
&lt;heycam> q-<br>
&lt;iank_> smfr: B/c you only have to parse the properties once. And it'll come in a "batch."<br>
&lt;iank_> dino: You could imagine a bunch of component libs, which each register a custom properties.<br>
&lt;iank_> dino: If delcarative, they come all at once.<br>
&lt;iank_> TabAtkins: How is this different to JS setting this to something different each time?<br>
&lt;iank_> TabAtkins: You need to rerun all the style on the root.<br>
&lt;iank_> smfr: It depends how much work you need to do if the type changes.<br>
&lt;iank_> TabAtkins: If you have an untyped its still the same.<br>
&lt;iank_> TabAtkins: If its still the same, is there much of a concern still?<br>
&lt;iank_> smfr: We should try not to add new APIs let authors pull trigger for a performance cliff.<br>
&lt;iank_> TabAtkins: Would we get everything from the declarative appraoch, yes at the moment, but future levels, e.g. hooks, then no.<br>
&lt;iank_> smfr: Can we just to declar version atm?<br>
&lt;iank_> TabAtkins: As they are equiv. in power. But would be in favour if rewriting the spec to make the declarative version much more promiment.<br>
&lt;iank_> dino: In the spec if it calls out - most optimal way to declare all of them at top, then use them. And explain in the spec to do this.<br>
&lt;iank_> smfr: Also call out how to correctly use the JS api.<br>
&lt;iank_> majidvp: In JS api, you only need to do this if you trigger style reclac.<br>
&lt;iank_> emilio: Did agree that JS -reg properties, @property do not conflict. JS API won't throw.<br>
&lt;iank_> TabAtkins: That's in the pending edits.<br>
&lt;iank_> TabAtkins: JS stuff is on a separate layer.<br>
&lt;iank_> dino: What would happen? Ignored?<br>
&lt;iank_> TabAtkins: JS api wins. Treated as the "last" one.<br>
&lt;iank_> dino: If browser only supports JS version, nothing special.<br>
&lt;iank_> smfr: I have another thing related to animating untyped custom properties.<br>
&lt;smfr> https://codepen.io/smfr/pen/JjPerWw<br>
&lt;iank_> smfr: Question is - to do animation of untyped animated propeties, do you need to rerun the style-recalc each frame?<br>
&lt;iank_> TabAtkins: No, it flips 1/2 way through the animation.<br>
&lt;iank_> TabAtkins: All unreg. custom props are discreet.<br>
&lt;iank_> smfr: ok<br>
&lt;iank_> fremy: If you animate the custom property, and use it in another property which animates?<br>
&lt;iank_> emilio: Everyone is different (only FF gets it right?)<br>
&lt;iank_> TabAtkins: We discussed this years ago, there are like 16 options.<br>
&lt;iank_> dbaron: 6.<br>
&lt;iank_> TabAtkins: There were sub-options.<br>
&lt;iank_> majidvp: What happens when you reg. a type for that custom prop while animationing.<br>
&lt;iank_> TabAtkins: Just changes the value of the custom prop.<br>
&lt;iank_> TabAtkins: If that's unclear, happy to add somethign.<br>
&lt;iank_> heycam: Thats different to when you change font-size?<br>
&lt;iank_> TabAtkins: Yes - it changes the value of the property, e.g. from a token-stream to a &lt;length><br>
&lt;iank_> heycam: In web-anim is it possible to change the from value.<br>
&lt;iank_> TabAtkins: I believe it kicks off a new transition. Not entirely clear how this works.<br>
&lt;iank_> majidvp: web-anim for the duration of the animation, when you start the animtion the curve is computed, but transitions are different.<br>
&lt;iank_> TabAtkins: Sounds like it answers the relevant questions \o/<br>
&lt;iank_> smfr: Can we talk about the status?<br>
&lt;iank_> smfr: Hesitant to implement all the syntaxes.<br>
&lt;iank_> TabAtkins: Isn't that what we do right now?<br>
&lt;iank_> TabAtkins: A handful of primitive types, w/ + and *<br>
&lt;iank_> smfr: I thought it was more that that?<br>
&lt;iank_> TabAtkins: No there isn't the possibility for needing to decide what part of the syntax to match.<br>
&lt;iank_> TabAtkins: 3.1 describes all that you can do.<br>
&lt;iank_> TabAtkins: thing+ | other-thing+ etc,<br>
&lt;iank_> &lt;br type="morning-tea" length="30m"><br>
&lt;majidvp> github: https://github.com/w3c/css-houdini-drafts/issues/945<br>
&lt;TabAtkins> github: https://github.com/w3c/css-houdini-drafts/issues/940<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/940#issuecomment-533373807 using your GitHub account

Received on Friday, 20 September 2019 02:07:05 UTC