Skip to content

Drop toggleClass(boolean) and toggleClass(undefined) signatures #3388

Description

@silverwind

Can we evaluate if these signatures can be dropped? Here's a few arguments:

  • It can mask bugs when the first argument inadvertently evaluates to undefined, which results in all classes being removed the first time it is called.
  • It's badly documented (Misleading documentation for toggleClass() method. #1696) and because of that, probably not well-known.
  • The way it saves a __className__ data seems like a bad practice.
  • For custom builds, it creates a otherwise unnecessary dependency for attributes/classes towards data.
  • It would allow the following savings for full builds:
   raw     gz Compared to master @ 5b4cb0d33731a58384e02ad51e703e7dcb00e424
  -701   -230 dist/jquery.js
  -168    -61 dist/jquery.min.js

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions