Skip to content

Conversation

@doppins-bot
Copy link

Hi!

A new version was just released of styled-components, so Doppins
has upgraded your project's dependency ranges.

Make sure that it doesn't break anything, and happy merging! :shipit:


Upgraded styled-components from ^3.2.5 to ^4.0.0

Changelog:

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Add warning when component is not a styled component and cannot be referred via component selector, by @egdbear](https://github.com/egdbear) (see [#2070 (https://github.com/styled-components/styled-components/pull/2070))

  • Fix how ampersand is handled in self-referential selector combinations, e.g. & + & (see #2071 (https://github.com/styled-components/styled-components/pull/2071))

  • Add babel macro for full-featured interop with create react app v2+, by @lucleray](https://github.com/lucleray) (see [#2032 (https://github.com/styled-components/styled-components/pull/2032))

    When using CRA v2, import styled components from styled-components/macro instead to gain all the benefits of our babel plugin.

  • Add a warning when wrapping a React component with styled() and the className isn't used (meaning styling isn't applied), by @Fer0x](https://github.com/Fer0x) (see [#2073 (https://github.com/styled-components/styled-components/pull/2073))

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Add support for as to be used with attrs for better polymorphism, by @imbhargav5](https://github.com/imbhargav5) (see [#2055 (https://github.com/styled-components/styled-components/pull/2055))

  • Fix withTheme HOC to use a theme defined in defaultProps of the wrapped component, by @theboyWhoCriedWoolf](https://github.com/theboyWhoCriedWoolf) (see [#2033 (https://github.com/styled-components/styled-components/pull/2033))

  • Add enzymeFind test utility to easily grab instances of a styled-component from enyzme mounted testing scenarios, by @probablyup](https://github.com/probablyup) (see [#2049 (https://github.com/styled-components/styled-components/pull/2049))

import { mount } from 'enzyme';
import React from 'react';
import styled from 'styled-components';
import { enzymeFind } from 'styled-components/test-utils';

const Thing = styled.div`
  color: red;
`;

const wrapper = mount(
  <div>
    <Thing isCool />
  </div>
);

const thing = enzymeFind(wrapper, Thing);

// expect(thing.props()).toHaveProperty('isCool') etc
  • Revert change to use React.PureComponent; the ecosystem just isn't ready yet.

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Fix usage of keyframes with createGlobalStyle, by @probablyup](https://github.com/probablyup) (see [#2029 (https://github.com/styled-components/styled-components/pull/2029))

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Inline and optimize the static hoisting functionality to avoid a bundler bug and shed a bit of package weight, by @probablyup](https://github.com/probablyup) (see [#2021 (https://github.com/styled-components/styled-components/pull/2021))

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Revise createGlobalStyle HMR back to the original PR code without using componentDidMount, by @probablyup](https://github.com/probablyup) (see [#2017 (https://github.com/styled-components/styled-components/pull/2017))

  • Some light refactoring to further reduce object allocations, by @probablyup](https://github.com/probablyup) (see [#2016 (https://github.com/styled-components/styled-components/pull/2016))

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Fix a bug introduced from some refactoring that went into beta.5 around usage of keyframes with multiple interpolations, by @probablyup](https://github.com/probablyup) (see [#2013 (https://github.com/styled-components/styled-components/pull/2013))

  • Tweak the styled components base component naming to look nicer in DevTools, by @probablyup](https://github.com/probablyup) (see [#2012 (https://github.com/styled-components/styled-components/pull/2012))

  • Beef up the error message that sometimes occurs when multiple versions of styled components are used together and the StyleSheet instance can't be found, by @probablyup](https://github.com/probablyup) (see [#2012 (https://github.com/styled-components/styled-components/pull/2012))

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Fix issue with createGlobalStyle and hot module reload, by @probablyup](https://github.com/probablyup) (see [#2007 (https://github.com/styled-components/styled-components/pull/2007))

  • Remove keyframes factory function, by @probablyup](https://github.com/probablyup) (see [#2006 (https://github.com/styled-components/styled-components/pull/2006))

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta

Note: this beta has a lot of internal changes. If you notice anything funky, please let us know. All tests are passing, etc.

  • Use PureComponent instead of Component for the StyledComponent base class, by @probablyup

  • Internal refactoring to simplify the codebase and make it more readily DCE-able, by @probablyup

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Fix an issue when streaming with very large amounts of output where sometimes styles might not make it to the client, by @probablyup](https://github.com/probablyup) (see [#1996 (https://github.com/styled-components/styled-components/pull/1996))

  • Fix the createGlobalStyle multiusage warning having false positives, by @probablyup](https://github.com/probablyup) (see [#1993 (https://github.com/styled-components/styled-components/pull/1993))

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Expose ThemeConsumer component, the "consumer" render prop component from the React.createContext API if people are interested in using it rather than / in addition to the withTheme HOC, @probablyup

  • Remove "no tags" experiment, by @probablyup](https://github.com/probablyup) (see [#1987 (https://github.com/styled-components/styled-components/pull/1987)); if you are using the babel plugin, please make sure it's fully updated

  • Fixed an issue with createGlobalStyle when the component was composed in multiple places and render of the subsequent component instance happened before unmount of the original; previously we removed styles immediately upon unmount of any instance without checking how many copies were still alive, by @probablyup](https://github.com/probablyup) (see [#1989 (https://github.com/styled-components/styled-components/pull/1989))

Version 4.0.0

Blog postMigration instructions

npm install --save styled-components@beta
  • Fixed an issue where createGlobalStyle was clobbering the very next style to be applied during rehydration in production mode, by @probablyup](https://github.com/probablyup) (see [#1976 (https://github.com/styled-components/styled-components/pull/1976))

  • Removed some unused code, by @probablyup](https://github.com/probablyup) (see [#1976 (https://github.com/styled-components/styled-components/pull/1976))

  • Switched createGlobalStyle to be a PureComponent, by @probablyup](https://github.com/probablyup) (see [#1976 (https://github.com/styled-components/styled-components/pull/1976))

Version 4.0.0

The first beta of v4 is here! 👏🥂

Blog postMigration instructions

npm install --save styled-components@beta

There's a ton of new and exciting things in v4, along with breaking changes. See the full list below:

  • 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. 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

    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 (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, @yjimk, and @imbhargav5 (see [#1416 (https://github.com/styled-components/styled-components/pull/1416))

    const GlobalStyles = createGlobalStyle`
      html {
        color: 'red';
      }
    `
    
    // then put it in your React tree somewhere:
    // <GlobalStyles />
  • Migrate to use new React.forwardRef API, by @probablyup; note that this removes the innerRef API since it is no longer needed.

  • Implement styled() wrapper folding. In a nutshell, when you nest styled wrappers (e.g. styled(styled.div)) the components are now folded such that only one is mounted that contains the merged styles of its ancestors. This is conceptually equivalent to the removed "extend" functionality, but without many of the downsides -- and it's automatic, by @probablyup](https://github.com/probablyup) (see [#1962 (https://github.com/styled-components/styled-components/pull/1962))

  • Added a first-class API for rendering polymorphism via "as" prop. In most cases, this new prop will replace your need to use the .withComponent API. It allows you to control what underlying element or component is rendered at runtime, while not messing with the styles, by @probablyup](https://github.com/probablyup) (see [#1962 (https://github.com/styled-components/styled-components/pull/1962))

    import { Link } from 'react-router'
    
    const Component = styled.div`
      color: red;
    `
    
    // Examples
    <Component>Hello world!</Component>
    <Component as="span">Hello world!</Component>
    <Component as={Link} to="home">Hello world!</Component>

A note for preact users: if you are doing the preact-compat aliasing, it won't work with this beta because they haven't implemented React.createContext in preact-compat yet (https://github.com/developit/preact-compat/issues/475).

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.0.0 [Doppins] Upgrade dependency styled-components to ^4.0.1 Oct 17, 2018
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.0.1.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.0.1 [Doppins] Upgrade dependency styled-components to ^4.0.2 Oct 18, 2018
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.0.2.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.0.2 [Doppins] Upgrade dependency styled-components to ^4.0.3 Oct 30, 2018
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.0.3.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.0.3 [Doppins] Upgrade dependency styled-components to ^4.1.0 Nov 12, 2018
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.1.0.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.1.0 [Doppins] Upgrade dependency styled-components to ^4.1.1 Nov 12, 2018
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.1.1.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.1.1 [Doppins] Upgrade dependency styled-components to ^4.1.2 Nov 28, 2018
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.1.2.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.1.2 [Doppins] Upgrade dependency styled-components to ^4.1.3 Dec 17, 2018
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.1.3.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.1.3 [Doppins] Upgrade dependency styled-components to ^4.2.0 Mar 23, 2019
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.2.0.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.2.0 [Doppins] Upgrade dependency styled-components to ^4.2.1 Jun 3, 2019
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.2.1.

Hope that's alright!
Doppins

@doppins-bot doppins-bot changed the title [Doppins] Upgrade dependency styled-components to ^4.2.1 [Doppins] Upgrade dependency styled-components to ^4.3.0 Jun 5, 2019
@doppins-bot
Copy link
Author

An additional new version was just released of styled-components, so we've added an
extra commit upgrading your range to ^4.3.0.

Hope that's alright!
Doppins

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.

2 participants