jQuery 2.0 added native-API selector module.
What's out:
6 KB
attribute not equal selector
positional selectors (:first; :eq(n); :odd; etc.)
type selectors (:input; :checkbox; :button; etc.)
state-based selectors (:animated; :visible; :hidden; etc.)
:has(selector)
custom selectors
leading combinators (e.g., $collection.find("> *"))
reliable functionality on XML fragments
requiring all parts of a selector to match elements under context (e.g., $div.find("div > *") now matches children of $div)
matching against non-elements
reliable sorting of disconnected nodes
https://github.com/jquery/jquery/pull/1180
What actually we can do ?
Here is one cleanup example:
https://github.com/jquery/jquery/commit/59f5adb622dd6bc3419bbaa9cc2d4acd...
Real benefit in Drupal:
http://drupal.org/node/1880798
Comments
Comment #1
nod_yep, no question about that +1
#1415788: Javascript winter clean-up
#1574470: Selectors clean-up
Comment #2
droplet CreditAttribution: droplet commentedTagging novice.
most of this cleanup are search & replace jobs. Sadly, I don't have time to run through of it recently. Anyone would like to take this task ?
don't hesitate to contact me if you need helps.
Here is an example:
search: :checkbox
replace: [type="checkbox"]
Comment #3
droplet CreditAttribution: droplet commentedkool.
Let me start from simple one:
#1937924: Remove jQuery deprecated function
Comment #4
littledynamo CreditAttribution: littledynamo commentedComment #5
littledynamo CreditAttribution: littledynamo commentedComment #6
Jelle_SQuestions:
Comment #7
nod_No plan yet. I'm guessing 1. is the way to go. The selector cleanup was to remove crazy things. Making them mean and lean is another story.
Comment #8
Jelle_SComment #9
droplet CreditAttribution: droplet commentedIf we have reviewer and committer REAL supports. i will have a look at it soon. All JS fixes given me very bad experience. for example: #1793648: Follow-up: replace all occurence of Drupal.settings with drupalSettings, 9 months for a search & replace patch.
Separate issue per module is a very bad idea because most of clean up need not to do manually tests.
Look at jQuery example:
https://github.com/jquery/jquery/pull/1180
It is not a crazy change. :)
Comment #10
Jelle_SJust FYI:
This probably covers most (probably not all though!) of what needs to be changed (
grep -rn "('[^']*:[^']*'" --include=*.js .
and then manually removed non-relevant lines from that output)Comment #11
tarekdj CreditAttribution: tarekdj commentedI think I can find some time to work on it. nod_ any plan yet ?
Comment #12
tarekdj CreditAttribution: tarekdj commentedAfter a quick chat with nod_ the plan is to start with type selectors then position and so on.
Issues created :
#2153177: Convert type selectors to be compatible with jQuery native-API selector
#2154475: Convert position selectors to be compatible with with jQuery native-API selector
#2159271: Convert state-based selectors to be compatible with with jQuery native-API selector
Comment #13
LewisNymanComment #14
mgiffordComment #15
Wim LeersDo we still want to do this? If so, we should decide it now. At this point, it might still be acceptable, because disruption will be low. Once 8.0.0 is out, I don't think we can do this anymore.
Comment #16
Lord_of_Codes CreditAttribution: Lord_of_Codes commentedComment #17
droplet CreditAttribution: droplet commentedComment #19
ttkoch CreditAttribution: ttkoch commentedUntagging this as novice because
according to:
https://www.drupal.org/core-mentoring/novice-tasks#avoid
Comment #20
droplet CreditAttribution: droplet commentedThanks all for your hard-working and I'm sorry I didn't help the patches move forward.
I postponed it for now, and I think we need a better way and right timing for these issues in the future.
Comment #28
nod_Timing might be better this time around :)
Comment #29
bnjmnmComment #31
xjmPromoting to major alongside the parent.
Comment #32
xjm