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

refactor: use slotchange event instead of MutationObserver when possible #9316

Closed

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented May 10, 2024

Replaces MutationObserver + childList: true usage with slotchange event for simplification and performance reasons (slots already leverage mutation observer). Another benefit is that using slotchange eliminates conditions where callbacks may be invoked before the element has rendered.

@jcfranco jcfranco requested a review from a team as a code owner May 10, 2024 22:56
@github-actions github-actions bot added the refactor Issues tied to code that needs to be significantly reworked. label May 10, 2024
@jcfranco jcfranco marked this pull request as draft May 10, 2024 22:57
@jcfranco jcfranco changed the title refactor: use slotchange event instead of MutationObserver refactor: use slotchange event instead of MutationObserver when possible May 10, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label May 18, 2024
@benelan benelan changed the base branch from main to dev June 10, 2024 09:12
@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label Jun 11, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jun 18, 2024
@benelan benelan removed the request for review from a team July 16, 2024 23:48
@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label Jul 20, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jul 29, 2024
@jcfranco
Copy link
Member Author

Closing. Will revisit if needed after #10310.

@jcfranco jcfranco closed this Sep 13, 2024
@jcfranco jcfranco deleted the jcfranco/use-slotchange-vs-mutation-observer-if-possible branch September 13, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Issues tied to code that needs to be significantly reworked. Stale Issues or pull requests that have not had recent activity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant