Skip to content
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

Cherry pick macro fix and feature to legacy-v5 #3432

Merged
merged 2 commits into from
Mar 30, 2021

Conversation

agriffis
Copy link
Contributor

Cherry pick these two commits from master to legacy-v5

We don't need the mock at all, because babel-plugin-tester provides
pluginOptions to override.

Cherry picked from styled-components@17d7e01
If `styled` should come from a wrapper instead of directly from
styled-components, this enables users of the macro to customize the
import by configuring in `packages.json`:

    "babelMacros": {
      "styledComponents": {
        "importModuleName": "my-styled-components"
      }
    }

Previously similar functionality landed in
babel-plugin-styled-components so users of the plugin could use
a wrapper at that level, but it wasn't available to users of the macro.
This builds on that work by passing the customized module name through
to the plugin. Consequently we also update the dependency to ensure the
plugin supports `topLevelImportPaths`

See styled-components/babel-plugin-styled-components@325167b

Fixes styled-components/xstyled#44

Cherry picked from styled-components@83c8b0c
@agriffis agriffis changed the title Cherry pick macro fix and feature Cherry pick macro fix and feature to legacy-v5 Mar 10, 2021
@agriffis
Copy link
Contributor Author

@probablyup Are you thinking of a 5.x release soonish? Just wondering how soon after merging this we might dispense with workarounds. Thanks 😄

@quantizor quantizor merged commit c6ca4e6 into styled-components:legacy-v5 Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants