-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add import mapping to babel plugin (#1220)
* Add stuff to babel plugin readme * Refactor styled macro * Refactor other macros * WIP more refactoring * Fix stuff * WIP * stuff * WIP stuff * More WIP stuff * WIP * Add a changeset * Remove instances option and other things * Fix some stuff * A bunch of FlowFixMes * Finish implementation and add a changeset * Update more things * Words * Remove obselete snapshots * Fix stuff * Fix docs * Fix things * Fix a bug
- Loading branch information
Showing
36 changed files
with
1,205 additions
and
571 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'babel-plugin-emotion': major | ||
'@emotion/babel-preset-css-prop': major | ||
--- | ||
|
||
Removed support for the `instances` option, any usage of it should be replaced with the `importMap` option |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'babel-plugin-emotion': patch | ||
--- | ||
|
||
Fix issue with not updating referenced import when bailing out on already transpiled vanilla emotion nodes (a regression introduced in #1602) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'babel-plugin-emotion': 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 |
This file contains 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 file contains 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
11 changes: 11 additions & 0 deletions
11
packages/babel-plugin-emotion/__tests__/__fixtures__/core-with-css-import-dynamic.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** @jsx jsx */ | ||
import { jsx, css } from '@emotion/core' | ||
|
||
const SomeComponent = props => ( | ||
<div | ||
css={css` | ||
color: ${window}; | ||
`} | ||
{...props} | ||
/> | ||
) |
4 changes: 4 additions & 0 deletions
4
packages/babel-plugin-emotion/__tests__/__fixtures__/dynamic.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @jsx jsx */ | ||
import { jsx } from '@emotion/core' | ||
|
||
const SomeComponent = props => <div css={{ color: window }} {...props} /> |
This file contains 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 file contains 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
Oops, something went wrong.