-
Notifications
You must be signed in to change notification settings - Fork 14
AP-700 Export emotionCacheProviderFactory
so allow consumers to override classes
#46
Conversation
1bfb81a
to
a235d61
Compare
In the issue that you linked, they're talking about the issue potentially being caused by multiple instances of emotion being loaded. I noticed that this library has @emotion/core as a dependency. Maybe it should be listed as a peer dependency instead, so that the consumer is responsible for installing only one version of emotion. I remember seeing similar issues when a library was published with react as a dependency rather than a peer dependency. What do you think? Could that be the case here? |
I was thinking something similar, but happy to also go with this solution. |
Hope that works |
894255a
to
2c3f779
Compare
I tried using a peer dependency and found that the issue persisted. If someone else wants to take a look and prove me wrong, I'd very much appreciate it. |
Exporting the provider from space kit and importing it in engine front end "worked" for me I was a bit surprised that it was injecting style tags into the container (style tags into the style tag, rather than style rules into the style tag). It does seem to be working as advertised (my mistake with the assumption). I think we can work with that. Will fiddle with it a bit in the morning |
82bb868
to
9060aea
Compare
Exporting the provider and importing it in Engine Frontend does work I debugged by replacing the entirety of AppLayout's return value in engine-frontend with ( But, styles are placed nested inside the style tag Which feels weird. Everything works though Will defer to you folks on which way feels less weird (Switching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justinanastos I think we're all agreed any of the solutions are fine
I trust that you'll have taken a minute to consider the option of exporting the provider from spacekit but that one is still admittedly weird with nesting things in head
I hear you on that being weird @cheapsteak ; I only went with that because that's how their docs suggest doing it. I'd much rather have a |
@justinanastos I was referring to the other solution I found still ending up weird :) Since it specifies a "container" rather than a position, it'd injects style tags into whatever the container is, but there aren't really any valid containers that can both hold |
You're totally right @cheapsteak; it's def weird. |
/rebase |
9060aea
to
079c14b
Compare
71d9776
to
3b55335
Compare
f4afb3c
to
59e42fc
Compare
59e42fc
to
790fd39
Compare
CacheProvider
for all components that use emotionemotionCacheProviderFactory
so allow consumers to override classes
🚀 PR was released in v1.1.0 🚀 |
Ideally we'd want to use
<CacheProvder>
in the consumer application just like we'd want to use<ApolloProvider>
, but a bug in emotion prevents this: emotion-js/emotion#1386This provides a
emotionCacheProviderFactory
factory that consumers can use to create aCacheProvider
.Contributes to AP-700