Skip to main content

Bug Tracker

Side navigation

#10997 closed bug (wontfix)

Opened December 10, 2011 08:28PM UTC

Closed January 18, 2012 03:39AM UTC

Remove/deprecate/document sneak-dependency methods

Reported by: dmethvin Owned by:
Priority: low Milestone: None
Component: misc Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

Some methods are ambiguous, creating "sneak" dependencies that are going to confuse Closure Compiler and also thwart manual attempts to reduce size.

  • jQuery.fn.load() - Either needs event.js or ajax.js; only the arguments tell for sure. Can we deprecate/remove one or both to make it unambiguous? At minimum need to document effect of its use.
  • jQuery.fn.show(), jQuery.fn.hide() - Needs effects.js only if a speed is provided. Can we deprecate the animation-related ones? Again, we at least need to document it.

As a starting point I suggest we deprecate the event behavior of .load() and the animate behavior of .show()/.hide(), removing them in 2.0. Perhaps we could put in a jQuery.error() if .load() detects it's being called all event-like.

Are there other examples?

Attachments (0)
Change History (9)

Changed December 10, 2011 08:29PM UTC by dmethvin comment:1

component: unfiledmisc
keywords: → 1.8-discuss
milestone: None1.8
priority: undecidedlow
status: newopen

Changed December 10, 2011 08:41PM UTC by rwaldron comment:2

With jQuery.fn.show/jQuery.fn.hide they are "members" of effects.js... Maybe I've misunderstood?

Changed December 10, 2011 08:49PM UTC by dmethvin comment:3

Sorry, what I meant was that for the no-args case they are just css display changers, but for all other cases they need .animate(). It would be good to be able to keep the simple show/hide but not require all of effects. Or maybe we should tell people who want to do that to use classes and avoid show/hide unless they want to include effects.js?

Changed December 10, 2011 09:16PM UTC by timmywil comment:4

+0, I don't think this can actually happen. Not having to included effects for the simple usage of show/hide would be nice and .load() is unfortunately ambiguous, but backwards compatibility will always be important. Also, I thought John said there was never going to be a 2.0.

Changed December 13, 2011 02:48PM UTC by jzaefferer comment:5

description: Some methods are ambiguous, creating "sneak" dependencies that are going to confuse Closure Compiler and also thwart manual attempts to reduce size. \ \ * `jQuery.fn.load()` - Either needs event.js or ajax.js; only the arguments tell for sure. Can we deprecate/remove one or both to make it unambiguous? At minimum need to document effect of its use. \ \ * `jQuery.fn.show(), jQuery.fn.hide()` - Needs effects.js only if a speed is provided. Can we deprecate the animation-related ones? Again, we at least need to document it. \ \ As a starting point I suggest we deprecate the event behavior of .load() and the animate behavior of .show()/.hide(), removing them in 2.0. Perhaps we could put in a jQuery.error() if .load() detects it's being called all event-like. \ \ Are there other examples? \ Some methods are ambiguous, creating "sneak" dependencies that are going to confuse Closure Compiler and also thwart manual attempts to reduce size.\ \ * `jQuery.fn.load()` - Either needs event.js or ajax.js; only the arguments tell for sure. Can we deprecate/remove one or both to make it unambiguous? At minimum need to document effect of its use.\ \ * `jQuery.fn.show(), jQuery.fn.hide()` - Needs effects.js only if a speed is provided. Can we deprecate the animation-related ones? Again, we at least need to document it.\ \ As a starting point I suggest we deprecate the event behavior of .load() and the animate behavior of .show()/.hide(), removing them in 2.0. Perhaps we could put in a jQuery.error() if .load() detects it's being called all event-like.\ \ Are there other examples?\

+1, animated show/hide always looked bad - overloaded load is just bad.

Changed December 13, 2011 04:28PM UTC by jaubourg comment:6

+0, Let's investigate properly first... also, I'd like to see if we could use Closure to help here.

Changed December 15, 2011 07:27AM UTC by mikesherov comment:7

-1

Changed December 19, 2011 05:36PM UTC by rwaldron comment:8

description: Some methods are ambiguous, creating "sneak" dependencies that are going to confuse Closure Compiler and also thwart manual attempts to reduce size.\ \ * `jQuery.fn.load()` - Either needs event.js or ajax.js; only the arguments tell for sure. Can we deprecate/remove one or both to make it unambiguous? At minimum need to document effect of its use.\ \ * `jQuery.fn.show(), jQuery.fn.hide()` - Needs effects.js only if a speed is provided. Can we deprecate the animation-related ones? Again, we at least need to document it.\ \ As a starting point I suggest we deprecate the event behavior of .load() and the animate behavior of .show()/.hide(), removing them in 2.0. Perhaps we could put in a jQuery.error() if .load() detects it's being called all event-like.\ \ Are there other examples?\ Some methods are ambiguous, creating "sneak" dependencies that are going to confuse Closure Compiler and also thwart manual attempts to reduce size. \ \ * `jQuery.fn.load()` - Either needs event.js or ajax.js; only the arguments tell for sure. Can we deprecate/remove one or both to make it unambiguous? At minimum need to document effect of its use. \ \ * `jQuery.fn.show(), jQuery.fn.hide()` - Needs effects.js only if a speed is provided. Can we deprecate the animation-related ones? Again, we at least need to document it. \ \ As a starting point I suggest we deprecate the event behavior of .load() and the animate behavior of .show()/.hide(), removing them in 2.0. Perhaps we could put in a jQuery.error() if .load() detects it's being called all event-like. \ \ Are there other examples? \

-1

Changed January 18, 2012 03:39AM UTC by dmethvin comment:9

keywords: 1.8-discuss
milestone: 1.8None
resolution: → wontfix
status: openclosed

Voted down, but I may do some of this as we investigate the Closure integration.