Skip to main content

Bug Tracker

Side navigation

#9469 closed feature (fixed)

Opened May 31, 2011 04:12PM UTC

Closed October 25, 2012 02:37AM UTC

Remove semi-functional .selector calculation from .pushStack()

Reported by: dmethvin Owned by: dmethvin
Priority: low Milestone: 1.9
Component: core Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Per discussion with ben_alman, and related to #7389 which consensus says won't happen.

The .selector property can't be reliable since there are simple ways to construct a set that can't be represented by a CSS selector. We've documented those shortcomings in the API docs for .live() and .selector but it's still a frequent source of questions and errors.

It would simplify the code for .pushStack() and its callers if it didn't try to maintain the .selector property at all, which is still in keeping with our documented use of .live() immediately after a $() set creation.

In addition we should deprecate non-core use of .selector and remove the documentation from the API site eventually.

All to be done over several versions, with sufficient advance warning in the docs before breaking anything.

Attachments (0)
Change History (9)

Changed May 31, 2011 04:15PM UTC by timmywil comment:1

component: unfiledcore
priority: undecidedlow
status: newopen

Changed May 31, 2011 05:37PM UTC by cowboy comment:2

See my 3rd idea here:

Changed July 12, 2011 06:42PM UTC by john comment:3

resolution: → invalid
status: openclosed

Eventually we should do this, for sure, but only when we have some alternative to switch to. Right now we're using .selector inside jQuery for live so we definitely want to maintain it.

Changed May 23, 2012 12:51PM UTC by anonymous comment:4

A quick question:

Since .selector seems to have been removed from the docs, and .live doesn't support chaining, would it be possible to remove the .selector constructing code in .pushStack now?

Changed May 23, 2012 06:00PM UTC by dmethvin comment:5

resolution: invalid
status: closedreopened

Hmmm, it might. We still need to set .selector since .live() needs it, but the only other chaining I've seen in the wild is $(sel).find(sel).live(). Reopening to take a look around.

Changed May 29, 2012 12:13AM UTC by timmywil comment:6

status: reopenedopen

Changed June 26, 2012 03:07PM UTC by dmethvin comment:7

milestone: 1.next1.9
owner: → dmethvin
status: openassigned

Changed September 09, 2012 01:10AM UTC by dmethvin comment:8

type: enhancementfeature

Bulk change from enhancement to feature.

Changed October 25, 2012 02:37AM UTC by Dave Methvin comment:9

resolution: → fixed
status: assignedclosed

Fix #9469. Remove semi-functional .selector property. Close gh-1006.

Saved 65 bytes.

Changeset: 69e2f068fe7d16c1ccd6cb99c6376f0d8891ea33