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

Do not fire requestResize if element inherits exclusion class #55

Closed

Conversation

pgross41
Copy link

@pgross41 pgross41 commented Aug 3, 2020

Summary

Add ability for other code (e.g. F-Twelve) to exclude themselves from XFC's requestResize function #45.

Example: Currently an endless loop occurs when using F-Twelve and XFC:

  • F-Twelve writes to the DOM every time console.log is called.
  • XFC calls console.log every time anything is written to the DOM.

This PR provides an exclusion class that F-Twelve can implement which will allow it to not trigger XFC.

Additional Details

It is common for an MPage developer to use F-Twelve as well as cerner-smart-embeddable-lib, they should able to use them both at the same time.

@mhemesath
Copy link
Contributor

mhemesath commented Aug 17, 2020

Should the correct fix here be to disable XFC from logging to console and instead allow a custom logger to be passed in? What specific event is XFC writing when something is added to the DOM? Its also possible XFC should be less chatty on the console.

@pgross41
Copy link
Author

Should the correct fix here be to disable XFC from logging to console and instead allow a custom logger to be passed in? What specific event is XFC writing when something is added to the DOM? Its also possible XFC should be less chatty on the console.

There are likely better options than this PR. In the issue I noted "It seems like this is meant to be called only on a resize, so maybe it needs to be smarter about detecting if the event is actually a resize or not." Here is everything being output:
image

Another option is don't write out if it's a duplicate resize message.

If we could pass in a dummy logger it would resolve the issue e.g. (message) => null. An option to disable XFC output entirely would also resolve the issue.

@pgross41
Copy link
Author

This is not the proper solution to the problem, will provide details on #45

@pgross41 pgross41 closed this Sep 16, 2020
@pgross41 pgross41 deleted the mutation-observer-conflict branch September 16, 2020 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants