Skip to content

Releases: styled-components/babel-plugin-styled-components

v1.9.0

10 Dec 14:42
66e2527
Compare
Choose a tag to compare

v1.8.0

29 Sep 14:22
a092bc8
Compare
Choose a tag to compare

Add pure annotation and displayName / componentId tagging support for the newer syntaxes introduced in styled-components v3: styled.div(object), styled.div(() => object)

v1.7.1

12 Sep 06:59
Compare
Choose a tag to compare

Add missing dependency

v1.7.0

12 Sep 04:20
Compare
Choose a tag to compare

This minor release reintroduces "pure" annotation of styled components and the various library helper methods. It is off by default, so if you want to turn it on pass this config to the plugin:

.babelrc

{
  "plugins": [
    ["babel-plugin-styled-components", { "pure": true }]
  ]
}

"pure" annotation helps signal to minifiers like uglify that a piece of code is safe to remove if not used in at least one other place. This means if you have any components lying around that you're not actively using, they'll be dead code eliminated with this featured enabled. That goes for the helpers too like createGlobalStyle, keyframes, and css.

v1.6.4

07 Sep 22:28
Compare
Choose a tag to compare

Remove the "desugaring" and "no-tags" import rewriting experiments.

Unfortunately they just didn't pan out in the way we were hoping and ended up causing some irritating edge cases.

v1.6.3

06 Sep 00:28
Compare
Choose a tag to compare

Make the version check looser so v4 beta can be included in the "no-tags" transpilation optimization

v1.6.0

31 Aug 00:13
6975b52
Compare
Choose a tag to compare

Features

  • Automatically desugar styled.{element} to styled(element) (#125) This allows for the next item to work and save bytes in the resulting JS bundle.

  • Added new "no-tags" import rewriting functionality when using styled-components >= v4 (#150)

Fixes

  • Single line JS-style comments in the styles now work properly with an interpolation on the same line (#155), e.g.

    styled.div`
      color: green;
      // text-align: ${props => props.align};
    `

Misc

  • Removed "uglifyPure" functionality. Unfortunately this experiment didn't have the effect we wanted and in most cases dramatically slowed down people's builds.

  • SSR mode is now on by default. There's no downside to enabling it and stable class names are always a good thing. (#82)

  • Deleted all files related to the "preprocess" functionality that was deprecated.

v1.5.1

03 Mar 19:48
782b5fb
Compare
Choose a tag to compare

Disabled the "uglifyPure" option due to the discussion in #126

We are open to PRs to improve the performance on large codebases!

v1.5.0

22 Jan 11:40
Compare
Choose a tag to compare

Changes

Add "PURE" annotations for Uglify.js

Thanks to @osamajandali

The plugin will now add annotations to styled, css, and keyframes calls, that help Uglify to perform better dead code elimination.

So a small snippet like this:

const Simple = styled.div`
  width: 100%;
`;

Will now be annotated using /*#__PURE__*/, like this:

const Simple = /*#__PURE__*/styled.div (...);

v1.3.0

26 Oct 15:35
fd0061a
Compare
Choose a tag to compare

Changes

  • Support Babel v7, thanks to @phyllisstein
  • Support require() calls, thanks to @zapkub
  • Support TypeScript, thanks to @zapkub
  • Preserve legal comments (/*!), thanks to @epilande
  • Make the repo Windows compatible, thanks to @fatfisz