Here's how im thinking to solve rendering the minimal amount of CSS on the server while also not blowing out the bundle size 馃憞
1
3
1. Context on the server. It's the only solution because of async ssr. Singleton won't work like I thought it could before (and tbh the api was yuck, having a flush func to call after SSR? Gross!)
Each compiled component needs to both be a context provider and consumer.
2
I assumed there needs to be a provider *somewhere* above any compiled component, but not necessarily wrapping every compiled component. What am I missing?
1
1
that's why (on the server) every compiled component will be BOTH a provider AND a consumer
it keeps it 0 config - so you as a consumer don't have to worry about it
1
one thing i want to see if we can accomplish is 0 context on the client.
even for theming.
Apr 20, 2020 路 1:07 AM UTC
One thing that caught me out with using emotion is rendering content into an iframe (this story wasn't well supported until emotion 10). I would imagine this use case would be harder to support without using context.
2
Isolation - rendering a preview component on the parent page, emotion is actually quite popular among shadow dom crowd because they can target where styles are being injected
1
1


