-
Notifications
You must be signed in to change notification settings - Fork 5.3k
All: Migrate away from deprecated/removed Core APIs #1901
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
Conversation
jQuery.isArray will be removed in jQuery 4.0.
jQuery.isFunction will be removed in jQuery 4.0.
A jQuery object was created, chained & assigned to a variable that was then accessed in a callback used inside of this chained definition. Due to a timing difference in when the callback fired for the first time in latest jQuery master, it was being called before the variable was defined. This has been resolved now.
Newest jQuery returns fractional results in some cases, making comparisons fail when there's a tiny difference. Tests were modified to be less strict.
I’d appreciate a review from @jquery/core. Commit by commit might be the easiest. |
Also, cc @arschmitz @fnagel |
ad53219
to
8d307c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 by reading. Looks good!
@@ -14,7 +14,7 @@ return $.extend( helper, { | |||
if ( message === undefined ) { | |||
message = lastItem; | |||
} | |||
log.push( $.trim( message ) ); | |||
log.push( String.prototype.trim.call( message ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my mind, this calls into question the replacement of $.trim(…)
with ….trim()
in source files. Since the PR isn't intended to make any changes other than restoring functionality, perhaps we should be doing String.prototype.trim.call(…)
everywhere (or defining a local trim
function and using that, like you're doing with isWindow
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gibson042 I changed the order of commits to make the $.trim
changes the last one and modified all replacements to use String.prototype.trim.call
instead, as you advised.
While an util would be easier to use, I don't see any infrastructure in UI to create internal utility modules that can be used in other files and this change is needed in various parts of the repository. Not wanting to expose anything new on $.ui
(even if "internal" in theory), I went for String.prototype.trim.call
.
Pull request #1887 should be evaluated as well. |
jQuery.trim will be deprecated in jQuery 3.5.
Summary of the changes: * Build: Add jQuery 3.2.0-3.4.1 to versions UI can be tested against * Build: Load jQuery & Migrate via HTTPS * Build: Add package-lock.json to .gitignore * Build: Update jQuery Migrate from 3.0.0 to 3.1.0 * Build: Allow to run tests against jQuery 3.x-git * Build: Fix formatting according to JSCS rules * Build: Disable JSCS for the inlined jQuery Color * All: Switch from $.isArray to Array.isArray (jQuery.isArray will be removed in jQuery 4.0) * All: Switch from `$.isFunction( x )` to `typeof x === "function"` (jQuery.isFunction will be removed in jQuery 4.0) * All: Inline jQuery.isWindow as it'll be removed in jQuery 4.0 * Effects: Fix a timing issue in a variable declaration. Previously, a jQuery object was created, chained & assigned to a variable that was then accessed in a callback used inside of this chained definition. Due to a timing difference in when the callback fired for the first time in latest jQuery master, it was being called before the variable was defined. * Tests: Make dialog & draggable unit tests less strict (newest jQuery returns fractional results in some cases, making comparisons fail when there's a tiny difference) * All: Migrate from $.trim to bare String.prototype.trim (jQuery.trim will be deprecated in jQuery 3.5) Closes gh-1901
Landed in 98b5391. |
@mgol does this mean there is a Jquery UI release coming soon? it has been almost 3 years since last release. |
@melloware While I have commit access to this repository, I'm a member of the jQuery Core team, not the jQuery UI team. My primary goal here is to make UI compatible with recent jQuery versions and to prepare it as much as possible for a future jQuery 4.0 release. In this way people using jQuery UI won't be blocked from jQuery Core updates. When those compatibility updates are done, we'll want to do a UI release. I can't guarantee issues not related to Core compatibility will be addressed, though, that depends on whether people more familiar with UI internals review/merge PRs that touch them. |
With this patch & the upcoming jQuery Color update the UI
master
branch passes more or less the same tests with jQuerymaster
as with jQuery 3.4.1. Before it gets applied, it fails completely, hanging TestSwarm.