Docz: Bug/Task: Upgrade to emotion 10

Created on 4 Dec 2018  ยท  18Comments  ยท  Source: doczjs/docz

Emotion has upgraded several components to support server-side rendering as well as some other benefits. We will need to upgrade to...
@emotion/core & @emotion/styled

emotion-theming just needs a version upgrade.

IssueHuntFest

All 18 comments

As part of this it would be convenient if the jsxPragma in mdx files was updated to use emotion's jsx function. This would allow usage of the css prop in mdx files.

@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt

This would allow usage of the css prop in mdx files.

THIS WOULD BE AMAZING

I wonder if there could be a way to isolate my code from docz's code so we don't have these version mis-matches in the future.

I guess that's why storybook uses iframes. I'm not hugely excited by that, but I wonder if we could accomplish something similar by either using portals or something...

Or maybe some manual ReactDOM.render to keep my tree outside of your tree?

@kentcdodds it looks like mdx-js/mdx#166 is the blocker for allowing usage of the css prop in mdx files for now.

In regards to isolating emotion, it doesn't seem like that is needed. I've now tested both emotion 10 components running in emotion 9 docz and vice versa with no issues. It seems that as long as each module pulls in its specified version of emotion, they don't conflict with each other.

When I tried upgrading emotion to 10 today I got an error in the playground components I rendered. Something about context.stylis not being defined ๐Ÿค”

Same for me which prompted this issue ๐Ÿ˜ž

thanks by the job @jtmthf, I'm merging your pull request now ๐Ÿ™

@pedronauck has submitted a pull request. See it on IssueHunt

@pedronauck has rewarded $28.00 to @pedronauck. See it on IssueHunt

  • :moneybag: Total deposit: $40.00
  • :tada: Repository reward(20%): $8.00
  • :wrench: Service fee(10%): $4.00

Landed on 0.12.16 โœ…

Hooray! Thank you ๐Ÿ‘

I don't get if it's still possible to use the emotion 10 css prop in mdx files, particularly in Playground components.
I used to do this with emotion 9 and it worked. How to do the same with the new version?

<Playground
  css={`
    button:not(:first-child) {
      margin-left: 10px;
    }
  `}
>
  <Button>Click me</Button>
  <Button disabled>Disabled</Button>
</Playground>

@dotlouis Did you ever find the answer?

I did not. I've moved on from the project where I was using docz so I haven't used it in a while and I'm not sure what the status is here.

@rakannimer can we help us here?

Using emotion css prop with any component in MDX files doesn't work (not only Playground).

I opened a new issue to track and work on this : #1346

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hayk94 picture hayk94  ยท  3Comments

ssylvia picture ssylvia  ยท  3Comments

capaj picture capaj  ยท  3Comments

mquandalle picture mquandalle  ยท  3Comments

kachkaev picture kachkaev  ยท  3Comments