-
Notifications
You must be signed in to change notification settings - Fork 476
Dashes in .data() names behavior change #87
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
Comments
API docs need some variant of this description: jquery/jquery#1751 (comment) |
At this point I'm not sure how to make a non-noisy warning about this. It might just have to be a documentation change. |
I think this can be done: http://jsfiddle.net/aq992xxb/ The following cases will need warnings:
|
We're only talking about breaking changes with regard to migration though. So we only want to give a warning if some old code no longer works. Merely using dashed keys needs to be silent unless mixed with direct data object access where the new representation would be visible? |
Pretty much, yeah. Access is backwards- incompatible only when the data object includes a dashed key, and that can only happen through a bulk setter call (which itself is one of those warning cases) or direct manipulation. |
@gibson042 How does this sound? In a call to |
We're using camelCase for data names where possible, and only use the dash-name if it exists in the object already. Ideally, API callers should use camelCase for accessing data names rather than dashes. If the caller gets the raw data object they'll see camelCase if they put in dash-name via the API. (Clearly this will need a longer explanation somewhere.)
jquery/jquery#1751
jquery/jquery#2257
The text was updated successfully, but these errors were encountered: