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

Turn off Emotion's warnings about potentially unsafe pseudo-selectors in renderDocs #18657

Closed
wants to merge 1 commit into from

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jul 7, 2022

Similar to #18361
fixes: #18656

Please retest this before merging.

@Andarist Andarist requested a review from tmeasday July 7, 2022 11:39
@nx-cloud
Copy link

nx-cloud bot commented Jul 7, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ccf55cc. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

<DocsContainer key={story.componentId} context={docsContext}>
<Page />
</DocsContainer>
<CacheProvider value={emotionCache}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've decided to wrap this here, even though theme (and other things too) is provided in DocsContainer because I think that it's best not to bust the cache on this key change. In reality Emotion's cache can't be as easily busted and recreated (it's not impossible but I don't see why I would want to implement this here) so you'd end up with a lot of duplicated styles with each new key on the DocsContainer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually... perhaps this is not the best place to do this since DocsContainer is totally configurable and is being injected here:

getContainer: async () => (await import('./blocks')).DocsContainer,

So maybe I should actually finally look into fixing the real issue in Emotion 😅

Copy link
Member

Choose a reason for hiding this comment

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

@Andarist I'm not quite following:

perhaps this is not the best place to do this since DocsContainer is totally configurable and is being injected here

Why is that an issue? Are you thinking that maybe people might want a custom container that doesn't use this emotion cache business?

BTW on the subject of the key={} there -- it looks like it was added for the sake of angular (legacy) inline rendering: #16149

So perhaps we could drop it in 7.0 (as we are dropping the old inline rendering).

Copy link
Member

Choose a reason for hiding this comment

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

@Andarist having chatted with others, seeing as we are getting rid of the old inline rendering, the use of key={} here is no longer needed. With this in mind would you change the placement of the <CacheProvider>?

Copy link
Member

Choose a reason for hiding this comment

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

I'm happy to update the PR with both changes (dropping the key, and moving the provider) if you let me know!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's maybe wait a week or so before moving on with this PR - I will try to investigate this in the Emotion itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A little bit later than I've promised - but I took a look there and I think that I understand where Stylis puts the comments much better now. Gonna recheck a couple of things but I think that I'm close to fixing this.

Copy link
Member

Choose a reason for hiding this comment

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

< 2x the promised time is pretty darn good in my books!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2022

Fails
🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","dependencies","other"]

Generated by 🚫 dangerJS against ccf55cc

<DocsContainer key={story.componentId} context={docsContext}>
<Page />
</DocsContainer>
<CacheProvider value={emotionCache}>
Copy link
Member

Choose a reason for hiding this comment

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

@Andarist I'm not quite following:

perhaps this is not the best place to do this since DocsContainer is totally configurable and is being injected here

Why is that an issue? Are you thinking that maybe people might want a custom container that doesn't use this emotion cache business?

BTW on the subject of the key={} there -- it looks like it was added for the sake of angular (legacy) inline rendering: #16149

So perhaps we could drop it in 7.0 (as we are dropping the old inline rendering).

@ndelangen
Copy link
Member

Hey @tmeasday This was assigned to me to bring it up to date with next but resolving the merge conflicts is a bit beyond me. Could you assist here?

@ndelangen
Copy link
Member

Has been fixed in another PR, AFICS

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.

Console error about server-side rendering on a Docs page
3 participants