06:38:03 RRSAgent has joined #custom-attrs 06:38:07 logging to https://www.w3.org/2025/11/12-custom-attrs-irc 06:38:07 RRSAgent, do not leave 06:38:08 RRSAgent, this meeting spans midnight 06:38:08 RRSAgent, make logs public 06:38:10 Meeting: Custom attributes for all elements 06:38:10 Chair: Keith Cirkel, Lea Verou 06:38:10 Agenda: https://github.com/w3c/tpac2025-breakouts/issues/46 06:38:10 Zakim has joined #custom-attrs 06:38:11 Zakim, clear agenda 06:38:11 agenda cleared 06:38:11 Zakim, agenda+ Pick a scribe 06:38:12 agendum 1 added 06:38:12 Zakim, agenda+ Reminders: code of conduct, health policies, recorded session policy 06:38:12 agendum 2 added 06:38:12 Zakim, agenda+ Goal of this session 06:38:14 agendum 3 added 06:38:14 Zakim, agenda+ Discussion 06:38:14 agendum 4 added 06:38:15 Zakim, agenda+ Next steps / where discussion continues 06:38:16 agendum 5 added 06:38:16 Zakim, agenda+ Adjourn / Use IRC command: Zakim, end meeting 06:38:16 agendum 6 added 06:38:16 breakout-bot has left #custom-attrs 07:04:06 tantek-projector has joined #custom-attrs 07:13:53 alisonmaher has joined #custom-attrs 07:13:57 present+ 07:15:22 smaug has joined #custom-attrs 07:15:28 kizu has joined #custom-attrs 07:15:33 present+ 07:15:38 christianliebel has joined #custom-attrs 07:15:45 lea has joined #custom-attrs 07:15:46 keithamus has joined #custom-attrs 07:15:48 theparkagen has joined #custom-attrs 07:15:49 JakeA has joined #custom-attrs 07:15:49 astearns has joined #custom-attrs 07:15:51 noamr has joined #custom-attrs 07:15:55 ydaniv has joined #custom-attrs 07:15:56 westbrook has joined #custom-attrs 07:15:59 Zakim, start meeting 07:15:59 RRSAgent, make logs Public 07:16:01 jan has joined #custom-attrs 07:16:01 please title this meeting ("meeting: ..."), keithamus 07:16:01 frehner has joined #custom-attrs 07:16:03 ScribeNick: noamr 07:16:04 present+ 07:16:07 present+ 07:16:08 present+ 07:16:08 meeting: Custom Attributes for all 07:16:08 present+ 07:16:15 present+ 07:16:21 LeoLee has joined #custom-attrs 07:16:34 present+ 07:16:35 jan has joined #custom-attrs 07:16:40 present+ 07:16:52 TabAtkins has joined #custom-attrs 07:17:10 JRJurman has joined #custom-attrs 07:17:27 keithamus: use case first. I want to find a way to have lifecycle hooks for attributes 07:17:27 room is muted 07:17:30 present+ 07:17:35 zcorpan has joined #custom-attrs 07:17:54 ... prior to the react rewrite at github, we used mutation observers to respond to attribute changes. kind of an "HTML mixin" 07:18:15 Room is muted in Zoom 07:18:17 ... e.g.
, e.g. for authentication, with a sudo dialog 07:18:35 ... gives you superpowers on the elemeent 07:19:44 .... libraries like turbo used this to mark regions for later updates 07:20:15 ... mutation observers are clunky. we used a 10000 char long selectors which had bugs 07:21:01 ... e.g define a class that extends an Attribute, and it would get connectedCallback/disconnectedCallback/changeCallback 07:21:20 q+ 07:21:23 ... use cases are well defined. we're not sure about constraints, probably similar to custom elements, e.g. naming constraints 07:21:52 lea: mutation observers are not trivial, because of shadow roots, you can't select across shadow root or observe across roots 07:22:12 keithamus: a list of use cases. see possibilities. linked in IRC 07:22:29 keithamus: https://workflowy.com/s/use-cases-for-custom/wpPt2tuPRhvpk3fW 07:22:53 https://github.com/w3c/tpac2025-breakouts/issues/46 07:22:55 q+ 07:23:13 jugglinmike has joined #custom-attrs 07:23:19 Haruki has joined #custom-attrs 07:23:25 present+ jugglinmike 07:23:27 JakeA: disconnectedCallback. do you still know which element this is? 07:23:40 q+ 07:23:55 q- 07:24:12 JakeA: might be too have the old element in the callback 07:24:41 spectranaut_ has joined #custom-attrs 07:24:50 keithamus: I was imagining that disconnectedCallback would be called when the attribute node is disconnected 07:25:10 keithamus: it would fire whenever it is connected to an element 07:25:22 q? 07:25:27 ack smaug 07:25:34 https://github.com/WICG/webcomponents/issues/1029 07:26:00 zcorpan: you want to know when you set/remove the attributes but also when the element is connected/disconnected 07:26:32 plinss: I would expect it would work the same as connecting nested element trees 07:26:52 keithamus: I suppose it could have added/removed callbacks that would surface this 07:26:54 q? 07:27:03 ack lea 07:27:07 q+ 07:27:19 q+ 07:27:32 lea: connectedCallback has an established minutes, but for attributes you can see it both ways. the q of what connectedCallback does for the attributeNode is still open in that way 07:28:18 keithamus: what I would like to do is match the same semantics. connectedCallback is as similar as possible as connectedCallback in elements. it's cheap to implement new callbacks 07:28:30 rniwa: do you call the constructor when the attribute is added? 07:28:52 plinss: persume it's called when the attribute is set 07:29:07 rniwa: e.g. you add attribute foo, and then set to a different value 07:29:25 JakeA: probably the same as the DOM 07:29:59 keithamus: one constructor call for the lifetime of the attribute. following attribute calls would change it in place 07:30:04 q- 07:30:32 keithamus: emilio was concerned about Attr. sometimes engines don't construct this. potential cost. 07:30:40 q+ 07:30:41 smaug: was going to ask about this 07:30:44 ack smaug 07:31:09 smaug: implementations optimize attributes... they are not Attribute objects in the implementation 07:31:13 https://dom.spec.whatwg.org/#dom-element-setattribute - updates the existing attribute. This works in terms of instances too. 07:31:24 zcorpan: might be better to have disconnectedFromAttr 07:31:29 saku has joined #custom-attrs 07:31:36 q- 07:31:38 q+ 07:32:47 keithamus: emilio suggested that we have a controlling class that manages the entire document's list of these attributes. not like custom elements, but for all instances of an attribute. worried about ergonomics 07:32:51 q+ 07:33:12 zcorpan: I wonder if it makes sense to put the lifetime on the element 07:33:23 ack zcorpan 07:33:42 rniwa: that's not how attr works 07:34:16 zcorpan: thinking on this in terms of how this is spec'ed 07:34:33 ack lea 07:34:56 lea: I tested what happens today. if you set attribute and then it change its value its preserved. if you remove it and re-set it you get a new attribute node 07:35:11 https://usercontent.irccloud-cdn.com/file/A8Q6VeVY/image.png 07:35:11 rniwa: set is change is in place 07:35:17 q? 07:35:35 noamr: the way i'm used to working with this in libraries 07:35:44 noamr: is to think of it like a Mixin, rather than a pair of attributes 07:35:47 q+ 07:35:51 noamr: several xample of shared state, like commandfor 07:35:56 lea: ahh yeah, I was thinking of another thing 07:35:58 q+ 07:36:07 noamr: it relates to an element, but thinking of it like a Mixin feels better to me as an author 07:36:14 noamr: was wondering if you'd thought of it like that 07:36:34 keithamus: using this system i'd probably use event dispatch on Attr nodes to handle cooperation 07:36:40 keithamus: but I could see it getting clunky 07:36:54 keithamus: looking at use-cases on GitHub codebase, I coudln't see many that relied heavily on cooperation 07:37:08 keithamus: so I wonder if there is appetite for more of these cooperative attributes vs standalone ones 07:37:12 https://usercontent.irccloud-cdn.com/file/9piDB1yF/Screenshot%202025-11-12%20at%2016.37.05.png 07:37:14 keithamus: I could foresee using event dispatch on the attribute node for collaboration, perhaps it's clunky. at least on github we didn't rely on heavily on cooperation. I wonder if there was appetite for this cooperative usage of attribute 07:37:16 keithamus: from my exp it seems like standalone is more predominant 07:37:18 lea: ^ 07:37:37 rniwa: there might be behavior that needs to change, regardless of an attribute 07:37:50 :D 07:38:09 q? 07:38:15 rniwa: it's places where we need more mixins 07:38:17 ack noamr 07:38:37 q+ 07:38:40 westbrook: there was an idea about a single container class, but sounds like it's across shadow boundaries 07:38:54 q- 07:39:04 ack lea 07:39:16 lea: about mixins, there are many cases where multiple attribute collaborate 07:39:36 ... there is a discussion about class composition which is pertinent to this 07:40:17 noamr: reminder about the complexity around leveraging these on built-ins... 07:40:37 keithamus: one of the interesting thing is that customized built-ins is that you can use this attributes for customizing builtins in a more palatable way 07:40:39 q+ 07:41:05 keithamus: there is a lack of ability to using these things on mixins 07:41:35 lea: some proposals can apply to existing classes 07:41:41 zcorpan has joined #custom-attrs 07:41:59 JakeA: patching built-ins is interesting. e.g. form that behaves like a form with enhancements 07:42:02 Or just exposing `observedAttributes` and `attributeChangedCallback` on `HTMLElement`? 07:42:25 JakeA: is it possible to transport an Attr node between elements 07:43:04 q- 07:43:11 q- 07:43:11 rniwa: one design constraint for mutation observer is that they can chain 07:43:32 ... I wonder if we need to consider this in regards to custom elements affecting each other in unexpected ways 07:44:01 keithamus: even if we establish a contract, nothing is stopping authors from doing this 07:44:08 ... good feedback 07:44:14 q? 07:44:43 plinss: re mixins, I am concerned re "I'm used to doing this" 07:44:46 sorvell9 has joined #custom-attrs 07:45:03 ... there is value in doing it this way 07:45:32 q+ 07:45:32 ... it's common in custom elements to reflect between properties and attributes 07:45:41 ack plinss 07:46:06 keithamus: we proposed having static definition of reflection 07:46:30 lea: it might solve it sooner if it doesn't solve this problem 07:46:37 plinss: it's not a hard requirement 07:47:08 plinss: it's nice if it fits into whatever lands 07:47:25 keithamus: lots of issues about cleaning up that stuff 07:47:44 plinss: would be good to solve this in the grander scheme 07:48:03 lea: it's tedious and error prone to do this manually 07:48:41 keithamus: there will be some broilerplate on the custom element to do the attribute/property reflection 07:50:24 q? 07:50:30 ack lea 07:50:52 rniwa: about registration lifecycle 07:51:13 zcorpan: you can have a filtered list of tag names for each attribute name 07:52:22 zcorpan: I don't think we want to set random properties on existing elements 07:52:43 keithamus: some only make sense only for an element 07:52:44 lea: or a class of elements 07:53:01 keithamus: not sure if that should be in the engine vs. userland 07:53:13 JakeA: this is separate from attributes 07:54:01 JakeA: the right way to do this is that the property is always there 07:54:28 rniwa: this should modify the prototype of these elements 07:54:47 keithamus: is that concerning because of the way IDL properties are named given the custom attributes 07:55:00 keithamus: what kind of namespace we give custom attributes? 07:55:28 lea: either we create an IDL attribute, or you require this to be explicit 07:55:34 q? 07:55:56 -> element.custom.fooBar 07:56:34 westbrook: we did this as custom element attribute that ended up being used by the platform, e.g. popover 07:56:53 lea: it's still easy to create conflicts 07:57:04 jugglinmike has joined #custom-attrs 07:57:06 keithamus: hoping it's a 2nd order problem 07:57:27 lea: you could check if an IDL attribute exists 07:57:49 keithamus: need to exclude e.g. data-*, aria-*, some existing things from MathML 07:58:10 alex: is there a namepsace for reserved names? 07:58:26 alex: is that too long? 07:58:30 TabAtkins: yes generally 07:58:49 zcorpan: data-* is author namespace 07:59:11 q+ 07:59:20 JakeA: double dash 07:59:24 ... ? 07:59:29 lea: can we not? 08:00:23 keithamus: pressing concerns? 08:00:56 q? 08:01:09 ack sorvell 08:01:16 q+ 08:01:44 sorvell9: my concern is related to the design overlap between this and custom elements, and it's not a stopper, it feels like you have a lot of the custom-element issues, plus new problems that come with mixin behaviors. this applies to however we do this 08:02:09 sorvell9: if this is very similar to custom elements, could it just replace it? what is the distinction? 08:02:44 ... why wouldn't people use this as a drop-in replacement instead of custom elements 08:03:06 ... why not start with having this a replacement for custom-elements 08:03:33 ... if you save this, why not replace custom elements? Maybe this is better? 08:03:44 ack lea 08:04:29 lea: re mixins, it exists in many languages, there are philosophical/practical issues. traits vs. identity, not always a "component" 08:04:48 ... when all you can do is a component, everything looks like a component 08:05:09 ... web components are different from framework components. e.g. in React you can wrap your elements numerous times. also Vue etc 08:05:38 ... in web components you can't have elements that add to a table without breaking the table due to parsing rules 08:06:00 sorvell9: I hear it as "this is just a better feature" 08:06:24 lea: I don't think you would make a DIV into an INPUT by adding a mixin to it 08:06:29 ... I think you need both 08:06:41 Custom elements could have their own sets of attributes associated with them, while with custom attributes it will be much harder to express it 08:06:51 keithamus: I think you need both. it's a semantic choice. my interpretation of this design. it makes it easier to make this semantic distinction 08:07:17 ... there are certain things that attributes don't give you, like customStateSet 08:07:56 q? 08:07:58 q+ 08:07:59 sorvell9: what I am roughly proposing is that we make this have all of the same powers that custom elements have. except for it not being exclusive 08:08:00 q+ 08:08:19 keithamus: makes it difficult to manage customStateSet and other things 08:08:26 sorvell9: you're introducing it anyway 08:09:02 lea: I agree. we will eventually need to figure out how it works with rendering content. We don't have a good answer for inheritance. I see many cases for customStateSet 08:09:16 sorvell9: you're not really restrict me with this 08:09:44 rniwa: I don't think we should let those attribute access closed shadow roots 08:10:04 JakeA: you're either saying "I want video elements to support this attribute", and then the getters would be there from the very start 08:10:36 ... or, I'm using this attribute to change this form to say "this is my form, override this form" 08:10:48 q+ 08:10:49 noamr: isn't that a sort of a mixin? 08:10:54 JakeA: yeah 08:11:34 lea: this seems like a workaround for customized built ins 08:12:54 noam: Could we just use data- 08:13:03 noamr: there's already dataset 08:13:08 noamr: we just need observability 08:13:54 lea: there's a set of mutation observers you could use to make this work. but you want connectedness & ability to cross shadow roots 08:14:07 noamr: we need more APIs added, but data- could be the start 08:14:16 s/noam:/noamr:/ 08:14:44 keithamus: I like in this design that it takes from custom elements 08:15:07 rniwa: next steps? 08:15:16 keithamus: temperature of the room? 08:15:46 ... interested in the dataset thing. mild concerns. 08:16:22 ... need to figure out a concrete API 08:16:42 ... haven't heard significant concerns/objections 08:17:21 zakim, end 08:17:21 I don't understand 'end', noamr 08:17:28 zakim, end meeting 08:17:28 As of this point the attendees have been alisonmaher, kizu, ydaniv, noamr, frehner, JakeA, lea, christianliebel, LeoLee, plinss, jugglinmike 08:17:30 RRSAgent, please draft minutes 08:17:32 I have made the request to generate https://www.w3.org/2025/11/12-custom-attrs-minutes.html Zakim 08:17:39 I am happy to have been of service, noamr; please remember to excuse RRSAgent. Goodbye 08:17:39 Zakim has left #custom-attrs 08:29:03 TabAtkins has left #custom-attrs 08:31:46 jugglinmike has joined #custom-attrs 13:46:20 tidoust has joined #custom-attrs 13:46:55 RRSAgent, bye 13:46:55 I see no action items