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

handle namespace import helpers #340

Merged
merged 3 commits into from
Jul 6, 2021
Merged

Conversation

quantizor
Copy link
Collaborator

@quantizor quantizor commented Jul 6, 2021

Fixes #315

Handle the following syntax:

import * as styled from 'styled-components'

const css = styled.css`
  background: black;
`

const GlobalStyle = styled.createGlobalStyle`
  html {
    background: black;
  }
`

const Test = styled.default.div`
  color: red;
`

const before = styled.default.div`
  color: blue;
`

styled.default.div``

export default styled.default.button``

Previously styled.default.* was not being assigned identifiers, and helpers were being assigned identifiers when they should not be.

@quantizor quantizor merged commit 03a58d5 into main Jul 6, 2021
@quantizor quantizor deleted the 315-namespace-import-support branch July 6, 2021 15:48
@RobbyUitbeijerse
Copy link

RobbyUitbeijerse commented Jul 7, 2021

@probablyup coincidentally, this update also fixed our situation where we use a cjs Rollup build (external design system) with both babel-plugin-styled-components as well as next-transpile-modules (which suddenly broke after we upgraded next.js to 11.0.1, and next-transpile-modules to 8.0.0. It resulted in this error, but is resolved after we installed the test release from #340 :-)

Thanks for the update!

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.

(...).createGlobalStyle.withConfig is not a function
2 participants