-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RFC: Package renaming #1635
Comments
I like it! Should make it much easier to figure out which package to import and whats being imported at a glance. |
Really like it! I'd consider We'd definitely need codemods for those to ease the migration. |
I was considering
💯 |
It's not that it can't be used with any other framework, but rather than it works with everything because it just returns "vanilla" class names 😅 I'm just a little bit worried that people will still be a little bit confused about us having 2 Also - cc @genevieveloreal @geddski - happy to accept your feedback regarding this. |
@Andarist my ultimate goal with v11 is to make @emotion/css and @emotion/react The My thinking is that |
Most of them seem like good changes to me! The only two that still aren't clear enough I think are:
|
This isn't really true, it also has a css function like
It's essentially the same as @emotion/native but for react-primitives |
Thanks for working on this! :) Here are some of my thoughts on this subject: As an Emotion user (and proponent!) I think this calls for a chart/graph/table, because of the sheer amount (14 today and proposed 9 packages in the future!) and partial overlap between the different features, flavors and runtimes. I also think that the docs should mirror that graph and start from a single "get started" entry point, which guides the user according to the target platform/runtime to more specific "recipe" documentation pages. Example: "for RN + RNW, use In addition, in order to make each package/recipe docs page clearer we can include sections like:
As for the proposed names and descriptions themselves:
Thanks again for Emotion and it's continued improvement! ❤️ |
Shouldn’t it be @emotion/react-styled? Same for |
@tkh44 Am I right when I'm saying that P.S. |
If u want to get string class names then just use emotion over @emotion/core. No black magic in that. Could u specify what's the problem with theming? Preferably with a code sample? |
@Andarist I have a shared components library. Here is one component: As you can see, I prefer exporting all my styles to a specific file - this makes the code MUCH cleaner...:
...and compose-able:
So finally I have a concept mix of I have always a It works until I build my lib (simple Why?
When I use one of my lib's components, I get So actually I'm installing both Should it be like that? |
I'm very glad to see this being discussed! I like the move of everything into Maybe emotion could do something similar? |
Renaming of packages got merged in v11 and newly named packages should be promptly available on npm as well. v11 has not been yet published as latest, but we are getting closer and closer to it. |
The links for `emotion` and `emotion-server` in the emotion example's readme were 404ing. After going to Emotion's repo, I noticed [the packages were renamed](emotion-js/emotion#1635). This PR updates the links: `emotion` -> `emotion/css` and `emotion-server` -> `emotion/server`
To reduce the current confusion, I’m proposing that we rename some packages as part of Emotion 11. Below is a summary of what the packages would look like with the renaming, this will likely be in the docs. At the bottom is a summary of the renames.
@emotion/react
Contains the react-specific version of Emotion. use this if you’re using React. Has different functionality and APIs from @emotion/css and doesn’t work the same way under the hood.
Depends on @emotion/cache
@emotion/styled
Contains the styled API, uses @emotion/react under the hood and wraps it with a different API.
Depends on @emotion/react
@emotion/css
Contains a framework agnostic version of Emotion. Has different functionality and APIs from @emotion/react and doesn’t work the same way under the hood.
Depends on @emotion/cache which which can be customised by creating a custom instance at @emotion/css/create-instance
@emotion/cache
A cache used by both of the main Emotion APIs. Can be used to provide a custom cache in @emotion/react with its CacheProvider. To customise the equivalent options for @emotion/css, @emotion/css/create-instance can create another instance of @emotion/css and it accepts
Depended upon by @emotion/react and @emotion/css
@emotion/babel-plugin
A Babel plugin to optimise for all Emotion packages
@emotion/eslint-plugin
ESLint rules for @emotion/css, @emotion/react and @emotion/styled
@emotion/server
Contains APIs for server rendering with @emotion/css. Can also work with @emotion/react if emotion’s cache is passed to @emotion/react’s CacheProvider
Has an optional peer dependency on @emotion/css for when @emotion/server is used directly but it’s an optional so that @emotion/server/create-instance can be used with any cache from @emotion/cache
@emotion/jest
Contains a Jest snapshot serializer and matchers for use with all Emotion packages
Depends on the behaviour of @emotion/cache so it therefore works with @emotion/react and @emotion/css
@emotion/native
Contains the styled API for React Native along with a css function similar to the ones from @emotion/css and @emotion/react except that it returns a React Native style object
@emotion/primitives
Contains the styled API for React Primitives along with a css function similar to the ones from @emotion/css and @emotion/react except that it returns a React Native style object.
@emotion/babel-preset-css-prop
A Babel preset to allow usage of the css prop everywhere without importing it
Uses @emotion/react and @emotion/babel-plugin
Renaming summary
Anything not mentioned here will stay as is:
@emotion/core → @emotion/react
emotion → @emotion/css
emotion-theming → into @emotion/react
emotion-server → @emotion/server
create-emotion → @emotion/css/create-instance
create-emotion-server → @emotion/server/create-instance
babel-plugin-emotion → @emotion/babel-plugin
eslint-plugin-emotion → @emotion/eslint-plugin
jest-emotion → @emotion/jest
The text was updated successfully, but these errors were encountered: