Giter Site home page Giter Site logo

Comments (13)

Zaid-Ajaj avatar Zaid-Ajaj commented on July 19, 2024 1

I agree it makes sense in Material UI context but not really in this base library because of how uncommon it is used and it is here the only one (I think along with type' for which I used inputType)

I will leave this issue open for a while, maybe someone can enlighten our subjectiveness :)

from feliz.

Zaid-Ajaj avatar Zaid-Ajaj commented on July 19, 2024 1

Sorry I wrote incorrectly here but added the right one (with single r) in the props

from feliz.

zanaptak avatar zanaptak commented on July 19, 2024 1

Just pointing out that underscore is also an option to consider, either trailing or leading (e.g. inherit_, _inline). It's not as foreign as apostrophe since other languages and editing tools usually also allow underscores in identifiers.

I am not suggesting it for this issue. Decision to use word suffixes is perfectly fine. Just felt like an overlooked option to add to the discussion in case it helps any other onlookers.

from feliz.

Zaid-Ajaj avatar Zaid-Ajaj commented on July 19, 2024

Same as my comment here I am trying to avoid apostrophe in naming. inheritFromParent derives the naming from what it does and considering how uncommon this construct will be used (ofc. just a guess, I don't have numbers) it is good enough

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

Replying to the above as well as your comment in that issue: I'm not an F# beginner, but when I was, I didn't see any problem with ' (neither do I now). In fact, I thought it was a great way to avoid clashes with reserved keywords and used it wherever needed (and still do). That's me, though. :)

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

(For completeness: Another alternative is to use double backticks, ``inherit``, but I vastly prefer a single apostrophe to double backticks in this case.)

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

Just want to note that I consistently append ' to reserved keywords in Feliz.MaterialUI. That way:

  • Users intuitively understand that e.g. color.default' refers to the MUI default color
    • I expect users would be confused by alternative names like color.standard or color.normal and annoyed at more verbose alternatives like color.defaultColor, and all of these could also clash with new additions in MUI
  • I avoid having to come up with custom names for a lot of props

IMHO it looks great in usage, too. :) I suggest doing the same in Feliz, but it's ultimately your call, of course. (And I'm always open to hearing better ways of doing things in Feliz.MaterialUI)

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

Forgot to mention in #42 but I'd just like to be open about the fact that I added one such apostrophe name (ariaAutocomplete.inline'). If you don't like it, feel free to rename it. :)

Feliz/src/Properties.fs

Lines 871 to 885 in 0615e78

/// Indicates whether user input completion suggestions are provided.
///
/// https://www.w3.org/WAI/PF/aria-1.1/states_and_properties#aria-autocomplete
[<Erase>]
type ariaAutocomplete =
/// A list of choices appears and the currently selected suggestion also
/// appears inline.
static member inline both = Interop.mkAttr "aria-autocomplete" "both"
/// The system provides text after the caret as a suggestion for how to
/// complete the field.
static member inline inline' = Interop.mkAttr "aria-autocomplete" "inline"
/// A list of choices appears from which the user can choose.
static member inline list = Interop.mkAttr "aria-autocomplete" "list"
/// No input completion suggestions are provided.
static member inline none = Interop.mkAttr "aria-autocomplete" "none"

from feliz.

Zaid-Ajaj avatar Zaid-Ajaj commented on July 19, 2024

Thanks for sharing, I didn't see it there but (just as you said) I find it hard to come up with my own versions of names: inlinedSuggestions, inlined, inlineSuggestion etc.

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

Also, feel free to close this issue if you feel the final decision has been made on inheritFromParent vs. inherit'.

from feliz.

Zaid-Ajaj avatar Zaid-Ajaj commented on July 19, 2024

Last comments on inheritFromParent before I close the issue

  • Doesn't use prime and backticks to make it look not so foreign (no F#-ers) for newcomers, especially inside online editors (github)
  • Reflects what it does in the name
  • Not used commenly so the long name will (hopefully) not discourage people from using the value too often when needed

As for ariaAutocomplete.inline' I will go for ariaAutocomplete.inlineAfterCarret because that is what the description says about the attribute.

Found a serious issue with this decision? Please open a new issue and let us discuss it 😄

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

Shouldn't it be inlineAfterCaret? (Single r)

from feliz.

cmeeren avatar cmeeren commented on July 19, 2024

Yep, though prefixing with underscore in F# usually means that it's an unused value (prefixing with underscore suppresses unused warnings).

from feliz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.