Skip to content

adding defaultChecked property and changing checked property to take a boolean #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 14, 2016

Conversation

foopq
Copy link
Contributor

@foopq foopq commented Oct 10, 2016

Taking an opinionated stand on #81 (other bindings have checked as a boolean, such as https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react/react.d.ts).

Also adding defaultChecked as per https://facebook.github.io/react/docs/forms.html#default-value

@ethul
Copy link
Contributor

ethul commented Oct 12, 2016

I am okay with using Boolean in place of String for this prop. However, I wonder if we should do this across the board for any prop that accepts a Boolean.

@paf31 What are your thoughts on this?

@paf31
Copy link
Contributor

paf31 commented Oct 12, 2016

Yes, agreed, it'd be better to do this everywhere, although it will be a breaking change.

@ethul
Copy link
Contributor

ethul commented Oct 12, 2016

True, it would be breaking. But it would fine-tune the props. I think it could be a good way to go.

@foopq Would you possibly be willing to make this part of your PR?

@paf31
Copy link
Contributor

paf31 commented Oct 12, 2016

fine-tune the props

As in reduce the space of valid values? Yes, I think we probably should do it. As for a release, maybe we can wait a little since we need to make a breaking release for 0.10 soon anyway.

Thanks for merging these.

@ethul
Copy link
Contributor

ethul commented Oct 12, 2016

Yep, reduce the space of valid values. Sounds good on the release. And no
problem on merging.

On Tuesday, 11 October 2016, Phil Freeman notifications@github.com wrote:

fine-tune the props

As in reduce the space of valid values? Yes, I think we probably should do
it. As for a release, maybe we can wait a little since we need to make a
breaking release for 0.10 soon anyway.

Thanks for merging these.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#88 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAVYy5y542L5xBjyun5LxfOiRWqf-3cJks5qzEUMgaJpZM4KTEwV
.

@foopq
Copy link
Contributor Author

foopq commented Oct 12, 2016

I'm happy including more in this PR. I'll try to go through the properties tomorrow night and change the others that should be boolean.

@ethul
Copy link
Contributor

ethul commented Oct 12, 2016

Wonderful, thank you!

On Tuesday, 11 October 2016, Chris Mennie notifications@github.com wrote:

I'm happy including more in this PR. I'll try to go through the properties
tomorrow night and change the others that should be boolean.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#88 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAVYy1_WkTUoDarkUrZLH4pjapAR8J_Eks5qzEjLgaJpZM4KTEwV
.

@foopq
Copy link
Contributor Author

foopq commented Oct 13, 2016

Using the signatures from DefinatelyTyped and the React supported attributes page, I've updated the properties here.

@ethul
Copy link
Contributor

ethul commented Oct 14, 2016

Looks great! Thank you very much for doing all of this. I will take a closer look and merge this in today or tomorrow.

dateTime :: String -> Props
dateTime = unsafeMkProps "dateTime"

default :: Boolean -> Props
default = unsafeMkProps "defaultChecked"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the default prop map to defaultChecked? Just want to be sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, this looks like a bad merge. I'll fix shortly.

integrity :: String -> Props
integrity = unsafeMkProps "integrity"

is :: String -> Props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe that this is an HTML element. From what I have seen, it pertains to polymer. Should this be included? Can someone be using polymer with React? If so, are there other attributes for polymer that should be added? Perhaps such attributes (if added) should be in a separate module or at least separated out like the non-standard attributes below.

@@ -99,13 +99,22 @@ coords = unsafeMkProps "coords"
crossOrigin :: String -> Props
crossOrigin = unsafeMkProps "crossOrigin"

dataAttr :: String -> Props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reference to this attribute? I was trying to determine what it does, but didn't find anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these attributes you're asking about, I'm going by what's listed on https://facebook.github.io/react/docs/tags-and-attributes.html. Some of them I'm unfamiliar with as well.

key :: String -> Props
key = unsafeMkProps "key"

keyParams :: String -> Props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reference to this attribute? I just wanted to determine what it does.

muted = unsafeMkProps "muted"

name :: String -> Props
name = unsafeMkProps "name"

noValidate :: String -> Props
nonce :: String -> Props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also wanted to double check this attribute. I thought it might be for the script tag, but was not sure.

start = unsafeMkProps "start"

step :: String -> Props
step = unsafeMkProps "step"

tabIndex :: String -> Props
summary :: String -> Props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This attribute is not supported in HTML5. Should we still include this here?

@ethul
Copy link
Contributor

ethul commented Oct 14, 2016

Thanks for the fix for default. And sounds good for keeping things aligned with https://facebook.github.io/react/docs/tags-and-attributes.html.

I did a quick scan and noticed a few that we don't have. Would it be okay to add:

  • challenge
  • capture
  • cite
  • headers
  • high
  • profile

Also dataAttr is a duplicate of _data. Can we remove dataAttr?

Thanks!

@ethul ethul merged commit 3326bd5 into purescript-contrib:master Oct 14, 2016
@ethul
Copy link
Contributor

ethul commented Oct 14, 2016

Looks great! Thanks so much for this addition.

@foopq
Copy link
Contributor Author

foopq commented Oct 14, 2016

My pleasure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants