Skip to content

Commit ab3aaf5

Browse files
Version Packages (#422)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0c5f21d commit ab3aaf5

6 files changed

Lines changed: 13 additions & 21 deletions

.changeset/feat-css-prop-import-path.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/feat-follow-local-alias-of-styled.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fix-css-prop-object-key-shadowed-by-binding.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fix-recognize-ts-import-default-helper.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# babel-plugin-styled-components
22

3+
## 2.3.0
4+
5+
### Minor Changes
6+
7+
- 0c5f21d: Add a `cssPropImportPath` option to control which package the css-prop transform auto-imports `styled` from when the file has no existing styled import. Defaults to `'styled-components'` (existing behavior). React Native targets can set it to `'styled-components/native'` so the auto-injected import resolves to the right runtime.
8+
- 0c5f21d: Detect styled declarations that go through a local alias of the import, including the TypeScript theme-typing pattern `const styled = baseStyled as ThemedStyledInterface<MyTheme>`. After type-stripping Babel sees a plain `const styled = baseStyled`, and the detector now follows single-identifier alias chains so `styled.div` resolves back to the original import.
9+
10+
### Patch Changes
11+
12+
- 0c5f21d: Fix invalid output when a `css={{ ... }}` object key matches a local binding name (e.g. `({ position }) => <div css={{ position: 'absolute' }} />`). The reducer no longer mis-treats non-computed property names as scope references, so plain keys stay literal while only computed `[expr]` keys are extracted as prop interpolations.
13+
- 0c5f21d: Recognize TypeScript's `__importDefault` interop helper alongside Babel's `_interopRequireDefault`. Files compiled through `tsc` / `ts-jest` (which emit `var sc_1 = __importDefault(require('styled-components'))`) now flow into the same detection path as Babel-compiled output, so styled declarations downstream pick up `displayName` and `componentId` as expected.
14+
315
## 2.2.0
416

517
### Minor Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.2.0",
2+
"version": "2.3.0",
33
"name": "babel-plugin-styled-components",
44
"description": "Improve the debugging experience and add server-side rendering support to styled-components",
55
"repository": "styled-components/babel-plugin-styled-components",

0 commit comments

Comments
 (0)