diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2022-12-14 01:41:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-14 01:41:31 +0100 |
commit | 6306ca499433c45b58a02f1cf3a76cbafbc4a391 (patch) | |
tree | cf1c66f075ca92501a746646975f1fef046e27ec /README.md | |
parent | 96675fa7c82b350eea6a77a0cec1f9ad65c9f629 (diff) | |
download | jquery-6306ca499433c45b58a02f1cf3a76cbafbc4a391.tar.gz jquery-6306ca499433c45b58a02f1cf3a76cbafbc4a391.zip |
Selector: Inline Sizzle into the selector module: 3.x version (#5113)
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
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -106,11 +106,13 @@ Some example modules that can be excluded are: - **exports/global**: Exclude the attachment of global jQuery variables ($ and jQuery) to the window. - **exports/amd**: Exclude the AMD definition. -As a special case, you may also replace Sizzle by using a special flag `grunt custom:-sizzle`. +As a special case, you may also replace the full jQuery `selector` module by using a special flag `grunt custom:-selector`. -- **sizzle**: The Sizzle selector engine. When this module is excluded, it is replaced by a rudimentary selector engine based on the browser's `querySelectorAll` method that does not support jQuery selector extensions or enhanced semantics. See the [selector-native.js](https://github.com/jquery/jquery/blob/main/src/selector-native.js) file for details. +- **selector**: The full jQuery selector engine. When this module is excluded, it is replaced by a rudimentary selector engine based on the browser's `querySelectorAll` method that does not support jQuery selector extensions or enhanced semantics. See the [selector-native.js](https://github.com/jquery/jquery/blob/main/src/selector-native.js) file for details. -*Note*: Excluding Sizzle will also exclude all jQuery selector extensions (such as `effects/animatedSelector` and `css/hiddenVisibleSelectors`). +For backwards compatibility purposes, the name `sizzle` is recognized as the alias for `selector`. + +*Note*: Excluding the full `selector` module will also exclude all jQuery selector extensions (such as `effects/animatedSelector` and `css/hiddenVisibleSelectors`). The build process shows a message for each dependent module it excludes or includes. @@ -167,7 +169,7 @@ There is also a special alias to generate a build with the same configuration as grunt custom:slim ``` -For questions or requests regarding custom builds, please start a thread on the [Developing jQuery Core](https://forum.jquery.com/developing-jquery-core) section of the forum. Due to the combinatorics and custom nature of these builds, they are not regularly tested in jQuery's unit test process. The non-Sizzle selector engine currently does not pass unit tests because it is missing too much essential functionality. +For questions or requests regarding custom builds, please start a thread on the [Developing jQuery Core](https://forum.jquery.com/developing-jquery-core) section of the forum. Due to the combinatorics and custom nature of these builds, they are not regularly tested in jQuery's unit test process. Running the Unit Tests -------------------------------------- |