-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(types): allow using a styled component as a key inside object styles in the web runtime #4249
Merged
quantizor
merged 2 commits into
styled-components:main
from
iiroj:fix-object-style-reference
Apr 30, 2024
Merged
fix(types): allow using a styled component as a key inside object styles in the web runtime #4249
quantizor
merged 2 commits into
styled-components:main
from
iiroj:fix-object-style-reference
Apr 30, 2024
Conversation
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
…les in the web runtime
Slight modification: interface IStyledComponentBase<R extends Runtime, Props extends object = BaseObject>
extends PolymorphicComponent<R, Props>,
IStyledStatics<R, Props>,
StyledComponentBrand {
defaultProps?: (ExecutionProps & Partial<Props>) | undefined;
toString: () => string;
}
export type IStyledComponent<
R extends Runtime,
Props extends object = BaseObject,
> = IStyledComponentBase<R, Props> & (R extends 'web' ? string : {});
|
quantizor
approved these changes
Apr 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
kodiakhq bot
pushed a commit
to X-oss-byte/Nextjs
that referenced
this pull request
May 1, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [styled-components](https://styled-components.com) ([source](https://togithub.com/styled-components/styled-components)) | [`6.1.8` -> `6.1.9`](https://renovatebot.com/diffs/npm/styled-components/6.1.8/6.1.9) | [![age](https://developer.mend.io/api/mc/badges/age/npm/styled-components/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/styled-components/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/styled-components/6.1.8/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/styled-components/6.1.8/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>styled-components/styled-components (styled-components)</summary> ### [`v6.1.9`](https://togithub.com/styled-components/styled-components/releases/tag/v6.1.9) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.8...v6.1.9) #### What's Changed - fix: improve types for .attrs() by [@​uhyo](https://togithub.com/uhyo) in [styled-components/styled-components#4288 - fix(types): allow using a styled component as a key inside object styles in the web runtime by [@​iiroj](https://togithub.com/iiroj) in [styled-components/styled-components#4249 - Upgrading babel dependencies to latest to fix CVE-2023-45133 by [@​JesseObrien](https://togithub.com/JesseObrien) in [styled-components/styled-components#4214 #### New Contributors - [@​uhyo](https://togithub.com/uhyo) made their first contribution in [styled-components/styled-components#4288 - [@​iiroj](https://togithub.com/iiroj) made their first contribution in [styled-components/styled-components#4249 - [@​JesseObrien](https://togithub.com/JesseObrien) made their first contribution in [styled-components/styled-components#4214 **Full Changelog**: styled-components/styled-components@v6.1.8...v6.1.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
github-merge-queue bot
pushed a commit
to camunda/camunda
that referenced
this pull request
May 1, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [styled-components](https://styled-components.com) ([source](https://togithub.com/styled-components/styled-components)) | [`6.1.8` -> `6.1.9`](https://renovatebot.com/diffs/npm/styled-components/6.1.8/6.1.9) | [![age](https://developer.mend.io/api/mc/badges/age/npm/styled-components/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/styled-components/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/styled-components/6.1.8/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/styled-components/6.1.8/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>styled-components/styled-components (styled-components)</summary> ### [`v6.1.9`](https://togithub.com/styled-components/styled-components/releases/tag/v6.1.9) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.8...v6.1.9) #### What's Changed - fix: improve types for .attrs() by [@​uhyo](https://togithub.com/uhyo) in [styled-components/styled-components#4288 - fix(types): allow using a styled component as a key inside object styles in the web runtime by [@​iiroj](https://togithub.com/iiroj) in [styled-components/styled-components#4249 - Upgrading babel dependencies to latest to fix CVE-2023-45133 by [@​JesseObrien](https://togithub.com/JesseObrien) in [styled-components/styled-components#4214 #### New Contributors - [@​uhyo](https://togithub.com/uhyo) made their first contribution in [styled-components/styled-components#4288 - [@​iiroj](https://togithub.com/iiroj) made their first contribution in [styled-components/styled-components#4249 - [@​JesseObrien](https://togithub.com/JesseObrien) made their first contribution in [styled-components/styled-components#4214 **Full Changelog**: styled-components/styled-components@v6.1.8...v6.1.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/camunda/zeebe). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
renovate bot
added a commit
to camunda/camunda
that referenced
this pull request
May 2, 2024
….5) (#18133) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [styled-components](https://styled-components.com) ([source](https://togithub.com/styled-components/styled-components)) | [`6.1.8` -> `6.1.9`](https://renovatebot.com/diffs/npm/styled-components/6.1.8/6.1.9) | [![age](https://developer.mend.io/api/mc/badges/age/npm/styled-components/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/styled-components/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/styled-components/6.1.8/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/styled-components/6.1.8/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>styled-components/styled-components (styled-components)</summary> ### [`v6.1.9`](https://togithub.com/styled-components/styled-components/releases/tag/v6.1.9) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.8...v6.1.9) #### What's Changed - fix: improve types for .attrs() by [@​uhyo](https://togithub.com/uhyo) in [styled-components/styled-components#4288 - fix(types): allow using a styled component as a key inside object styles in the web runtime by [@​iiroj](https://togithub.com/iiroj) in [styled-components/styled-components#4249 - Upgrading babel dependencies to latest to fix CVE-2023-45133 by [@​JesseObrien](https://togithub.com/JesseObrien) in [styled-components/styled-components#4214 #### New Contributors - [@​uhyo](https://togithub.com/uhyo) made their first contribution in [styled-components/styled-components#4288 - [@​iiroj](https://togithub.com/iiroj) made their first contribution in [styled-components/styled-components#4249 - [@​JesseObrien](https://togithub.com/JesseObrien) made their first contribution in [styled-components/styled-components#4214 **Full Changelog**: styled-components/styled-components@v6.1.8...v6.1.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/camunda/zeebe). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoic3RhYmxlL29wZXJhdGUtOC41IiwibGFiZWxzIjpbImF1dG9tZXJnZSJdfQ==-->
kodiakhq bot
pushed a commit
to kula-app/OnLaunch
that referenced
this pull request
May 4, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [styled-components](https://styled-components.com) ([source](https://togithub.com/styled-components/styled-components)) | [`6.1.8` -> `6.1.9`](https://renovatebot.com/diffs/npm/styled-components/6.1.8/6.1.9) | [![age](https://developer.mend.io/api/mc/badges/age/npm/styled-components/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/styled-components/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/styled-components/6.1.8/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/styled-components/6.1.8/6.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>styled-components/styled-components (styled-components)</summary> ### [`v6.1.9`](https://togithub.com/styled-components/styled-components/releases/tag/v6.1.9) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.8...v6.1.9) #### What's Changed - fix: improve types for .attrs() by [@​uhyo](https://togithub.com/uhyo) in [styled-components/styled-components#4288 - fix(types): allow using a styled component as a key inside object styles in the web runtime by [@​iiroj](https://togithub.com/iiroj) in [styled-components/styled-components#4249 - Upgrading babel dependencies to latest to fix CVE-2023-45133 by [@​JesseObrien](https://togithub.com/JesseObrien) in [styled-components/styled-components#4214 #### New Contributors - [@​uhyo](https://togithub.com/uhyo) made their first contribution in [styled-components/styled-components#4288 - [@​iiroj](https://togithub.com/iiroj) made their first contribution in [styled-components/styled-components#4249 - [@​JesseObrien](https://togithub.com/JesseObrien) made their first contribution in [styled-components/styled-components#4214 **Full Changelog**: styled-components/styled-components@v6.1.8...v6.1.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/kula-app/OnLaunch). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMzEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
kodiakhq bot
pushed a commit
to X-oss-byte/Nextjs
that referenced
this pull request
May 8, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [styled-components](https://styled-components.com) ([source](https://togithub.com/styled-components/styled-components)) | [`6.1.9` -> `6.1.10`](https://renovatebot.com/diffs/npm/styled-components/6.1.8/6.1.10) | [![age](https://developer.mend.io/api/mc/badges/age/npm/styled-components/6.1.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/styled-components/6.1.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/styled-components/6.1.8/6.1.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/styled-components/6.1.8/6.1.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>styled-components/styled-components (styled-components)</summary> ### [`v6.1.10`](https://togithub.com/styled-components/styled-components/compare/v6.1.9...cda9ccbfeb8e9e8962f38b486b4291c3847668d9) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.9...v6.1.10) ### [`v6.1.9`](https://togithub.com/styled-components/styled-components/releases/tag/v6.1.9) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.8...v6.1.9) #### What's Changed - fix: improve types for .attrs() by [@​uhyo](https://togithub.com/uhyo) in [styled-components/styled-components#4288 - fix(types): allow using a styled component as a key inside object styles in the web runtime by [@​iiroj](https://togithub.com/iiroj) in [styled-components/styled-components#4249 - Upgrading babel dependencies to latest to fix CVE-2023-45133 by [@​JesseObrien](https://togithub.com/JesseObrien) in [styled-components/styled-components#4214 #### New Contributors - [@​uhyo](https://togithub.com/uhyo) made their first contribution in [styled-components/styled-components#4288 - [@​iiroj](https://togithub.com/iiroj) made their first contribution in [styled-components/styled-components#4249 - [@​JesseObrien](https://togithub.com/JesseObrien) made their first contribution in [styled-components/styled-components#4214 **Full Changelog**: styled-components/styled-components@v6.1.8...v6.1.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
kodiakhq bot
pushed a commit
to X-oss-byte/Nextjs
that referenced
this pull request
May 10, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [styled-components](https://styled-components.com) ([source](https://togithub.com/styled-components/styled-components)) | [`6.1.10` -> `6.1.11`](https://renovatebot.com/diffs/npm/styled-components/6.1.8/6.1.11) | [![age](https://developer.mend.io/api/mc/badges/age/npm/styled-components/6.1.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/styled-components/6.1.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/styled-components/6.1.8/6.1.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/styled-components/6.1.8/6.1.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>styled-components/styled-components (styled-components)</summary> ### [`v6.1.11`](https://togithub.com/styled-components/styled-components/compare/v6.1.10...v6.1.11) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.10...v6.1.11) ### [`v6.1.10`](https://togithub.com/styled-components/styled-components/compare/v6.1.9...cda9ccbfeb8e9e8962f38b486b4291c3847668d9) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.9...v6.1.10) ### [`v6.1.9`](https://togithub.com/styled-components/styled-components/releases/tag/v6.1.9) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v6.1.8...v6.1.9) #### What's Changed - fix: improve types for .attrs() by [@​uhyo](https://togithub.com/uhyo) in [styled-components/styled-components#4288 - fix(types): allow using a styled component as a key inside object styles in the web runtime by [@​iiroj](https://togithub.com/iiroj) in [styled-components/styled-components#4249 - Upgrading babel dependencies to latest to fix CVE-2023-45133 by [@​JesseObrien](https://togithub.com/JesseObrien) in [styled-components/styled-components#4214 #### New Contributors - [@​uhyo](https://togithub.com/uhyo) made their first contribution in [styled-components/styled-components#4288 - [@​iiroj](https://togithub.com/iiroj) made their first contribution in [styled-components/styled-components#4249 - [@​JesseObrien](https://togithub.com/JesseObrien) made their first contribution in [styled-components/styled-components#4214 **Full Changelog**: styled-components/styled-components@v6.1.8...v6.1.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
This was referenced May 23, 2024
This was referenced Jun 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In v6 it's currently not possible to use a styled-component as a key inside object styles to reference its class name, because TypeScript is not happy about:
This PR adds the same hack available in the older
@types/styled-components
package intersecting the mainIStyledComponent
type with thestring
type, available only in the web runtime.Basically, this becomes possible:
I realize this can be worked around by wrapping they key in either:
H1.toString()
String(H1)
${H1}
but in my opinion it's a bit annoying.
Would be willing to accept this PR? What kind of additional testing would this require? Currently I have developed this workaround locally inside a project using TypeScript and
styled-components
. I did not test if it affects the React Native runtime, but it shouldn't.