This repository was archived by the owner on Mar 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
chore(deps): update emotion monorepo to v11 (major) #752
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/commercetools/commercetools-docs-kit/456nn2g1x |
🦋 Changeset detectedLatest commit: 7728212 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5e5447d
to
0566546
Compare
0566546
to
aeeaf43
Compare
FYI: waiting for |
emmenko
approved these changes
Nov 25, 2020
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
10.2.0
->11.0.0
10.x
->10.x || 11.x
10.1.1
->11.0.0
10.x
->10.x || 11.x
10.0.27
->11.0.0
10.0.33
->11.0.0
10.0.27
->11.0.0
^10.0.27
->^11.0.0
Release Notes
emotion-js/emotion
v11.0.0
Compare Source
Major Changes
b8476e08
#1675 Thanks @mitchellhamilton! - Rename@emotion/core
to@emotion/react
. Please change any imports of@emotion/core
to import@emotion/react
or use the@emotion/pkg-renaming
ESLint rule from@emotion/eslint-plugin
.cbb8b796
#1628 Thanks @Andarist! -emotion-theming
has been removed and all its exports were moved to@emotion/react
package. Please import them like thisimport { useTheme, ThemeProvider, withTheme } from '@​emotion/react'
from now on.a72e6dc
#1501 Thanks @JakeGinnivan! - TypeScript types have been significantly restructured. These changes:css
function has been restricted to prevent passing invalid typesstyled
's generic parameter has been changed, if you were specifying theComponentType
you will need to remove that generic parameterstyled
no longer takes a secondExtraProps
parameter - instead of that move it to after thestyled
call. So instead of writingstyled<typeof MyComponent, ExtraProps>(MyComponent)({})
you should now be writingstyled(MyComponent)<ExtraProps>({})
If you encounter build issues after upgrade, try removing any manually specified generic types and let them be inferred.
c6431074
#1609 Thanks @tomsseisums! - It's now easier to provide a type forTheme
. Instead of creating custom instances (like before) you can augment the builtinTheme
interface like this:f57a7229
#1941 Thanks @Andarist! - The way in which we provide TypeScript support for thecss
prop has changed. Based on the usage of our JSX factories, we can add support forcss
prop only for components that supportclassName
prop (as our JSX factory functions take the providedcss
prop, resolve it and pass the generatedclassName
to the rendered component).For the classic runtime this has been implemented using technique described here. What is important - we no longer extend any global interfaces, so people shouldn't bump anymore into type conflicts for the
css
prop when using different libraries withcss
prop support, such asstyled-components
.For the automatic runtime this has been implemented by exporting
JSX
namespace from the appropriate entries but this is only supported in TypeScript 4.1 or higher.However, if you are stuck with older version of TypeScript or using the classic runtime implicitly by using our
@emotion/babel-preset-css-prop
then it's not possible to leverage leveragecss
prop support being added conditionally based on a type of rendered component. For those cases we have added a special file that can be imported once to add support for thecss
prop globally, for all components. Use it like this:/// <reference types="@​emotion/react/types/css-prop" />
In this particular case we are forced to extend the existing
React.Attributes
interface. Previously we've been extending bothReact.DOMAttributes<T>
andJSX.IntrinsicAttributes
. This change is really minor and shouldn't affect any consuming code.843bfb11
#1630 Thanks @Andarist! - Removed default export from@emotion/css
- it's main purpose was to allowcss
to be a Babel macro, but since babel-plugin-macros allows us to keep imports nowadays this is no longer needed.@emotion/react/macro
has been added to account for this use case and appropriate changes has been made to@emotion/babel-plugin
to facilitate those changes.If you have used
@emotion/css
directly (it was always reexported from@emotion/react
) or you have been using its macro then you should update your code like this:You can also use the
@emotion/pkg-renaming
ESLint rule from@emotion/eslint-plugin
to do this for you.79036056
#967 Thanks @mitchellhamilton! - Use hooks internally for improved bundle size and a better tree in React DevTools9e998e37
#1817 Thanks @Andarist! - The parser we use (Stylis) got upgraded. It fixes some long-standing parsing edge cases while being smaller and faster 🚀It has been completely rewritten and comes with some breaking changes. The most notable ones that might affect Emotion users are:
prefix
option. This was always limited to turning off all of some of the prefixes as all available prefixes were on by default. Theprefix
option is gone and to customize which prefixes are applied you need to fork (copy-paste) the prefixer plugin and adjust it to your needs. While this being somewhat more problematic to setup at first we believe that the vast majority of users were not customizing this anyway. By not including the possibility to customize this through an extra option the final solution is more performant because there is no extra overhead of checking if a particular property should be prefixed or not.stylisPlugins
. If you plan to use customstylisPlugins
and you want to have your styles prefixed automatically you must include prefixer in your customstylisPlugins
. You can importprefixer
from thestylis
module to do that.@import
rules are no longer special-cased. The responsibility to put them first has been moved to the author of the styles. They also can't be nested within other rules now. It's only possible to write them at the top level of global styles.105de5c8
#1572 Thanks @Andarist! -[data-emotion]
attribute on SSRed styled has changed. You should never rely on it though.cf56694
#2088 Thanks @Andarist! - UMD filenames have been changed.Minor Changes
c672175b
#1130 Thanks @jtmthf! - Support functions in arrays passed tocss
prop andGlobal
's styles prop. This allows for composition of theme-accepting functions.828111cd
#1639 Thanks @Andarist! -Global
imported from macro entry (@emotion/react/macro
) gets source maps generated now when inline css-less expression is used as value of thestyles
prop.5d692a6a
#1956 Thanks @eps1lon! - Upgradedcsstype
dependency to its v3. This is what we use to provide TypeScript typings for object styles. The upgrade should not affect any consuming code but it's worth mentioning if any edge case scenarios arise.Patch Changes
7dea6d7a
#1734 Thanks @Andarist! - Fixed styles inserted by<Global/>
component not inheritingspeedy
option from a cache passed to a wrapping<CacheProvider/>
.5c55fd17
#1653 Thanks @Andarist! - Fix to what location generated source maps are pointing in case of composed styles.75e2f9e1
#1810 Thanks @Andarist! - Add a dev-only warning about styles created withcss
from@emotion/react
being passed tocx
from<ClassNames/>
.d62d9101
#1677 Thanks @ajs139! - Warn if@emotion/react
is initialized more than once in the same development environment.a085003d
#1613 Thanks @Andarist! - Add missing#__PURE__
annotations58dc08a6
#1837 Thanks @arcanis! - Fixed TS compatibility under PnP environments by making@types/react
an optional peer dependency.Updated dependencies [
a8eb4e75
,e3d7db87
,8a896a31
,42df3f3b
,4a891bf6
,1e4a741d
,debaad9a
,5c55fd17
,a085003d
,dfe79aca
,105de5c8
,39be057b
,105de5c8
,5d692a6a
,9e998e37
,c6431074
,9e998e37
,9e998e37
]:v10.2.1
Compare Source
Patch Changes
32c8528a
#2084 Thanks @Andarist! - Only use'@​babel/plugin-transform-react-jsx-development'
based on thedevelopment
option whenruntime
is set to"automatic"
. The classic runtime is not compatible with this plugin.Renovate configuration
📅 Schedule: "on the 1st and 3rd day instance on Wednesday after 3am" (UTC).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by WhiteSource Renovate. View repository job log here.