Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom builds: use different ready code when excluding Deferred#2891

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
timmywil wants to merge15 commits intojquery:masterfromtimmywil:ready-build

Conversation

@timmywil
Copy link
Member

  • Modules depending on deferred are excluded when deferred is excluded (ajax, effects, queue, and core/ready). Whenever deferred is excluded, core/ready is replaced by core/ready-no-deferred.
  • jQuery.ready.promise has been removed andjQuery.ready made a thenable in core/ready.
  • When an error thrown from ready handler all subsequent handlers are not being invoked #1823 (error resiliency) has been addressed by giving up our synchronicity guarantee in ready handler execution after the ready event has been fired. This has multiple advantages. Besides error resiliency, it makes use of our standards-compatible.then in the.ready method.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified@markelog,@mgol and@mikesherov to be potential reviewers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm pretty sure you can get rid ofreadyPromise and just usereadyList directly.

// Prevent errors from freezing future callback execution (gh-1823)
// Not backwards-compatible as this does not execute sync
window.setTimeout( function() {
fn.call( document, jQuery );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we want to keep thedocument context? It's another backwards-compatible but non-Promise "feature". And if we do keep it, there should be verifying assertions in test/unit/ready.js.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Perhaps we can leave that subject to change/undocumented. I don't want to verify it if we're going to change it in a future version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm suggesting that we change it now, in both places.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Let's open another ticket then. This PR is already 2 tickets. I'd rather not hold it up. But I'm indifferent as to what context we use here.document still makes sense since it's the document ready handler.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This PR is theintroduction ofjQuery.ready.then... why start off on the wrong foot when we don't have to? It doesn't even make sense to create a ticket referencing behavior that hasn't landed. But I guess I'll put some text here just in case:

PerPromises/A+ andES2015,then callbacks should be called without athis context. And althoughjQuery.Deferred#*With methods provide context to callbacks, we are moving in the direction of increased standards compliance, and should stop providingdocument context tojQuery.ready callbacks while we're already making backwards-incompatible changes tojQuery.ready.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm fine with not passingdocument, we just need to document that and the fact that it's async now. I can do that in the release notes once this lands.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@gibson042 The change wouldn't just affectjQuery.ready.then, and I'm familiar with the spec on Promises. Like you said, the document context is for back-compat, as we still have$(function(){}) and$(document).ready(), and while some may preferPromise.resolve(jQuery.ready), I imagine that$(document).ready() and$(function() {}) will still be the most common, and adocument context still makes sense to me on the latter 2. Like I said tho, I'm not opposed to changing that, but we don't have to change it now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ok, I can accept that:gh-3026.

@timmywiltimmywil deleted the ready-build branchApril 4, 2016 15:26
@mgolmgol added Build and removed Needs review labelsSep 25, 2017
@locklockbot locked asresolvedand limited conversation to collaboratorsJan 18, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@timmywil@mention-bot@dmethvin@gibson042@mgol@jquerybot

[8]ページ先頭

©2009-2025 Movatter.jp