Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .changeset/modernize-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"babel-plugin-styled-components": minor
---

Refresh the toolchain and fix a handful of css-prop transform bugs that had crept in under recent Babel versions.
Refresh the dev toolchain and fix a handful of css-prop transform bugs.

- When a file already imports `styled` and also uses one or more `css={…}` props, every styled component now keeps its display name and stable component id. Previously the cache that tracks the local default import could be overwritten on each css-prop usage, which silently dropped the display name and id for the surrounding `styled.div` declarations.
- `css={{ [foo]: bar }}` with a non-primitive value no longer fails Babel's validator. Computed keys are preserved through the css-prop object rewrite.
- Friendlier error messages when the css-prop transform encounters a JSX name shape it can't infer, instead of a confusing internal `ReferenceError`.
- Long-running watch processes (Next dev, webpack-dev-server, jest watch) no longer leak import-detection state between files.
- Removed the runtime `lodash` dependency. The plugin now ships with `@babel/core` as a declared peer.
- Dev tooling moved to pnpm and changesets. Plugin behavior is unchanged.
- Files mixing regular styled components with `css={...}` props keep their display names and component ids again.
- `css={{ [foo]: bar }}` with a non-primitive value no longer crashes the build.
- `withConfig({ ...spread })` and `withConfig({ 'displayName': '...' })` no longer crash or silently override your explicit values.
- Errors from the css-prop transform now point at the offending source line.
- Long-running dev servers no longer leak detection state between files.
- Drops the `lodash` runtime dependency. `@babel/core` is now a declared peer.
- Dev tooling moved to pnpm and changesets.
Loading