Closed rockwotj closed 2 years ago
Apart from my minor question about the test above, this looks great to me.
As mentioned in #368, this will need to bump the major version of the plugin. Additionally we might want to consider changing the dep string in styled-components
for the macro to ^1 || ^3
or along those lines.
Rounding up some of the issues that will be fixed by this:
https://github.com/styled-components/styled-components/issues/3635 https://github.com/styled-components/styled-components/issues/3645 https://github.com/styled-components/babel-plugin-styled-components/issues/350
Looks great to me. Thanks for the proper solution @rockwotj. What's left to get this merged?
Just need to get @probablyup to notice it :eyes:
Interesting, I thought you'd want to bump the major version for this. I suppose there probably aren't that many people relying on the regex matching, though, and this change will fix problems for a bunch of people (especially people using the macro), so maybe it's for the best.
OMG, this fixed my issue, thanks! I'm using it for displayNames on the react-scripts env <3
Honestly should have done this in https://github.com/styled-components/babel-plugin-styled-components/pull/354 but I didn't realize you could match relative path patterns using picomatch.