-
Notifications
You must be signed in to change notification settings - Fork 20.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-expose jQuery.find.tokenize #5259
Comments
This is my omission - my goal was to preserve all the Sizzle API that was exposed via I re-checked all We'll fix it in Now, I am wondering whether not to preserve this for 4.0.0 as well. This is the current jQuery 3.7.0 jQuery.find = find;
// Deprecated
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
jQuery.unique = jQuery.uniqueSort;
// These have always been private, but they used to be documented
// as part of Sizzle so let's maintain them in the 3.x line
// for backwards compatibility purposes.
find.compile = compile;
find.select = select;
find.setDocument = setDocument;
find.escape = jQuery.escapeSelector;
find.getText = jQuery.text;
find.isXML = jQuery.isXMLDoc;
find.selectors = jQuery.expr;
find.support = jQuery.support;
find.uniqueSort = jQuery.uniqueSort; The latter part that aliases jQuery APIs back to find.compile = compile;
find.select = select;
find.setDocument = setDocument; (together with |
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` * `jQuery.find.tokenize` Fixes jquerygh-5259 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
PR: #5260 |
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` * `jQuery.find.tokenize` Fixes jquerygh-5259 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` * `jQuery.find.tokenize` Fixes jquerygh-5259 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` * `jQuery.find.tokenize` Fixes jquerygh-5259 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
Tokenize is important and will stick around beyond the selector rewrite, so I think it's okay to leave exposed and document in the long term. I can see how it would remain useful. As for which other methods to keep exposed when we do the rewrite, I don't know if I'll be able to say that for sure until we get to the rewrite. |
@timmywil Yeah, I can imagine it's hard to judge what will still be there after the rewrite. But the decision we need to take now is what to still expose in 4.0. I'd propose to re-add the following block to find.compile = compile;
find.select = select;
find.setDocument = setDocument;
find.tokenize = tokenize; where The only from this list usefulness of which is not so obvious to me is |
I agree with all of that. We can take our time and wait to remove anything until 5.0. |
Would any consideration be given to releasing the tokeniser as a subpackage in its own right? Users may want to use the tokeniser directly, given its usefulness for analysing selectors. For example, there are other packages such as |
Publishing a new package incurs additional maintenance cost and we don't have a lot of free cycles for such things. Not to mention that this is just a small part of jQuery and if we considered publishing it separately, there would potentially be many other parts warranting similar treatment. The community is free to publish something by themselves based on jQuery code. Alternatively, in jQuery 4.0 you'll be able to do something like: import tokenize from 'jquery/src/selector/tokenize.js'; as the tokenizer has been extracted to a separate file and jQuery 4.x source will be exposed and using ES modules. |
@bezborodow Also, remember that the jQuery tokenizer only handles what jQuery needs and e.g. doesn't support pseudo-elements as they cannot be used in element queries, only in stylesheets. |
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes jquerygh-5259 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes jquerygh-5259 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes jquerygh-5259 Ref jquerygh-5260 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes jquerygh-5259 Ref jquerygh-5263 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. Some other APIs so far only exposed on the `3.x` line are also added back: * `jQuery.find.select` * `jQuery.find.compile` * `jQuery.find.setDocument` In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes jquerygh-5259 Ref jquerygh-5260 Ref jquery/sizzle#242 Ref jquerygh-5113 Ref jquerygh-4395 Ref jquerygh-4406
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. Some other APIs so far only exposed on the `3.x` line are also added back: * `jQuery.find.select` * `jQuery.find.compile` * `jQuery.find.setDocument` In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes gh-5259 Closes gh-5263 Ref gh-5260 Ref jquery/sizzle#242 Ref gh-5113 Ref gh-4395 Ref gh-4406
`Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes gh-5259 Closes gh-5260 Ref gh-5263 Ref jquery/sizzle#242 Ref gh-5113 Ref gh-4395 Ref gh-4406
Originally posted by @bezborodow in jquery/sizzle#242 (comment)
The text was updated successfully, but these errors were encountered: