Skip to content

Commit

Permalink
Selector: Inline Sizzle into the selector module: 3.x version (#5113)
Browse files Browse the repository at this point in the history
This commit removes Sizzle from jQuery, inlining its code & removing obsolete
workarounds where applicable.

The Sizzle AUTHORS.txt file has been merged with the jQuery one - people are
sorted by their first contributions to either of the two repositories.

The main `selector` module can be disabled in favor of `selector-native`
via:

    grunt custom:-selector

For backwards compatibility, the legacy `sizzle` alias is also supported (it
will be dropped in jQuery `4.0.0`):

    grunt custom:-selector

Sizzle tests have been ported to jQuery ones. Ones that are not compatible
with the `selector-native` module are disabled if the regular selector module
is excluded.

Backwards compatibility is still kept for all `Sizzle` utils - they continue to be
available under `jQuery.find` - but the primary implementation is now attached
directly to jQuery.

Some selector utils shared by `selector` & `selector-native` have been
extracted & deduplicated. `jQuery.text` and `jQuery.isXMLDoc` have been
moved to the `core` module.

The commit reduces the gzipped jQuery size by 851 bytes compared to the
`3.x-stable` branch.

Closes gh-5113
Ref gh-4395
Ref gh-4406
  • Loading branch information
mgol authored Dec 14, 2022
1 parent 96675fa commit 6306ca4
Show file tree
Hide file tree
Showing 43 changed files with 5,045 additions and 3,299 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
NODE_VERSION: "16.x"
NPM_SCRIPT: "test:no-deprecated"
BROWSERS: "ChromeHeadless"
- NAME: "Browser tests: no-Sizzle build, Chrome stable"
- NAME: "Browser tests: selector-native build, Chrome stable"
NODE_VERSION: "16.x"
NPM_SCRIPT: "test:no-sizzle"
NPM_SCRIPT: "test:selector-native"
BROWSERS: "ChromeHeadless"
- NAME: "Browser tests: AMD build, Chrome stable"
NODE_VERSION: "16.x"
Expand Down
Loading

0 comments on commit 6306ca4

Please sign in to comment.