You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to discuss about naming conventions for these elements. Take file as an example:
current HTML: <input type="file">
open-UI proposal: <file>
Another option would be <file-input> or <input-file> as a naming convention. These feel more clear to me and nod to the underlying web components (which we hope to become native). You can also replace "file" with anything and you still have a naming pattern, i.e.:
@kenchris that's a valid point but not entirely sure how that relates to Open UI specifically. If they make their way into the platform itself they may not have a hyphen as only platform based components can be implemented without a dash. I think as it relates to creating a component following Open UI leveraging the web component paradigm makes sense until a standardize HTML element is created.
With regards to the options, I kind of want to get away from the input foo paradigm personally. That's why I initially recommended file as I think that's what should be proposed for the native element. That said, Open UI should probably not take a dependency on that until it is standardized in WHATWG.
TLDR; I agree that we should use a web components naming convention unless a standardized element that matches the same semantic meaning can be used in its place. Which specific name for file and inputs in general I don't have a strong pref.
I kind of want to get away from the input foo paradigm personally.
I would say this is a largely uncontroversial position among implementers/plenty of standards people. The type model in which a thing totally changes its 'ness' is a regrettable choice that is full of problems we are still digging out of, and we'd rather use composition/decoration here. So, I agree.
The ideal eventual HTML element would be <file>, etc, where the name of the component is the name of the element. This is how all component libraries I've seen name and implement their components. If we need to prefix for now, I'd support <oui-*> as a prefix meaning "Open UI", however, I don't think this should impact what browsers might implement someday.
If we're not talking about standardisation, and instead about using these specifications to create inputs today, we could also prefix with wicg- so that it's clear that the input is built to the spec we've proposed. I don't mind input-, but I'm not a fan of suffixes (I feel that most developers would prefer prefixes).
Long term, I agree that I'd like to see <file /> in use. Of course, with something like <select /> there would need to be a way to switch between behaviours, or we'd need to always be 100% compatible with the previous implementations of these types of elements.
I think there's a couple of considerations here to be made.
As some of these may not end up in the platform (or it may take awhile), how do we refer to the control - what do we call it? As other libraries are creating this and looking to align on naming, anatomy, parts, do we have a common way to refer to this control?. For those seeking alignment with open-ui and for whatever elements are proposed here I'd assume that name is part of it.
If this is going into the platform, I think we would need to go without prefixing. Thus I'd expect a proposed name of file. If we are speaking to an element which would live within this repo, then I think wicg-file or oui-file would be acceptable. For custom element names looking to align to Open UI, I'd suggest leaving the prefix open as most implementors will already be prefixing their controls for their library.
Given the different contexts to consider around naming, perhaps something like the following:
Control name: File Proposed platform name: <file/> Proposed element: <____-file>
Reacted by Brody McKee, Brandon Ferrua, Melanie Richards and Una Kravets
I find <file> a bit confusing and <input-file> more clear. How would <file> relate to tags like <video>? One is for displaying, and the other is for input. A <blockquote> does not ask you to input a quote.
I think I prefer <input-file> because being an input and asking something from the user is what sets it apart, even more than being about files.
But I wonder, would we name checkbox and radio button similarly if we started from scratch? Would they be <input-checkbox> and <input-radiobutton>, or <checkbox> and <radiobutton>? What about text inputs? I don’t think <text> would work, so would that be <input-text>? And how about <textarea> and <select>? I’m just wondering, not sure if this is helpful for anyone.
Specifically about files: what use cases should it cover? Just file submission, as part of a form? Would “upload” be a closer match then? Or do we want it to cover more use cases? For example where the user can choose a file from their local file system, to be edited by a web app? In both cases the user is opening the file browser and choosing one (or multiple) files.
Apologies if I’m taking the discussion even further away from the original topic.
Activity
[-]Naming convention for new elements[/-][+]Naming convention for proposed elements[/+]kenchris commentedon Sep 30, 2020
People might have made custom elements with those names as they contain a hyphen, so that might cause issues
gregwhitworth commentedon Oct 6, 2020
@kenchris that's a valid point but not entirely sure how that relates to Open UI specifically. If they make their way into the platform itself they may not have a hyphen as only platform based components can be implemented without a dash. I think as it relates to creating a component following Open UI leveraging the web component paradigm makes sense until a standardize HTML element is created.
With regards to the options, I kind of want to get away from the input foo paradigm personally. That's why I initially recommended file as I think that's what should be proposed for the native element. That said, Open UI should probably not take a dependency on that until it is standardized in WHATWG.
TLDR; I agree that we should use a web components naming convention unless a standardized element that matches the same semantic meaning can be used in its place. Which specific name for file and inputs in general I don't have a strong pref.
bkardell commentedon Oct 8, 2020
I would say this is a largely uncontroversial position among implementers/plenty of standards people. The type model in which a thing totally changes its 'ness' is a regrettable choice that is full of problems we are still digging out of, and we'd rather use composition/decoration here. So, I agree.
levithomason commentedon Oct 8, 2020
The ideal eventual HTML element would be
<file>, etc, where the name of the component is the name of the element. This is how all component libraries I've seen name and implement their components. If we need to prefix for now, I'd support<oui-*>as a prefix meaning "Open UI", however, I don't think this should impact what browsers might implement someday.mrmckeb commentedon Oct 19, 2020
If we're not talking about standardisation, and instead about using these specifications to create inputs today, we could also prefix with
wicg-so that it's clear that the input is built to the spec we've proposed. I don't mindinput-, but I'm not a fan of suffixes (I feel that most developers would prefer prefixes).Long term, I agree that I'd like to see
<file />in use. Of course, with something like<select />there would need to be a way to switch between behaviours, or we'd need to always be 100% compatible with the previous implementations of these types of elements.chrisdholt commentedon Oct 19, 2020
I think there's a couple of considerations here to be made.
As some of these may not end up in the platform (or it may take awhile), how do we refer to the control - what do we call it? As other libraries are creating this and looking to align on naming, anatomy, parts, do we have a common way to refer to this control?. For those seeking alignment with open-ui and for whatever elements are proposed here I'd assume that name is part of it.
If this is going into the platform, I think we would need to go without prefixing. Thus I'd expect a proposed name of
file. If we are speaking to an element which would live within this repo, then I thinkwicg-fileoroui-filewould be acceptable. For custom element names looking to align to Open UI, I'd suggest leaving the prefix open as most implementors will already be prefixing their controls for their library.Given the different contexts to consider around naming, perhaps something like the following:
Control name: File
Proposed platform name:
<file/>Proposed element:
<____-file>erikkroes commentedon Oct 26, 2020
I find
<file>a bit confusing and<input-file>more clear. How would<file>relate to tags like<video>? One is for displaying, and the other is for input. A<blockquote>does not ask you to input a quote.I think I prefer
<input-file>because being an input and asking something from the user is what sets it apart, even more than being about files.jouni commentedon Oct 27, 2020
I hear what @erikkroes is saying.
But I wonder, would we name checkbox and radio button similarly if we started from scratch? Would they be
<input-checkbox>and<input-radiobutton>, or<checkbox>and<radiobutton>? What about text inputs? I don’t think<text>would work, so would that be<input-text>? And how about<textarea>and<select>? I’m just wondering, not sure if this is helpful for anyone.Specifically about files: what use cases should it cover? Just file submission, as part of a form? Would “upload” be a closer match then? Or do we want it to cover more use cases? For example where the user can choose a file from their local file system, to be edited by a web app? In both cases the user is opening the file browser and choosing one (or multiple) files.
Apologies if I’m taking the discussion even further away from the original topic.
una commentedon Jan 7, 2021
Resolved in 01/07/2021 Open UI telcon meeting:
i.e.
<openui-superselect>and<superselect>