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

WIP: Improve Reliability of Button Component Re-rendering #937

Closed
wants to merge 11 commits into from

Conversation

sghoweri
Copy link
Contributor

Jira

http://vjira2:8080/browse/BDS-732

Summary

This PR includes several component rendering-related updates to proactively address some very specific HyperHTML-related domdiff library errors observed in Pattern Lab when heavily stress testing Bolt's component rendering / re-rendering behavior in a large variety of different situations and use cases.

Details

  1. Added additional test examples of button and icon components used in dynamically injected cards with varying time delays, but used inside of

    elements to force the inner components to not render to the Shadow DOM

  2. Updates the Bolt Base component internal processing / setup work to fix one of the domdiff errors thrown when dynamically injected <bolt-button>s that are not rendered to the Shadow DOM are then moved around the page after initially rendering

  3. Updates the HyperHTML base component renderer to not pass in any params to the HyperHTML wire() function which fixes another HyperHTML domdiff-related JavaScript error observed

  4. Updates the Bolt button component's internal JS logic that's responsible for handling the initial button and link HTML that max exist when the component initially boots up.

This PR specifically updates this logic to only run once (before the component has rendered) to prevent an occasional error from getting thrown relating to inner DOM changes that HyperHTML isn't expected.

  1. This PR also further simplifies and consolidates the button component's inner slot related JavaScript logic to help simplify the number of moving parts, make the code a bit more manageable, fix a JS error related to slot names not existing (observed in Node.js jest testing) and flatten out some of the internal template logic required.

How to test

TBD -- this PR is the reference point being used for additional testing coverage being worked on

…o exist in a selector that might also not exist
…omponent doesn't continue to try to process any original HTML after the button component has rendered the first time
…generated markup; refactor out logic that only applies to existing HTML
… the amount of work HyperHTML has to do when determining what, if any, has changed.
…S errors from getting thrown when slotted components are sometimes removed / re-attached from the page
…y aren't defined. fixes some of the JS errors thrown by HyperHTML when attempting to re-render / diff components that aren't rendered to the Shadow DOM
…that get rendered inside of a form — forces the icon and button components inside to be rendered outside the Shadow DOM to better isolate and test to confirm HyperHTML domdiff errors are being addressed
sghoweri pushed a commit that referenced this pull request Nov 2, 2018
sghoweri pushed a commit that referenced this pull request Nov 13, 2018
@sghoweri
Copy link
Contributor Author

Closing out -- superseded by #951

@sghoweri sghoweri closed this Nov 13, 2018
@sghoweri sghoweri mentioned this pull request Nov 18, 2018
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.

None yet

2 participants