Skip to content
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

V1: mount/unmount concept and automatic scheduling #33272

Merged
merged 13 commits into from
Mar 18, 2021

Conversation

dvoytenko
Copy link
Contributor

@dvoytenko dvoytenko commented Mar 15, 2021

Partial for #31915.
Partial for #31540.

Key changes:

  • The mount/unmount callbacks are added to a V1 element API. They are called automatically on first build, attach/detach from DOM, manual unmount, etc. They are similar to layout/unlayout callbacks, but meant to be executed with build and more "like build, but reversible".
  • Builder now calls mountInternal() on an element. Consequently it's renamed to Scheduler.
  • BaseElement.load() is added to make build->load states a little less fragile.
  • The layoutCallback, unlayoutCallback, pauseCallback, and resumeCallback in the CustomElement have been deprecated.

TODO:

  • Complete the remaining tests

src/base-element.js Outdated Show resolved Hide resolved
src/base-element.js Outdated Show resolved Hide resolved
src/base-element.js Outdated Show resolved Hide resolved
src/custom-element.js Outdated Show resolved Hide resolved
src/service/resource.js Outdated Show resolved Hide resolved
src/service/resource.js Outdated Show resolved Hide resolved
src/custom-element.js Show resolved Hide resolved
src/custom-element.js Show resolved Hide resolved
src/custom-element.js Outdated Show resolved Hide resolved
src/custom-element.js Show resolved Hide resolved
src/custom-element.js Show resolved Hide resolved
src/custom-element.js Show resolved Hide resolved
Copy link
Contributor

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

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

One last question, otherwise I think it's good.

src/custom-element.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants