Skip to content
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

Rename packages #1675

Merged
merged 70 commits into from
Jan 5, 2020
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a92d0d0
WIP codemod for renaming
emmatown Dec 2, 2019
d0adefe
Lockfile changes
emmatown Dec 2, 2019
b3c687a
emotion -> @emotion/css
emmatown Dec 2, 2019
b9e065a
core -> react
emmatown Dec 2, 2019
2c29b38
Server stuff
emmatown Dec 2, 2019
088e2f3
Move removed packages to another directory
emmatown Dec 2, 2019
235cf6b
More things
emmatown Dec 2, 2019
f9c87ff
More things
emmatown Dec 2, 2019
5b9f62d
Some more things
emmatown Dec 2, 2019
834466d
Rename ESLint plugin
emmatown Dec 3, 2019
8fefbaa
Change name in @emotion/eslint-plugin CHANGELOG.md
emmatown Dec 5, 2019
a27ce89
Jest package and Babel plugin renmaes
emmatown Dec 5, 2019
97ac00f
Things
emmatown Dec 5, 2019
1bb0cdb
Update eslint plugin migration error message
emmatown Dec 5, 2019
de5f309
Formatting things
emmatown Dec 5, 2019
fd4af57
Fix some things
emmatown Dec 5, 2019
d907bc5
Upgrade babel-eslint
emmatown Dec 5, 2019
9d0cd2c
Add @emotion/pkg-renaming rule to ESLint config and run it
emmatown Dec 5, 2019
f531e7b
Update existing changesets
emmatown Dec 5, 2019
37fce68
Add some changesets
emmatown Dec 5, 2019
ecd0d92
Update removed-packages/create-emotion/src/index.js
emmatown Dec 9, 2019
53cefda
Update removed-packages/emotion/macro.js
emmatown Dec 9, 2019
0ada779
Update removed-packages/eslint-plugin-emotion/src/index.js
emmatown Dec 9, 2019
151d259
Merge branch 'next' into rename-packages
emmatown Dec 12, 2019
c5daf31
Update CodeSandbox CI config
emmatown Dec 12, 2019
aeef9e3
Fix some things
emmatown Dec 12, 2019
df06722
Fix more things
emmatown Dec 12, 2019
43f588d
Fix some stuff
emmatown Dec 12, 2019
e1456e6
Fix some more things
emmatown Dec 12, 2019
e7b6c20
More fixes
emmatown Dec 13, 2019
1eee2fc
Some things
emmatown Dec 13, 2019
6b186ae
Various updates for babel plugin
emmatown Dec 13, 2019
a0da5b6
Fix more things
emmatown Dec 13, 2019
af96613
Fix another thing
emmatown Dec 13, 2019
cbac45d
Things
emmatown Dec 13, 2019
8e3a1dd
More stuff
emmatown Dec 13, 2019
e8ac467
Bad linting rules.
emmatown Dec 13, 2019
c810b00
More things
emmatown Dec 13, 2019
586a10e
More changes
emmatown Dec 13, 2019
a5c3f02
Fix all the babel plugin stuff
emmatown Dec 13, 2019
217ccaf
Test the Babel plugin in dist tests because it's built now
emmatown Dec 13, 2019
208f0af
Fix docs site building maybe
emmatown Dec 13, 2019
08d2870
Update some snapshots
emmatown Dec 13, 2019
10b2423
Fix some more things
emmatown Dec 13, 2019
2e5d767
Hopefully actually fix it this time
emmatown Dec 13, 2019
09f2294
Replace @emotion/core with @emotion/react in a bunch of places
emmatown Dec 13, 2019
7a10f27
Fix TS types for @emotion/server/create-instance
emmatown Dec 16, 2019
3777dcd
Update snapshots
emmatown Dec 16, 2019
a53038b
Disable a TSLint rule
emmatown Dec 16, 2019
c5fac22
More changesets
emmatown Dec 17, 2019
14e8a65
Docs and things
emmatown Dec 17, 2019
1ff9c95
Fix more things
emmatown Dec 17, 2019
2f40e19
Fix a thing
emmatown Dec 17, 2019
fa7fe4b
Add a test:typescript script
emmatown Dec 18, 2019
567ab68
Merge branch 'next' into rename-packages
emmatown Dec 24, 2019
21a75c9
Use glob in CodeSandbox CI config
emmatown Dec 24, 2019
fe2d34b
Fix a thing
emmatown Dec 24, 2019
8b5d402
Fix TS things
emmatown Dec 24, 2019
0a8d700
ESLint plugin things
emmatown Dec 24, 2019
0937f45
Fix some things
emmatown Dec 24, 2019
6aa370f
Merge branch 'next' into rename-packages
emmatown Dec 31, 2019
575e6bb
Fix @emotion/server pkg.json syntax error
Andarist Jan 1, 2020
a68be5a
Update docs/package-summary.mdx
emmatown Jan 3, 2020
c9be621
Fix some things
emmatown Jan 3, 2020
431cf2d
Add docs for creating instances of @emotion/css
emmatown Jan 3, 2020
5bddee5
Fix some little things
emmatown Jan 4, 2020
26b5e96
Comment out a test
emmatown Jan 5, 2020
c5417de
Merge branch 'next' into rename-packages
emmatown Jan 5, 2020
1d44469
Fix some little things
emmatown Jan 5, 2020
efa8fae
ts@next..........
emmatown Jan 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .changeset/brave-rice-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/eslint-plugin': major
'eslint-plugin-emotion': major
---

Rename `eslint-plugin-emotion` to `@emotion/eslint-plugin`. Please replace `"plugins": ["emotion"]` with `"plugins": ["@emotion"]` and `emotion/` with `@emotion/` in your rules config in your ESLint config.
2 changes: 1 addition & 1 deletion .changeset/clever-emus-watch.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'babel-plugin-emotion': minor
'@emotion/babel-plugin': minor
'@emotion/babel-preset-css-prop': minor
---

Expand Down
5 changes: 5 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@
"linked": [
[
"@emotion/core",
"@emotion/react",
"@emotion/styled",
"@emotion/styled-base",
"@emotion/cache",
"@emotion/css",
"create-emotion",
"emotion",
"emotion-server",
"@emotion/server",
"create-emotion-server",
"babel-plugin-emotion",
"@emotion/babel-plugin",
"@emotion/babel-preset-css-prop",
"jest-emotion",
"@emotion/jest",
"@emotion/native",
"@emotion/primitives",
"@emotion/primitives-core",
"eslint-plugin-emotion",
"@emotion/eslint-plugin",
"emotion-theming"
]
],
Expand Down
2 changes: 1 addition & 1 deletion .changeset/flat-adults-add.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'jest-emotion': patch
'@emotion/jest': patch
---

Take specificity into account when matching styles
4 changes: 2 additions & 2 deletions .changeset/four-cars-tell.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
'@emotion/core': major
'@emotion/react': major
'@emotion/styled': major
---

Reworked TypeScript definitions so it's easier to provide a type for Theme. Instead of creating custom instances (like before) you can augment builtin Theme interface like this:

```ts
declare module '@emotion/core' {
declare module '@emotion/react' {
export interface Theme {
primaryColor: string
secondaryColor: string
Expand Down
2 changes: 1 addition & 1 deletion .changeset/giant-oranges-impress.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'babel-plugin-emotion': major
'@emotion/babel-plugin': major
'@emotion/babel-preset-css-prop': major
---

Expand Down
6 changes: 6 additions & 0 deletions .changeset/grumpy-news-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/babel-plugin': major
'babel-plugin-emotion': major
---

Rename `babel-plugin-emotion` to `@emotion/babel-plugin`. Please replace `"plugins": ["emotion"]` with `"plugins": ["@emotion"]` in your Babel config.
2 changes: 1 addition & 1 deletion .changeset/large-snakes-ring.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'babel-plugin-emotion': minor
'@emotion/babel-plugin': minor
'@emotion/babel-preset-css-prop': minor
---

Expand Down
2 changes: 1 addition & 1 deletion .changeset/lazy-elephants-stare.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@emotion/core': patch
'@emotion/react': patch
'@emotion/serialize': patch
---

Expand Down
2 changes: 1 addition & 1 deletion .changeset/light-mice-relate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'babel-plugin-emotion': patch
'@emotion/babel-plugin': patch
---

Avoid transpiling vanilla emotion calls in already transpiled code to avoid double labels and such
2 changes: 1 addition & 1 deletion .changeset/long-apes-admire/changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": ["@emotion/serialize"]
},
{
"name": "@emotion/core",
"name": "@emotion/react",
"type": "patch",
"dependencies": [
"@emotion/css",
Expand Down
2 changes: 1 addition & 1 deletion .changeset/lovely-owls-remember.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@emotion/core': minor
'@emotion/react': minor
---

Support functions in arrays passed to css prop and Global's styles prop. This allows for composition of theme-accepting functions.
2 changes: 1 addition & 1 deletion .changeset/mean-deers-confess.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'jest-emotion': major
'@emotion/jest': major
---

Added the `T` parameter to the `Matchers` interface in the TypeScript definitions to make this module compatible with `@types/jest@^24.0.20`.
2 changes: 1 addition & 1 deletion .changeset/modern-grapes-obey.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'babel-plugin-emotion': major
'@emotion/babel-plugin': major
---

Drop Babel 6 support
4 changes: 2 additions & 2 deletions .changeset/moody-stingrays-sort.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@emotion/core': minor
'@emotion/react': minor
---

`Global` imported from macro entry (`@emotion/core/macro`) gets source maps generated now when inline css-less expression is used as value of the `styles` prop.
`Global` imported from macro entry (`@emotion/react/macro`) gets source maps generated now when inline css-less expression is used as value of the `styles` prop.
2 changes: 1 addition & 1 deletion .changeset/neat-ligers-film.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'babel-plugin-emotion': patch
'@emotion/babel-plugin': patch
---

Fix issue with not updating referenced import when bailing out on already transpiled vanilla emotion nodes (a regression introduced in #1602)
6 changes: 6 additions & 0 deletions .changeset/nervous-clouds-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/react': major
'@emotion/core': major
---

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`.
2 changes: 1 addition & 1 deletion .changeset/nine-mugs-care.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@emotion/core': patch
'@emotion/react': patch
'@emotion/is-prop-valid': patch
'@emotion/serialize': patch
---
Expand Down
6 changes: 6 additions & 0 deletions .changeset/odd-flowers-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/css': major
'create-emotion': major
---

Move create `create-emotion` to `@emotion/css/create-instance`. Please change any imports of `create-emotion` to import `@emotion/css/create-instance` or use the `@emotion/pkg-renaming` ESLint rule from `@emotion/eslint-plugin`.
6 changes: 6 additions & 0 deletions .changeset/purple-teachers-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/jest': major
'jest-emotion': major
---

Rename `jest-emotion` to `@emotion/jest`. Please replace `"snapshotSerializers": ["jest-emotion"]` with `"snapshotSerializers": ["@emotion/jest"]` if you're using the snapshot serializer. Also replace any imports of `jest-emotion` with `@emotion/jest` or use the `@emotion/pkg-renaming` ESLint rule from `@emotion/eslint-plugin`.
6 changes: 4 additions & 2 deletions .changeset/rare-books-own.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
'babel-plugin-emotion': major
'@emotion/babel-plugin': major
Andarist marked this conversation as resolved.
Show resolved Hide resolved
'@emotion/cache': major
'@emotion/core': major
'@emotion/react': major
'create-emotion': major
'create-emotion-server': major
'@emotion/css': major
'emotion': major
'emotion-server': major
'@emotion/server': major
'emotion-theming': major
'@emotion/jest': major
'jest-emotion': major
'@emotion/native': major
'@emotion/primitives': major
Expand Down
2 changes: 1 addition & 1 deletion .changeset/rare-toes-grow.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'jest-emotion': patch
'@emotion/jest': patch
---

Match rules in declarations with component used as a selector
2 changes: 1 addition & 1 deletion .changeset/rich-hotels-sing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@emotion/core': patch
'@emotion/react': patch
---

Fix issue with published TypeScript test files augmenting Theme interface.
6 changes: 6 additions & 0 deletions .changeset/rotten-adults-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/server': major
'emotion-server': major
---

Rename `emotion-server` to `@emotion/server`. Please change any imports of `emotion-server` to import `@emotion/server` or use the `@emotion/pkg-renaming` ESLint rule from `@emotion/eslint-plugin`.
6 changes: 6 additions & 0 deletions .changeset/shaggy-cheetahs-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/css': major
'emotion': major
---

Rename `emotion` to `@emotion/css`. Please change any imports of `emotion` to import `@emotion/css` or use the `@emotion/pkg-renaming` ESLint rule from `@emotion/eslint-plugin`.
2 changes: 1 addition & 1 deletion .changeset/silver-bulldogs-beg.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'eslint-plugin-emotion': minor
'@emotion/eslint-plugin': minor
---

Respect `syntax-preference` rule when using css prop.
14 changes: 8 additions & 6 deletions .changeset/smooth-carpets-matter.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
---
'babel-plugin-emotion': major
'@emotion/core': major
'@emotion/babel-plugin': major
'@emotion/react': major
'@emotion/css': major
---

Removed `@emotion/css` - it's main purpose was to allow `css` to be a Babel macro, but since babel-plugin-macros allows us to keep imports nowadays this is no longer needed. `@emotion/core/macro` has been added to account for this use case and appropriate changes has been made to `babel-plugin-emotion` to facilitate those changes.
Removed default export from `@emotion/css` - it's main purpose was to allow `css` 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/core`) or you have been using its macro then you should update your code like this:
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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should review all changesets & changelogs carefully after merging this in. Some changesets should still refer to old names, like for example in here - it should still stay as "(it was always reexported from @emotion/core".

And probably best to keep copies of existing changelogs in old and new packages?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump - we should mentioned here that it was always reexported from @emotion/core, optionally we can mention that it has been renamed now to @emotion/react


```diff
-import css from '@emotion/css'
+import { css } from '@emotion/core'
+import { css } from '@emotion/react'

// or
-import css from '@emotion/css/macro'
+import { css } from '@emotion/core/macro'
+import { css } from '@emotion/react/macro'
```

You can also use the `@emotion/pkg-renaming` ESLint rule from `@emotion/eslint-plugin` to do this for you.
6 changes: 6 additions & 0 deletions .changeset/soft-moose-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/server': major
'create-emotion-server': major
---

Move `create-emotion-server` to `@emotion/server/create-instance`. Please change any imports of `create-emotion-server` to import `@emotion/server/create-instance` or use the `@emotion/pkg-renaming` ESLint rule from `@emotion/eslint-plugin`.
4 changes: 2 additions & 2 deletions .changeset/sour-poets-move.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@emotion/core': patch
'@emotion/react': patch
---

Warn if @emotion/core is initialized more than once in the same development environment.
Warn if @emotion/react is initialized more than once in the same development environment.
2 changes: 1 addition & 1 deletion .changeset/spotty-llamas-mate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'babel-plugin-emotion': major
'@emotion/babel-plugin': major
'@emotion/styled-base': major
'@emotion/styled': major
---
Expand Down
4 changes: 2 additions & 2 deletions .changeset/stupid-radios-draw.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'babel-plugin-emotion': minor
'@emotion/babel-plugin': minor
'@emotion/babel-preset-css-prop': minor
---

Added the `importMap` option which allows you to tell babel-plugin-emotion what imports it should look at to determine what it should transform so if you re-export Emotion's exports, you can still use the Babel transforms
Added the `importMap` option which allows you to tell @emotion/babel-plugin what imports it should look at to determine what it should transform so if you re-export Emotion's exports, you can still use the Babel transforms
2 changes: 1 addition & 1 deletion .changeset/two-baboons-mate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@emotion/core': major
'@emotion/react': major
'emotion-theming': major
'@emotion/native': major
'@emotion/primitives-core': major
Expand Down
2 changes: 1 addition & 1 deletion .changeset/two-kiwis-give.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'babel-plugin-emotion': minor
'@emotion/babel-plugin': minor
---

`Global` gets handled by the Babel plugin now - this gives inline css-less expressions source maps.
5 changes: 5 additions & 0 deletions .changeset/violet-spiders-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/eslint-plugin': minor
---

Add @emotion/pkg-renaming rule for Emotion 11 migration
4 changes: 2 additions & 2 deletions .changeset/weak-islands-confess.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'@emotion/core': major
'@emotion/react': major
'emotion-theming': major
---

`emotion-theming` has been removed and all its exports were moved to `@emotion/core` package. Please import them like this `import { useTheme, ThemeProvider, withTheme } from '@emotion/core'` from now on.
`emotion-theming` has been removed and all its exports were moved to `@emotion/react` package. Please import them like this `import { useTheme, ThemeProvider, withTheme } from '@emotion/react'` from now on.
12 changes: 1 addition & 11 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"packages": [
"packages/babel-plugin-emotion",
"packages/cache",
"packages/core",
"packages/create-emotion",
"packages/css",
"packages/emotion",
"packages/emotion-theming",
"packages/serialize",
"packages/styled"
],
"packages": ["packages/*"],
"sandboxes": ["pk1qjqpw67"]
}
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/--bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ assignees: ''

**Environment information:**

<!-- Provide the `react` and `emotion` or `@emotion/*` packages versions -->
<!-- Provide the `react` and `@emotion/*` packages versions -->

- `react` version:
- `emotion` version:
- `@emotion/react` version:
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ Frequently viewed docs:
Get up and running with a single import.

```bash
npm install --save @emotion/core
npm install --save @emotion/react
```

```jsx
/** @jsx jsx */
import { jsx } from '@emotion/core'
import { jsx } from '@emotion/react'

let SomeComponent = props => {
return (
Expand All @@ -60,7 +60,7 @@ let SomeComponent = props => {

The babel plugin is not required, but enables some optimizations and customizations that could be beneficial for your project.

Look here 👉 _[emotion babel plugin feature table and documentation](https://github.com/emotion-js/emotion/tree/master/packages/babel-plugin-emotion)_
Look here 👉 _[emotion babel plugin feature table and documentation](https://github.com/emotion-js/emotion/tree/master/packages/babel-plugin)_

### Demo Sandbox

Expand Down
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ module.exports = api => {
((!filename.includes('no-babel') &&
needsBabelPluginEmotion(filename)) ||
filename.includes(path.join('__tests__', 'babel'))),
plugins: ['babel-plugin-emotion']
plugins: ['@emotion/babel-plugin']
},
{
test: filename =>
filename &&
filename.includes('source-map') &&
needsBabelPluginEmotion(filename),
plugins: [['babel-plugin-emotion', { sourceMap: true }]]
plugins: [['@emotion/babel-plugin', { sourceMap: true }]]
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions docs/babel-macros.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ All of Emotion's Babel Macros are available by adding `/macro` to the end of the

```jsx
import styled from '@emotion/styled/macro'
import { jsx, css, Global, keyframes } from '@emotion/core/macro'
import { css, keyframes, injectGlobal } from 'emotion/macro'
import { jsx, css, Global, keyframes } from '@emotion/react/macro'
import { css, keyframes, injectGlobal } from '@emotion/css/macro'
```

> Note
>
> There are some optimisations which aren't possible with Babel Macros, so if it's possible, we still recommend using babel-plugin-emotion
> There are some optimisations which aren't possible with Babel Macros, so if it's possible, we still recommend using @emotion/babel-plugin
Loading