Skip to content

Update notes.xsl #673

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

Closed
wants to merge 4 commits into from
Closed

Conversation

AurelioDeRosa
Copy link
Member

Fix issue #586.

@arthurvr
Copy link
Member

arthurvr commented Mar 1, 2015

The data-doesnt-accept-undefined note does also appear on the jQuery.data post. Of course, jQuery.data doesn't return the jQuery object is is called on.

@AurelioDeRosa
Copy link
Member Author

@arthurvr In this case I vote for splitting the two notes as they have a different behavior. If everyone agrees I'll modify the PR to include an additional note specific for jQuery.data().

@arthurvr
Copy link
Member

arthurvr commented Mar 1, 2015

Seems fine.

@dmethvin
Copy link
Member

dmethvin commented Mar 1, 2015

Seems like we need to split the two, I agree. How do you guys feel about undefined not actually setting the value?

recognised

Have we standardised on UK English? Oh I mean, standardized. 😄 I guess I never noticed before.

@AurelioDeRosa
Copy link
Member Author

To be honest I feel more like .data('thing', undefined) should act as .removeData('thing'). We had a similar discussion in #523.

P.S. British English vs American English: their differences will kill me.

@dmethvin
Copy link
Member

dmethvin commented Mar 1, 2015

I had forgotten about #523. It's tough because I think a good argument can be made either way. I agree with you that removing the data item feels best, but it would certainly be a breaking change as @gibson042 pointed out. It's hard to know whether a lot of plugins and developers depend on the current no-op behavior.

@AurelioDeRosa
Copy link
Member Author

@dmethvin What if we introduce this BC in jQuery 3.0?

@dmethvin
Copy link
Member

dmethvin commented Mar 2, 2015

If very few people depend on this (or those people don't upgrade) then it would be nice to eliminate this kind of strange exception. If it turns out that several high-profile popular plugins break because we change this, then it would be a real pain to do and it would prevent people from upgrading to 3.0. I don't know which applies. 😄

@AurelioDeRosa
Copy link
Member Author

@dmethvin we're all in your hands :)

@dmethvin
Copy link
Member

dmethvin commented Mar 2, 2015

I'll leave the hard decisions to @timmywil now! Sucker!

@arthurvr
Copy link
Member

arthurvr commented Mar 7, 2015

@AurelioDeRosa Besides from the discussion above, this PR needs some updates. Would you like to do them? I'd love to land this.

@AurelioDeRosa
Copy link
Member Author

@arthurvr I was waiting for a feedback by @timmywil.

@timmywil
Copy link
Member

timmywil commented Mar 8, 2015

Sorry I missed this. I think this can be landed. As far as #523, I think we'll need to gauge how much it will break. Personally, I always saw undefined as it's own value and thought it was most intuitive for .data('something', undefined) to act similarly to assigning a property on an object to the value undefined, and .removeData('something') being the equivalent of using the delete operator. Otherwise, determining whether something was set to undefined or whether it was never set is impossible. Regardless, we can thrash on that issue there.

@arthurvr
Copy link
Member

arthurvr commented Mar 8, 2015

I can def. agree with @timmywil.

@AurelioDeRosa
Copy link
Member Author

So, I understand the conclusion is "Let's leave things as they are in regard of undefined and split the note in two notes". I'll update my PR accordingly.

@arthurvr
Copy link
Member

arthurvr commented Mar 8, 2015

Thank you, @AurelioDeRosa!

@arthurvr
Copy link
Member

I'll update my PR accordingly.

@AurelioDeRosa You've got the chance to update this PR? Would love to land it.

@arthurvr
Copy link
Member

ping @AurelioDeRosa

Updated notes
Updated note reference
@AurelioDeRosa
Copy link
Member Author

PR updated @arthurvr

@@ -2,6 +2,9 @@
<xsl:template name="note">
<xsl:choose>
<xsl:when test="@id = 'data-doesnt-accept-undefined'">
<code>undefined</code> is not recognised as a data value. Calls such as <code><xsl:value-of select="@data-title" />( <xsl:value-of select="@data-parameters" />, undefined )</code> will return the jQuery object that it was called on, allowing for chaining.
Copy link
Member

Choose a reason for hiding this comment

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

recognised

We use American English. Could you fix that on the while in the jquery-data-doesnt-accept-undefined note?

Replaced recognised with recognized.
@arthurvr arthurvr closed this in 4f0a6f3 Apr 17, 2015
@AurelioDeRosa AurelioDeRosa deleted the patch-7 branch April 17, 2015 19:11
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.

5 participants