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 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

facebook-github-bot commented Jul 3, 2020

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!

@zaalbarxx zaalbarxx force-pushed the zaalbarxx:10226-pretty-print-not-handling-web-components branch from 58d47b7 to fca6f68 Jul 3, 2020
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 3, 2020

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 zaalbarxx:10226-pretty-print-not-handling-web-components branch 4 times, most recently from f942830 to 81a3d35 Jul 3, 2020
Copy link
Collaborator

SimenB left a comment

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 zaalbarxx:10226-pretty-print-not-handling-web-components branch from 81a3d35 to 0020c13 Jul 3, 2020
@SimenB
SimenB approved these changes Jul 3, 2020
Copy link
Collaborator

SimenB left a comment

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 facebook:master Jul 3, 2020
22 checks passed
22 checks passed
cleanup-runs
Details
Running TypeScript compiler & ESLint
Details
Node v10.x on ubuntu-latest
Details
Node v10.x on macOS-latest
Details
Node v10.x on windows-latest
Details
Node v12.x on ubuntu-latest
Details
Node v12.x on macOS-latest
Details
Node v12.x on windows-latest
Details
Node v13.x on ubuntu-latest
Details
Node v13.x on macOS-latest
Details
Node v13.x on windows-latest
Details
Node v14.x on ubuntu-latest
Details
Node v14.x on macOS-latest
Details
Node v14.x on windows-latest
Details
ci/circleci: test-jest-circus Your tests passed on CircleCI!
Details
ci/circleci: test-node-10 Your tests passed on CircleCI!
Details
ci/circleci: test-node-12 Your tests passed on CircleCI!
Details
ci/circleci: test-node-13 Your tests passed on CircleCI!
Details
ci/circleci: test-node-14 Your tests passed on CircleCI!
Details
ci/circleci: test-or-deploy-website Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
facebook.jest #20200703.26 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.