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

Fixed an issue with multiple Emotion caches moving SSRed styles to head at their initialization times #2028

Merged
merged 1 commit into from
Oct 3, 2020

Conversation

Andarist
Copy link
Member

@Andarist Andarist commented Oct 1, 2020

fixes #1945

If this gets accepted then I'll add changeset and some basic tests. Personally, I'm not super fond of this - I would much rather like to remove this initialization side-effect altogether, but 🤷‍♂️

This ensures that no styles are moved twice by adding a marker data attribute to:

  • moved styles
  • all styles inserted at runtime

@Andarist Andarist requested a review from emmatown October 1, 2020 14:03
@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2020

🦋 Changeset detected

Latest commit: 7719cf3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@emotion/sheet Patch
@emotion/cache Patch
@emotion/css Patch
@emotion/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 1, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7719cf3:

Sandbox Source
Emotion Configuration
Emotion issue template Issue #1945

Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

✅ on the approach

packages/cache/src/index.js Outdated Show resolved Hide resolved
@Andarist Andarist force-pushed the fix/multiple-instances-moving-ssr-styles branch from 2fe8645 to a453511 Compare October 2, 2020 14:39
@Andarist Andarist force-pushed the fix/multiple-instances-moving-ssr-styles branch from a453511 to 7719cf3 Compare October 2, 2020 15:04
@Andarist Andarist requested a review from emmatown October 2, 2020 15:05
@emmatown emmatown merged commit 42df3f3 into next Oct 3, 2020
@emmatown emmatown deleted the fix/multiple-instances-moving-ssr-styles branch October 3, 2020 02:08
@github-actions github-actions bot mentioned this pull request Oct 3, 2020
@github-actions github-actions bot mentioned this pull request Nov 10, 2020
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