Update dependency babel-plugin-styled-components to v2.3.0#2706
Merged
Conversation
Contributor
Author
|
c90322c to
fdf780b
Compare
fdf780b to
d6cc24f
Compare
This file contains hidden or 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
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.
This PR contains the following updates:
2.1.4→2.3.0Release Notes
styled-components/babel-plugin-styled-components (babel-plugin-styled-components)
v2.3.0Compare Source
Minor Changes
0c5f21d: Add acssPropImportPathoption to control which package the css-prop transform auto-importsstyledfrom 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.0c5f21d: Detect styled declarations that go through a local alias of the import, including the TypeScript theme-typing patternconst styled = baseStyled as ThemedStyledInterface<MyTheme>. After type-stripping Babel sees a plainconst styled = baseStyled, and the detector now follows single-identifier alias chains sostyled.divresolves back to the original import.Patch Changes
0c5f21d: Fix invalid output when acss={{ ... }}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.0c5f21d: Recognize TypeScript's__importDefaultinterop helper alongside Babel's_interopRequireDefault. Files compiled throughtsc/ts-jest(which emitvar sc_1 = __importDefault(require('styled-components'))) now flow into the same detection path as Babel-compiled output, so styled declarations downstream pick updisplayNameandcomponentIdas expected.v2.2.0Compare Source
Minor Changes
a40e3f7: Refresh the toolchain and fix a handful of css-prop transform bugs that had crept in under recent Babel versions.styledand also uses one or morecss={…}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 surroundingstyled.divdeclarations.css={{ [foo]: bar }}with a non-primitive value no longer fails Babel's validator. Computed keys are preserved through the css-prop object rewrite.ReferenceError.lodashdependency. The plugin now ships with@babel/coreas a declared peer.Configuration
📅 Schedule: (in timezone Asia/Shanghai)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.