Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.

Commit c8abc73

Browse files
dmiller9911Franco Correa
andauthored
Release v0.35.0 (#1706)
* Release v0.35.0 * catchup Co-authored-by: Franco Correa <[email protected]>
1 parent 37faab6 commit c8abc73

10 files changed

Lines changed: 171 additions & 26 deletions

File tree

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). Currently, this project is using an `0.x` versioning system to indicate its preview status. As such, it does _not_ currently adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). Once we reach production readiness, we will
66
follow semver beginning with our `1.0` release. In the meantime, please read this changelog for information on breaking changes!
77

8+
## 0.35.0 [February 24th, 2020]
9+
10+
### Changes
11+
12+
- (**Breaking** 💥) Updated to styled-components v5 [#1697] (See the [Upgrade Guide](https://auth0-cosmos.now.sh/docs/#/upgrade-guide) for changes required.)
13+
- (**Breaking** 💥) `CssBaseline`: Added `CssBaseline` Component to render global styles [#1699]
14+
- SSR Support: [#1704], [#1703], [#1702]
15+
- Icon: added `danger-fill` icon. [#1701]
16+
817
## 0.34.0 [February 13th, 2020]
918

1019
### Changes

core/babel-preset/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@auth0/babel-preset-cosmos",
33
"description": "babel preset to use cosmos",
4-
"version": "0.34.0",
4+
"version": "0.35.0",
55
"repository": "auth0/cosmos",
66
"main": "index.js",
77
"author": "siddharthkp",

core/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@auth0/cosmos",
33
"description": "Component library for Auth0 Design System",
4-
"version": "0.34.0",
4+
"version": "0.35.0",
55
"repository": "auth0/cosmos",
66
"scripts": {},
77
"keywords": [],

examples/perf-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"start": "cosmos-scripts start"
1111
},
1212
"dependencies": {
13-
"@auth0/cosmos": "0.34.0",
13+
"@auth0/cosmos": "0.35.0",
1414
"react": "16.8.6",
1515
"react-dom": "16.8.6"
1616
},
1717
"devDependencies": {
18-
"@auth0/cosmos-scripts": "0.34.0"
18+
"@auth0/cosmos-scripts": "0.35.0"
1919
}
2020
}

examples/webpack-hello-world/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
"start": "cosmos-scripts start"
1111
},
1212
"dependencies": {
13-
"@auth0/cosmos": "0.34.0",
13+
"@auth0/cosmos": "0.35.0",
1414
"@auth0/cosmos-fonts": "0.0.5",
1515
"react": "16.8.6",
1616
"react-dom": "16.8.6"
1717
},
1818
"devDependencies": {
19-
"@auth0/cosmos-scripts": "0.34.0"
19+
"@auth0/cosmos-scripts": "0.35.0"
2020
}
2121
}

internal/cosmos-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@auth0/cosmos-scripts",
3-
"version": "0.34.0",
3+
"version": "0.35.0",
44
"description": "",
55
"bin": {
66
"cosmos-scripts": "cli.js"

internal/docs/guides.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
import GuidingPrinciples from './guides/guiding-principles'
2-
import Usage from './guides/usage'
3-
import ContributionGuide from './guides/contribution-guide'
4-
import FAQS from './guides/faqs'
5-
import Changes from './guides/changes'
6-
import MigrationGuide from './guides/migration-guide'
7-
import GettingStarted from './guides/getting-started'
1+
import GuidingPrinciples from "./guides/guiding-principles";
2+
import Usage from "./guides/usage";
3+
import ContributionGuide from "./guides/contribution-guide";
4+
import FAQS from "./guides/faqs";
5+
import Changes from "./guides/changes";
6+
import MigrationGuide from "./guides/migration-guide";
7+
import GettingStarted from "./guides/getting-started";
8+
import UpgradeGuide from "./guides/upgrade-guide";
89

910
const guides = [
10-
{ path: '/', title: 'Getting started', component: GettingStarted },
11-
{ path: '/usage', title: 'How to use Cosmos?', component: Usage },
12-
{ path: '/guiding-principles', title: 'Guiding Principles', component: GuidingPrinciples },
13-
{ path: '/faqs', title: 'FAQs', component: FAQS },
14-
{ path: '/changes', title: 'Changelog', component: Changes },
15-
{ path: '/contribution-guide', title: 'Contributing to Cosmos', component: ContributionGuide },
16-
{ path: '/migration-guide', title: 'Migration Guide', component: MigrationGuide }
17-
]
11+
{ path: "/", title: "Getting started", component: GettingStarted },
12+
{ path: "/usage", title: "How to use Cosmos?", component: Usage },
13+
{ path: "/guiding-principles", title: "Guiding Principles", component: GuidingPrinciples },
14+
{ path: "/faqs", title: "FAQs", component: FAQS },
15+
{ path: "/changes", title: "Changelog", component: Changes },
16+
{ path: "/contribution-guide", title: "Contributing to Cosmos", component: ContributionGuide },
17+
{ path: "/migration-guide", title: "Migration Guide", component: MigrationGuide },
18+
{ path: "/upgrade-guide", title: "Upgrade Guide", component: UpgradeGuide }
19+
];
1820

19-
export default guides
21+
export default guides;
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
import React from "react";
2+
import Helmet from "react-helmet";
3+
4+
import { Heading1, Heading2, Text, Link, CodeBlock, Code } from "../docs-components";
5+
6+
class UpgradeGuide extends React.Component {
7+
render() {
8+
return (
9+
<div>
10+
<Helmet title="Upgrade guide &ndash; Cosmos" />
11+
<Heading1>Upgrading to 0.35.0</Heading1>
12+
<Text>
13+
v0.35.0 of Cosmos includes a few breaking changes. These changes are a result of updating styled-components to
14+
v5 from v3.5, as well as opening up support for SSR (Server Side Rendering). Below is a list of the most
15+
common required changes to make when upgrading from v0.3X.X. More can be read in styled-component's upgrade
16+
guide.
17+
</Text>
18+
<Text>
19+
<strong>
20+
It is recommended you pin your cosmos version, if you have not done so already, until we reach v1.0.0.
21+
</strong>
22+
</Text>
23+
<div>
24+
<Heading2>
25+
Global Styles <Code>CssBaseline</Code>
26+
</Heading2>
27+
<Text>
28+
The global styles are no longer added to the head of the document on component import doing this is a side
29+
effect, and prevented us from supporting SSR. styled-components introduced a helper,{" "}
30+
<Link href="https://styled-components.com/docs/api#helpers" target="_blank" rel="noreferrer noopener">
31+
createGlobalStyle
32+
</Link>
33+
, that we are now making use of. To include the global styles you now only need to import and render this
34+
new CssBaseline component once at the root of your app.
35+
</Text>
36+
<CodeBlock language="tsx">
37+
{`
38+
import { CssBaseline } from '@auth0/cosmos';
39+
40+
const App = () => (
41+
<>
42+
<CssBaseline />
43+
{ // ...the rest of your app }
44+
</>
45+
);
46+
`}
47+
</CodeBlock>
48+
<Text>
49+
If you do not want to include CSS resets you can simply include the <Code>includeGlobals</Code> prop to the
50+
component with a value of false. This replaces the environment variable in previous versions.
51+
</Text>
52+
53+
<CodeBlock language="tsx">
54+
{`
55+
<CssBaseline includeGlobals={false} />
56+
`}
57+
</CodeBlock>
58+
</div>
59+
60+
<div>
61+
<Heading2>innerRef → ref</Heading2>
62+
<Text>
63+
styled-components v5 now uses the React utility <Code>forwardRef</Code>. This means that{" "}
64+
<Code>innerRef</Code> is no longer needed and has been deprecated. For any component that is a result of{" "}
65+
<Code>styled</Code> if you are using <Code>innerRef</Code> this needs to be switched to use <Code>ref</Code>
66+
.
67+
</Text>
68+
<CodeBlock language="tsx">
69+
{`
70+
const Root = styled.div\`\`;
71+
72+
// before
73+
const Foo = () => {
74+
const rootRef = React.useRef<HTMLDivElement>();
75+
return <Root innerRef={rootRef} />;
76+
};
77+
78+
// after
79+
const Foo = () => {
80+
const rootRef = React.useRef<HTMLDivElement>();
81+
return <Root ref={rootRef} />;
82+
};
83+
`}
84+
</CodeBlock>
85+
</div>
86+
87+
<div>
88+
<Heading2>Component.withComponent has been deprecated</Heading2>
89+
<Text>
90+
<Code>Component.withComponent</Code> has been deprecated in favor of the new <Code>as</Code> attribute.
91+
There are a couple ways to use this:
92+
</Text>
93+
<CodeBlock language="tsx">
94+
{`
95+
// before
96+
const Layout = styled.div\`\`;
97+
const Root = Layout.withComponent('main');
98+
99+
// after
100+
const Root = styled(Layout).attr({ as: 'main' })\`\`;
101+
// or
102+
const root = <Layout as="main" />;
103+
`}
104+
</CodeBlock>
105+
</div>
106+
107+
<div>
108+
<Heading2>Component.extend(…) has been deprecated</Heading2>
109+
<Text>
110+
use <Code>styled(Component)`...`</Code> instead.
111+
</Text>
112+
<CodeBlock language="tsx">
113+
{`
114+
// before
115+
const Layout = styled.div\`
116+
background-color: blue;
117+
\`;
118+
const Root = Layout.extend\`
119+
color: red;
120+
\`;
121+
122+
// after
123+
const Root = styled(Layout)\`
124+
color: red;
125+
\`;
126+
`}
127+
</CodeBlock>
128+
</div>
129+
</div>
130+
);
131+
}
132+
}
133+
134+
export default UpgradeGuide;

internal/docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start": "cosmos-scripts start"
1010
},
1111
"dependencies": {
12-
"@auth0/cosmos": "0.34.0",
12+
"@auth0/cosmos": "0.35.0",
1313
"@auth0/cosmos-fonts": "0.0.5",
1414
"fuzzysearch": "1.0.3",
1515
"js-beautify": "1.7.5",
@@ -26,6 +26,6 @@
2626
"yamljs": "0.3.0"
2727
},
2828
"devDependencies": {
29-
"@auth0/cosmos-scripts": "0.34.0"
29+
"@auth0/cosmos-scripts": "0.35.0"
3030
}
3131
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cosmos",
3-
"version": "0.34.0",
3+
"version": "0.35.0",
44
"engine": "^7.0.0",
55
"private": true,
66
"workspaces": [

0 commit comments

Comments
 (0)