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

feat(material/core): Allow namespacing ripple-loader event handler #28699

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

RussellSprouts
Copy link
Contributor

ripple-loader registers an event handler on the document to do event delegation. If there are multiple instances of ripple-loader on one page, then they will both try to handle events for [mat-ripple-loader-uninitialized] elements. If a namespace is provided, then the handler will only handle events for [mat-ripple-loader-uninitialized="{namespace}"] elements.

ripple-loader registers an event handler on the document to do event delegation. If there are multiple instances of ripple-loader on one page, then they will both try to handle events for [mat-ripple-loader-uninitialized] elements. If a namespace is provided, then the handler will only handle events for [mat-ripple-loader-uninitialized="{namespace}"] elements.
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Mar 7, 2024
@wagnermaciel
Copy link
Contributor

@RussellSprouts Could you provide an example for this use case? I'm having trouble understanding how multiple instances of the ripple-loader are being instantiated when this service should be provided in root

@RussellSprouts
Copy link
Contributor Author

The internal bug is b/309675388 for more context.

I agree that there's no normal way to have multiple instances, but we have a special virtualization framework to embed a guest Angular app in our shell Angular app. The guest app code runs in an invisible iframe, and we virtualize the DOM so that the guest app elements are actual in the parent frame. So both ripple-loader instances are listening to events on the same document

@wagnermaciel
Copy link
Contributor

LGTM, but I feel like a better route could be to disable the ripple loader for nested angular apps. It might even be possible to automate the detection of nested apps so that there is no need for apps to first run into this issue and then go configure their global ripple config

@devversion devversion removed their request for review March 11, 2024 07:53
@RussellSprouts
Copy link
Contributor Author

Is there something I can do to re-trigger the internal presubmits to unblock this?

@crisbeto
Copy link
Member

Merging this since the corresponding internal change was submitted.

@crisbeto crisbeto self-assigned this Mar 13, 2024
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Mar 13, 2024
@crisbeto crisbeto merged commit e2a45bf into angular:main Mar 13, 2024
22 of 26 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants