-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Workspace: deferred build mode #32002
Conversation
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.
We need experiment checks, too.
src/element-stub.js
Outdated
return false; | ||
} | ||
} | ||
export class ElementStub extends BaseElement {} |
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.
I wonder if we could simplify the upgrade code if we make ElementStub
a build-deferred extension?
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.
I tried that way. But I actually in the end liked the idea of not allocating any new object at all. And a bunch of if (this.impl_) {}
I ended up not hating too much. But I can be convinced otherwise.
src/service/deferred-builder.js
Outdated
this.unschedule(target); | ||
// DO NOT SUBMIT: check the perform of this `setTimeout`. How else to ensure | ||
// we do not over-build in a same task? | ||
this.ampdoc_.win.setTimeout(() => target.build()); |
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.
setTimeout
is extremely slow when called multiple times in a tick.
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.
Yeah. I'm still investigating this part. Not strictly necessary, but seemed like it'd be a missed opportunity to defer the work, but then still introduce a long task. Do you have any suggestions? I'd like to return control to the browser at least some of the time.
f338b98
to
2170d77
Compare
3b3b3fb
to
8329d8f
Compare
ecc3a69
to
1a90eb8
Compare
Close this in favor of #32568 ? |
1cbdec1
to
8658520
Compare
208cac9
to
5e5efed
Compare
5e5efed
to
81ae5af
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Partial for #31915.
Possibly conflicts with #31591.
The key points:
onload/onerror
structure allows to pick up multiple loading events when src changes, an iframe is paused, connect/reconnect happened, etc.