React-select: [v2] Support for Emotion 10

Created on 14 Dec 2018  路  9Comments  路  Source: JedWatson/react-select

react-select appears to depend on emotion 9. Similar to #3120, if I'm using a newer version of emotion (like 10) I'll have 2 versions of emotion at best (if it works). At the moment I'm running into typing errors between the two, but ideally we could upgrade react-select to emotion 10. If you're up for a PR doing this, I may have some time to pull that together.

Cheers!

issuenhancement issureviewed

Most helpful comment

That would also fix SSR issues for Next.js users without needing to set up the whole emotion-server infrastructure.

All 9 comments

That would also fix SSR issues for Next.js users without needing to set up the whole emotion-server infrastructure.

@aaronjensen thanks for raising the issue, this is something we have on our roadmap but haven't yet gotten to. If you still have the time, a PR to upgrade to emotion 10 would be greatly appreciated 馃憤

@gwyneplaine it looks like this was actually done and released here already: https://github.com/JedWatson/react-select/commit/4bad8b8dbe6ac5a4dacab1e712daf845c1bcdca9

@aaronjensen Thanks for the reply but I don't see it released on latest (2.4.2). I also don't see an alpha release. This issue should be open until it is released.

@andrerpena when I wrote this, I believe 2.2.0 was the latest version and it was using create-emotion 10 and not depending on emotion at all: https://unpkg.com/[email protected]/package.json

We used it successfully w/ emotion 10 on my last project. Since it appears this was undone https://github.com/JedWatson/react-select/commit/214a161c86b68732d6b37894a6c7e42d6331b0d7 I'll reopen.

Thank you so much @aaronjensen. This is important to unlock Next.js users

Hi all, for context, the upgrade to create-emotion 10 doesn't unlock zero-configuration SSR, actually it makes ssr more difficult as the same custom emotion instance needs to be passed to both the client side and server-side select. The work in #3260 didn't allow for an easy way to do that at all, at least not without making compromises to our API that would tightly couple react-select with emotion.

This is the primary reasoning behind the reversion in 2.3.0. For more details about this please see #3317 and #3346.

I'm looking to release 3.0.0 with an upgrade to emotion 10 with a NonceProvider export which should both unblock CSP users and enable true zero-config SSR, you can see the details of that pr here #3321.

@gwyneplaine That would be amazing! The Next.js community is growing rapidly and would love to use react-select!

Per the release notes, I believe we can consider this shipped and closed
https://github.com/JedWatson/react-select/releases/tag/react-select%403.0.3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

steida picture steida  路  3Comments

Meesam picture Meesam  路  3Comments

MalcolmDwyer picture MalcolmDwyer  路  3Comments

pashap picture pashap  路  3Comments

mjuopperi picture mjuopperi  路  3Comments