From 097a7cb51b40d10eeff79f3440a84755734d285f Mon Sep 17 00:00:00 2001 From: Zach Riegel Date: Wed, 25 Jun 2025 22:06:05 -0700 Subject: [PATCH 1/5] Rename default exported variable so editors can correctly autocomplete the import --- packages/styled/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/styled/src/index.ts b/packages/styled/src/index.ts index 2d8877ff1..5e433e492 100644 --- a/packages/styled/src/index.ts +++ b/packages/styled/src/index.ts @@ -1,5 +1,5 @@ import { Theme } from '@emotion/react' -import styled from './base' +import oldStyled from './base' import { ReactJSXIntrinsicElements } from './jsx-namespace' import { tags } from './tags' import { @@ -33,10 +33,10 @@ export type StyledTags = { export interface CreateStyled extends BaseCreateStyled, StyledTags {} // bind it to avoid mutating the original function -const newStyled = styled.bind(null) as CreateStyled +const styled = oldStyled.bind(null) as CreateStyled tags.forEach(tagName => { - ;(newStyled as any)[tagName] = newStyled(tagName as keyof typeof newStyled) + ;(styled as any)[tagName] = styled(tagName as keyof typeof styled) }) -export default newStyled +export default styled From 54afa96fee8b92d16d68d03a23e864c8d3fa06c9 Mon Sep 17 00:00:00 2001 From: Zach Riegel Date: Wed, 25 Jun 2025 22:13:42 -0700 Subject: [PATCH 2/5] add changeset --- .changeset/wild-pumas-smash.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wild-pumas-smash.md diff --git a/.changeset/wild-pumas-smash.md b/.changeset/wild-pumas-smash.md new file mode 100644 index 000000000..91030713e --- /dev/null +++ b/.changeset/wild-pumas-smash.md @@ -0,0 +1,5 @@ +--- +'@emotion/styled': patch +--- + +Renamed default export variable for @emotion/styled so it shows up as an automatic import for editors From 1f2b3751d2104f2bf382337980efafbff35dd4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 26 Jun 2025 10:46:04 +0200 Subject: [PATCH 3/5] Apply suggestions from code review --- packages/styled/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/styled/src/index.ts b/packages/styled/src/index.ts index 5e433e492..e2c27844b 100644 --- a/packages/styled/src/index.ts +++ b/packages/styled/src/index.ts @@ -1,5 +1,5 @@ import { Theme } from '@emotion/react' -import oldStyled from './base' +import baseStyled from './base' import { ReactJSXIntrinsicElements } from './jsx-namespace' import { tags } from './tags' import { @@ -33,7 +33,7 @@ export type StyledTags = { export interface CreateStyled extends BaseCreateStyled, StyledTags {} // bind it to avoid mutating the original function -const styled = oldStyled.bind(null) as CreateStyled +const styled = baseStyled.bind(null) as CreateStyled tags.forEach(tagName => { ;(styled as any)[tagName] = styled(tagName as keyof typeof styled) From 813983be2e95bed6d0b658e0fec6371aa0972f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 26 Jun 2025 10:47:12 +0200 Subject: [PATCH 4/5] Apply suggestions from code review --- .changeset/wild-pumas-smash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/wild-pumas-smash.md b/.changeset/wild-pumas-smash.md index 91030713e..e0aa0d57f 100644 --- a/.changeset/wild-pumas-smash.md +++ b/.changeset/wild-pumas-smash.md @@ -2,4 +2,4 @@ '@emotion/styled': patch --- -Renamed default export variable for @emotion/styled so it shows up as an automatic import for editors +Renamed default export variable for `@emotion/styled` to aid inferred names in auto-import completions in IDEs From 3ec0a8864ab31c59c7ced424e272ddf7c961b6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 26 Jun 2025 10:51:58 +0200 Subject: [PATCH 5/5] Update .changeset/wild-pumas-smash.md --- .changeset/wild-pumas-smash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/wild-pumas-smash.md b/.changeset/wild-pumas-smash.md index e0aa0d57f..ea432351e 100644 --- a/.changeset/wild-pumas-smash.md +++ b/.changeset/wild-pumas-smash.md @@ -2,4 +2,4 @@ '@emotion/styled': patch --- -Renamed default export variable for `@emotion/styled` to aid inferred names in auto-import completions in IDEs +Renamed default-exported variable in `@emotion/styled` to aid inferred import names in auto-import completions in IDEs