From c4db5bb560a0ca4357adb254f8f1bef7ce9d767f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 22:24:49 +0000 Subject: [PATCH] Version Packages --- .changeset/blue-buttons-report.md | 5 ----- .changeset/css-prop-script-mode.md | 5 ----- .changeset/faster-transforms.md | 5 ----- .../fix-line-comment-after-multiline-value.md | 5 ----- .changeset/ignore-ambient-module-imports.md | 5 ----- .changeset/ignore-type-only-imports.md | 5 ----- .changeset/keep-namespace-import-recognized.md | 5 ----- .changeset/named-import-helper-order.md | 5 ----- .changeset/namespace-default-call-form.md | 5 ----- .changeset/real-styled-binding-names.md | 5 ----- .changeset/require-non-tag-exports.md | 5 ----- .changeset/string-aware-minify.md | 5 ----- CHANGELOG.md | 17 +++++++++++++++++ package.json | 2 +- 14 files changed, 18 insertions(+), 61 deletions(-) delete mode 100644 .changeset/blue-buttons-report.md delete mode 100644 .changeset/css-prop-script-mode.md delete mode 100644 .changeset/faster-transforms.md delete mode 100644 .changeset/fix-line-comment-after-multiline-value.md delete mode 100644 .changeset/ignore-ambient-module-imports.md delete mode 100644 .changeset/ignore-type-only-imports.md delete mode 100644 .changeset/keep-namespace-import-recognized.md delete mode 100644 .changeset/named-import-helper-order.md delete mode 100644 .changeset/namespace-default-call-form.md delete mode 100644 .changeset/real-styled-binding-names.md delete mode 100644 .changeset/require-non-tag-exports.md delete mode 100644 .changeset/string-aware-minify.md diff --git a/.changeset/blue-buttons-report.md b/.changeset/blue-buttons-report.md deleted file mode 100644 index 939c4cd2..00000000 --- a/.changeset/blue-buttons-report.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"babel-plugin-styled-components": patch ---- - -Add npm bugs metadata pointing to the GitHub issue tracker. diff --git a/.changeset/css-prop-script-mode.md b/.changeset/css-prop-script-mode.md deleted file mode 100644 index 8269d8f2..00000000 --- a/.changeset/css-prop-script-mode.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Fix a crash when the `css` prop is used in a CommonJS file without a `styled-components` import. diff --git a/.changeset/faster-transforms.md b/.changeset/faster-transforms.md deleted file mode 100644 index 161c7972..00000000 --- a/.changeset/faster-transforms.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Faster transforms: the plugin's own time drops about 2–4× on typical files and up to ~28× on CommonJS files with many `css` props. diff --git a/.changeset/fix-line-comment-after-multiline-value.md b/.changeset/fix-line-comment-after-multiline-value.md deleted file mode 100644 index 301d99a4..00000000 --- a/.changeset/fix-line-comment-after-multiline-value.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Fix line comments surviving minification when they follow the closing line of a multiline value (e.g. `minmax(\n 0,\n 1fr\n); // comment`). The comment check required balanced parentheses on the line, so the unmatched `)` made the comment look like it was inside a value; after lines were joined, styled-components treated everything after `//` as a comment and silently dropped the following declarations and nested blocks. Unmatched closing parentheses are now ignored, which also stops `url(//...)` values after them from being truncated. diff --git a/.changeset/ignore-ambient-module-imports.md b/.changeset/ignore-ambient-module-imports.md deleted file mode 100644 index 6972681c..00000000 --- a/.changeset/ignore-ambient-module-imports.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Fix components losing displayName and componentId when a `declare module` block also imports `styled-components`. diff --git a/.changeset/ignore-type-only-imports.md b/.changeset/ignore-type-only-imports.md deleted file mode 100644 index bd33addc..00000000 --- a/.changeset/ignore-type-only-imports.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Ignore `import type` from `styled-components` when finding the real `styled` import. diff --git a/.changeset/keep-namespace-import-recognized.md b/.changeset/keep-namespace-import-recognized.md deleted file mode 100644 index 558d6671..00000000 --- a/.changeset/keep-namespace-import-recognized.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Fix `styled.default.x` losing displayName and componentId with `import * as styled` alongside the css prop or a default import. diff --git a/.changeset/named-import-helper-order.md b/.changeset/named-import-helper-order.md deleted file mode 100644 index 02a1a47e..00000000 --- a/.changeset/named-import-helper-order.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Helpers imported before `styled` in a named import are recognized now. In `import { css, styled } from 'styled-components'`, `css` and `keyframes` are minified, and with pure annotations turned on they are marked pure. diff --git a/.changeset/namespace-default-call-form.md b/.changeset/namespace-default-call-form.md deleted file mode 100644 index 3f35e9b2..00000000 --- a/.changeset/namespace-default-call-form.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Fix broken output for `styled.default(Component)` with `import * as styled` or `require`. diff --git a/.changeset/real-styled-binding-names.md b/.changeset/real-styled-binding-names.md deleted file mode 100644 index 103c9a35..00000000 --- a/.changeset/real-styled-binding-names.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Recognize `styled` under any local name, such as `import { styled as sc }` or `const sc = require('styled-components')`. diff --git a/.changeset/require-non-tag-exports.md b/.changeset/require-non-tag-exports.md deleted file mode 100644 index 00d3e95b..00000000 --- a/.changeset/require-non-tag-exports.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -A binding that is the styled factory keeps display names and component ids for properties this plugin does not recognize. On styled-components v7 that factory is a proxy, so `styled.box`, `styled.foo`, and `styled.feNotAFilter` are real components. `const styled = require('styled-components')`, `import sc from 'styled-components'`, `sc.default`, `ns.default`, and `__importDefault(require('styled-components')).default` are that factory. Known non-tag exports stay plain, including `sc.css`, `sc.keyframes`, `sc.createGlobalStyle`, `sc['createGlobalStyle']`, `sc.isStyledComponent`, and `sc.default.css`. Names on `Object.prototype` or `Function.prototype` stay plain too, including `sc.hasOwnProperty`, `sc.toString`, `sc.bind`, `sc.__lookupGetter__`, `sc.name`, and `sc.__proto__`. A computed key is resolved when it is a string, a template whose parts all fold to strings, or a const initialized to one of those, so `const name = 'css'; sc[name]`, `` sc[`css`] ``, and `` sc[`${'css'}`] `` stay plain, while `const css = 'div'; sc[css]` and `sc.default[css]` keep their ids. A key this plugin cannot resolve stays plain on `require()` and on an alias that is not named `styled`, so `let dynamic = 'css'; sc[dynamic]` returns the helper instead of throwing. `styled[dynamic]` on an import named `styled` is still decorated. A `let` or `var` that starts as the factory keeps its display name on a straight-line use written before the reassignment. A use inside a nested function, or inside a loop that also reassigns the binding, is left alone, so that function and the next loop iteration do not throw. diff --git a/.changeset/string-aware-minify.md b/.changeset/string-aware-minify.md deleted file mode 100644 index 34c97b20..00000000 --- a/.changeset/string-aware-minify.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'babel-plugin-styled-components': patch ---- - -Fix minification dropping rules after a commented line whose string contains an apostrophe, escaped quote, or parenthesis (e.g. `content: "it's"; // note`). diff --git a/CHANGELOG.md b/CHANGELOG.md index c47d0e93..8020a3c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # babel-plugin-styled-components +## 2.3.1 + +### Patch Changes + +- 860a70c: Add npm bugs metadata pointing to the GitHub issue tracker. +- 64b6319: Fix a crash when the `css` prop is used in a CommonJS file without a `styled-components` import. +- 257f0e9: Faster transforms: the plugin's own time drops about 2–4× on typical files and up to ~28× on CommonJS files with many `css` props. +- f4b2476: Fix line comments surviving minification when they follow the closing line of a multiline value (e.g. `minmax(\n 0,\n 1fr\n); // comment`). The comment check required balanced parentheses on the line, so the unmatched `)` made the comment look like it was inside a value; after lines were joined, styled-components treated everything after `//` as a comment and silently dropped the following declarations and nested blocks. Unmatched closing parentheses are now ignored, which also stops `url(//...)` values after them from being truncated. +- c7f23cf: Fix components losing displayName and componentId when a `declare module` block also imports `styled-components`. +- cbd8d02: Ignore `import type` from `styled-components` when finding the real `styled` import. +- b3c8e76: Fix `styled.default.x` losing displayName and componentId with `import * as styled` alongside the css prop or a default import. +- 9baee30: Helpers imported before `styled` in a named import are recognized now. In `import { css, styled } from 'styled-components'`, `css` and `keyframes` are minified, and with pure annotations turned on they are marked pure. +- 523e10b: Fix broken output for `styled.default(Component)` with `import * as styled` or `require`. +- fbdd435: Recognize `styled` under any local name, such as `import { styled as sc }` or `const sc = require('styled-components')`. +- 9baee30: A binding that is the styled factory keeps display names and component ids for properties this plugin does not recognize. On styled-components v7 that factory is a proxy, so `styled.box`, `styled.foo`, and `styled.feNotAFilter` are real components. `const styled = require('styled-components')`, `import sc from 'styled-components'`, `sc.default`, `ns.default`, and `__importDefault(require('styled-components')).default` are that factory. Known non-tag exports stay plain, including `sc.css`, `sc.keyframes`, `sc.createGlobalStyle`, `sc['createGlobalStyle']`, `sc.isStyledComponent`, and `sc.default.css`. Names on `Object.prototype` or `Function.prototype` stay plain too, including `sc.hasOwnProperty`, `sc.toString`, `sc.bind`, `sc.__lookupGetter__`, `sc.name`, and `sc.__proto__`. A computed key is resolved when it is a string, a template whose parts all fold to strings, or a const initialized to one of those, so `const name = 'css'; sc[name]`, ``sc[`css`]``, and ``sc[`${'css'}`]`` stay plain, while `const css = 'div'; sc[css]` and `sc.default[css]` keep their ids. A key this plugin cannot resolve stays plain on `require()` and on an alias that is not named `styled`, so `let dynamic = 'css'; sc[dynamic]` returns the helper instead of throwing. `styled[dynamic]` on an import named `styled` is still decorated. A `let` or `var` that starts as the factory keeps its display name on a straight-line use written before the reassignment. A use inside a nested function, or inside a loop that also reassigns the binding, is left alone, so that function and the next loop iteration do not throw. +- 6bcb0e3: Fix minification dropping rules after a commented line whose string contains an apostrophe, escaped quote, or parenthesis (e.g. `content: "it's"; // note`). + ## 2.3.0 ### Minor Changes diff --git a/package.json b/package.json index 3213347e..99eb35a6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "2.3.0", + "version": "2.3.1", "name": "babel-plugin-styled-components", "description": "Improve the debugging experience and add server-side rendering support to styled-components", "repository": "styled-components/babel-plugin-styled-components",