Skip to content

Remove sc style nodes on cleanup #382

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

Merged
merged 3 commits into from
Jul 12, 2021

Conversation

atsikov
Copy link
Contributor

@atsikov atsikov commented Jul 12, 2021

On cleanup, jest-styled-components resets styled-components internal state, but leaves styles in document head. This leads to significant jsdom performance degradation in large tests.

This PR improves cleanup, so that style[data-styled-version] nodes are removed from the document.

Copy link
Contributor

@quantizor quantizor left a comment

Choose a reason for hiding this comment

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

I like this, could you add a test or two though?

@atsikov atsikov force-pushed the sc-nodes-cleanup branch from 8949400 to 3e8d4ce Compare July 12, 2021 15:17
@atsikov
Copy link
Contributor Author

atsikov commented Jul 12, 2021

@probablyup done, added a test

@quantizor quantizor merged commit e1be59f into styled-components:main Jul 12, 2021
@atsikov
Copy link
Contributor Author

atsikov commented Aug 27, 2021

@probablyup any plans to release this change?

@atsikov atsikov deleted the sc-nodes-cleanup branch November 9, 2021 14:13
@atsikov atsikov restored the sc-nodes-cleanup branch November 9, 2021 14:13
@atsikov atsikov deleted the sc-nodes-cleanup branch April 22, 2022 11:20
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.

3 participants