Giter Site home page Giter Site logo

Comments (5)

Zaid-Ajaj avatar Zaid-Ajaj commented on August 18, 2024 1

I suggest dropping inputType in favour of withType, and have withType surface all allowed members for any type: withType.submit, withType.date, withType.toolbar.

You could also have a string-accepting member on the prop type: prop.withType "foo" in addition to the enum props. They combine nicely.

@cmeeren I like this idea because it is not good if we keep both inputTypes and withType in the DSL, I will try to implement it soon

from feliz.

Zaid-Ajaj avatar Zaid-Ajaj commented on August 18, 2024

You are right!

I am a bit conflicted on this, I like that inputTypes reflects the possible types for an input but I am not sure I want buttonTypes and menuTypes in the DSL along with a free-text value. I will take a look at what other DSL's do

from feliz.

Zaid-Ajaj avatar Zaid-Ajaj commented on August 18, 2024

Do you have any suggestions on what should be the the property? I have a couple myself but I don't care which one gets in because I think I need to make a choice and if it is really bad (I doubt it) then it can be re-worked later

I am thinking

  • prop.withType : string -> IReactAttribute because the with* prefix is common for F# devs
  • prop.useType : string -> IReactAttribute kind of OK
  • prop.setType : string -> IReactAttribute also kind of OK but I don't like it because it resembles OOP code
  • prop.ofType : string -> IReactAttribute meh because there is a react helper in Fable.React for importing 3rd party components called the same

Even with these, withType and setType are my highest candidates because they are closest to what "setting an attribute called type represent". I also use string as input because other that inputTypes, these attributes won't be used a lot (I think)

@cmeeren @MangelMaxime what do you think?

from feliz.

cmeeren avatar cmeeren commented on August 18, 2024

Of those, I like withType best. I can't think of better alternatives at the moment. (Well, type', but... 😅)

I also use string as input

I suggest dropping inputType in favour of withType, and have withType surface all allowed members for any type: withType.submit, withType.date, withType.toolbar.

You could also have a string-accepting member on the prop type: prop.withType "foo" in addition to the enum props. They combine nicely.

from feliz.

MangelMaxime avatar MangelMaxime commented on August 18, 2024

withType seems good to be

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.