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: pretty-print web components properly #10237

Conversation

zaalbarxx
Copy link
Contributor

@zaalbarxx zaalbarxx commented Jul 3, 2020

--added support for properly serializing/printing custom elements by pretty-print

Summary

Previously serializing the custom elements would not be handled properly by DOMElement plugin of pretty-print and instead of element's HTML markup all of the custom element properties along with it's constructor name would be printed instead. Now custom elements will be treated in DOMElement plugin as the built-in DOM elements.

Fixes #10226

Test plan

Unit tests were written so yarn jest DOMElement.test.ts (supports custom elements test) will test if it's working.

@facebook-github-bot
Copy link
Contributor

Hi @zaalbarxx!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@zaalbarxx zaalbarxx force-pushed the 10226-pretty-print-not-handling-web-components branch 4 times, most recently from f942830 to 81a3d35 Compare July 3, 2020 13:20
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Thanks! Just left some nits

CHANGELOG.md Outdated Show resolved Hide resolved
packages/pretty-format/src/plugins/DOMElement.ts Outdated Show resolved Hide resolved
packages/pretty-format/src/plugins/DOMElement.ts Outdated Show resolved Hide resolved
--added support for properly serializing/printing custom elements by pretty-print
@zaalbarxx zaalbarxx force-pushed the 10226-pretty-print-not-handling-web-components branch from 81a3d35 to 0020c13 Compare July 3, 2020 13:37
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Thanks!

@SimenB SimenB changed the title [bugfix] 10226 - pretty-print not handling web components properly feat: pretty-print web components properly Jul 3, 2020
@SimenB SimenB merged commit 10375b3 into jestjs:master Jul 3, 2020
@SimenB
Copy link
Member

SimenB commented Aug 12, 2020

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pretty-print not handling web components properly
3 participants