<commit_before># Changelog

All notable changes to this project will be documented in this file. If a contribution does not have a mention next to it, [@geelen](https://github.com/geelen) or [@mxstbr](https://github.com/mxstbr) did it.

_The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/)._

## Unreleased

- Remove deprecated `consolidateStreamedStyles` API, by [@probablyup](https://github.com/probablyup) (see [#1906](https://github.com/styled-components/styled-components/pull/1906))

- Remove deprecated `jsnext:main` entry point from package.json, by [@probablyup](https://github.com/probablyup) (see [#1907](https://github.com/styled-components/styled-components/pull/1907))

- Remove deprecated `.extend` API, by [@probablyup](https://github.com/probablyup) (see [#1908](https://github.com/styled-components/styled-components/pull/1908))

- Migrate to new context API, by [@alexandernanberg](https://github.com/alexandernanberg) (see [#1894](https://github.com/styled-components/styled-components/pull/1894))

- Remove TS typings; they are now to be found in DefinitelyTyped, by [@probablyup](https://github.com/probablyup). See https://github.com/styled-components/styled-components/issues/1778 for more information.

- Add new `data-styled-version` attribute to generated `<style>` tags to allow multiple versions of styled-components to function on the page at once without clobbering each other, by [@probablyup](https://github.com/probablyup)

  It's still highly recommended to use aliasing via your bundler to dedupe libraries like styled-components and react.
 
- [Breaking change] Refactor `keyframes` helper, by [@fer0x](https://github.com/Fer0x) (see [#1930](https://github.com/styled-components/styled-components/pull/1930)).
  
  Keyframes is now implemented in a "lazy" manner: its styles will be injected with the render phase of components using them.
   
  `keyframes` no longer returns an animation name, instead it returns an object which has method `.getName()` for the purpose of getting the animation name.
  
* Add `createGlobalStyle` that returns a component which, when mounting, will apply global styles. This is a replacement for the `injectGlobal` API. It can be updated, replaced, removed, etc like any normal component and the global scope will update accordingly, by @JamieDixon @marionebl and @yjimk (see #1416)

  ```jsx
  const GlobalStyles = createGlobalStyle`
    html {
      color: 'red';
    }
  `
  
  // then put it in your React tree somewhere:
  // <GlobalStyles />
  ```

- Migrate to use new `React.forwardRef` API, by [@probablyup](https://github.com/probablyup); note that this removes the `innerRef` API since it is no longer needed.

## [v3.4.2] - 2018-08-07

- Fix a regression from [#1843](https://github.com/styled-components/styled-components/pull/1892) that breaks deferred injection and duplicates rules, by [@kitten](https://github.com/kitten) (see [#1892](https://github.com/styled-components/styled-components/pull/1892))

- [TS] Fix missing generic type arguments in .d.ts, by [@PzYon](https://github.com/PzYon) (see [#1886](https://github.com/styled-components/styled-components/pull/1886))

## [v3.4.1] - 2018-08-04

- Fixed a bug in typings where `isStyledComponent` was defined using an undefined variable, by [@MayhemYDG](https://github.com/MayhemYDG) (see [#1876](https://github.com/styled-components/styled-components/pull/1876))

- Add error system, by [@probablyup](https://github.com/probablyup) (see [#1881](https://github.com/styled-components/styled-components/pull/1881))

- Fix "stream" module not being properly eliminated by rollup, by [@probablyup](https://github.com/probablyup)

## [v3.4.0] - 2018-08-02

- Add first-class support for functions that return objects, by [@acjay](https://github.com/acjay) (see [#1820](https://github.com/styled-components/styled-components/pull/1820))

  ```JS
  const Comp = styled.div((({ color }) => ({
    color,
  }))<commit_msg>make sure bhargav is correctly attributed for cGS<commit_after># Changelog

All notable changes to this project will be documented in this file. If a contribution does not have a mention next to it, [@geelen](https://github.com/geelen) or [@mxstbr](https://github.com/mxstbr) did it.

_The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/)._

## Unreleased

- Remove deprecated `consolidateStreamedStyles` API, by [@probablyup](https://github.com/probablyup) (see [#1906](https://github.com/styled-components/styled-components/pull/1906))

- Remove deprecated `jsnext:main` entry point from package.json, by [@probablyup](https://github.com/probablyup) (see [#1907](https://github.com/styled-components/styled-components/pull/1907))

- Remove deprecated `.extend` API, by [@probablyup](https://github.com/probablyup) (see [#1908](https://github.com/styled-components/styled-components/pull/1908))

- Migrate to new context API, by [@alexandernanberg](https://github.com/alexandernanberg) (see [#1894](https://github.com/styled-components/styled-components/pull/1894))

- Remove TS typings; they are now to be found in DefinitelyTyped, by [@probablyup](https://github.com/probablyup). See https://github.com/styled-components/styled-components/issues/1778 for more information.

- Add new `data-styled-version` attribute to generated `<style>` tags to allow multiple versions of styled-components to function on the page at once without clobbering each other, by [@probablyup](https://github.com/probablyup)

  It's still highly recommended to use aliasing via your bundler to dedupe libraries like styled-components and react.

- [Breaking change] Refactor `keyframes` helper, by [@fer0x](https://github.com/Fer0x) (see [#1930](https://github.com/styled-components/styled-components/pull/1930)).

  Keyframes is now implemented in a "lazy" manner: its styles will be injected with the render phase of components using them.

  `keyframes` no longer returns an animation name, instead it returns an object which has method `.getName()` for the purpose of getting the animation name.

* Add `createGlobalStyle` that returns a component which, when mounting, will apply global styles. This is a replacement for the `injectGlobal` API. It can be updated, replaced, removed, etc like any normal component and the global scope will update accordingly, by [@JamieDixon](https://github.com/JamieDixon) [@marionebl](https://github.com/marionebl), [@yjimk](https://github.com/yjimk), and [@imbhargav5](https://github.com/imbhargav5) (see [#1416](https://github.com/styled-components/styled-components/pull/1416))

  ```jsx
  const GlobalStyles = createGlobalStyle`
    html {
      color: 'red';
    }
  `

  // then put it in your React tree somewhere:
  // <GlobalStyles />
  ```

- Migrate to use new `React.forwardRef` API, by [@probablyup](https://github.com/probablyup); note that this removes the `innerRef` API since it is no longer needed.

## [v3.4.2] - 2018-08-07

- Fix a regression from [#1843](https://github.com/styled-components/styled-components/pull/1892) that breaks deferred injection and duplicates rules, by [@kitten](https://github.com/kitten) (see [#1892](https://github.com/styled-components/styled-components/pull/1892))

- [TS] Fix missing generic type arguments in .d.ts, by [@PzYon](https://github.com/PzYon) (see [#1886](https://github.com/styled-components/styled-components/pull/1886))

## [v3.4.1] - 2018-08-04

- Fixed a bug in typings where `isStyledComponent` was defined using an undefined variable, by [@MayhemYDG](https://github.com/MayhemYDG) (see [#1876](https://github.com/styled-components/styled-components/pull/1876))

- Add error system, by [@probablyup](https://github.com/probablyup) (see [#1881](https://github.com/styled-components/styled-components/pull/1881))

- Fix "stream" module not being properly eliminated by rollup, by [@probablyup](https://github.com/probablyup)

## [v3.4.0] - 2018-08-02

- Add first-class support for functions that return objects, by [@acjay](https://github.com/acjay) (see [#1820](https://github.com/styled-components/styled-components/pull/1820))

  ```JS
  const Comp = styled.div((({ color }) => ({
    color,
  }))
{'fraction_non_alphanumeric': 0.1402981485934119, 'fraction_numerical': 0.03221928348160615, 'mean_word_length': 4.69015047879617, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 61, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2518032', 'n_tokens_mistral': 2811, 'n_tokens_neox': 2517, 'n_words': 744}