Skip to content

Commit

Permalink
GitBook: [#12] No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej authored and gitbook-bot committed Jul 10, 2022
1 parent 0205575 commit 4be6a71
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 34 deletions.
15 changes: 6 additions & 9 deletions publish-a-module-that-uses-tss.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ description: How to express you dependencies requirements
```json
"name": "YOUR_MODULE",
"dependencies": {
"tss-react": "^3.5.2"
"tss-react": "^4.0.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.2",
"react": "^16.8.0 || ^17.0.2 || 18.0.0" ,
"@mui/material": "^5.0.1",
"@emotion/react": "^11.4.1",
},
Expand All @@ -32,9 +32,7 @@ Your users install your module like that: 
yarn add YOUR_MODULE @mui/material @emotion/react @emotion/styled
```

You do not need to provide special instructions related to SSR 

Your users also need to follow [TSS's instructions to enable SSR](ssr/) (at least for now...).
Regarding SSR setup you can forward your user to the dedicated [MUI documentation](https://mui.com/material-ui/guides/server-rendering/).
{% endtab %}

{% tab title="Your module don't use MUI" %}
Expand All @@ -43,10 +41,10 @@ Your users also need to follow [TSS's instructions to enable SSR](ssr/) (at leas
```json
"name": "YOUR_MODULE",
"dependencies": {
"tss-react": "^3.5.2"
"tss-react": "^4.0.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.2",
"react": "^16.8.0 || ^17.0.2 || ^18.0.0",
"@emotion/react": "^11.4.1",
},
"devDependencies": {
Expand All @@ -61,7 +59,6 @@ Your users install your module like that: 
yarn add YOUR_MODULE @emotion/react
```

Your users also need to follow [TSS's instructions to enable SSR](ssr/).
Regarding SSR setup you can forward your user to [the dedicated documentation](ssr/).
{% endtab %}
{% endtabs %}

6 changes: 0 additions & 6 deletions ssr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ description: How to configure Server Side Sendering

# ⚡ SSR

{% hint style="success" %}
**MUI**: Theses instructions are for the peoples using `tss-react` as a standalone solution.  

MUI users can refer to [the MUI documentation relative to SSR](https://mui.com/material-ui/guides/server-rendering/) and ignore this. 
{% endhint %}

There are some minimal configuration required to make `tss-react` work with SSR.

{% content-ref url="next.js.md" %}
Expand Down
8 changes: 2 additions & 6 deletions ssr/gatsby.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Gatsby

{% hint style="success" %}
**MUI**: Theses instructions are for the peoples using `tss-react` as a standalone solution.  

MUI users can refer to [the MUI documentation relative to SSR](https://mui.com/material-ui/guides/server-rendering/) and ignore this. 
{% endhint %}
Official Gatsby plugin is under development.

In the meantime, you can you can set it up by hand following [this article](https://dev.to/deckstar/gatsby-js-how-to-solve-fouc-when-using-tss-react-and-material-ui-v5-465f) and [this example repo](https://github.com/Deckstar/gatsby-tss-example).  

{% hint style="danger" %}
{% hint style="warning" %}
If you are using nested selectors, you may need to provide [uniq identifiers to your stylesheet](../nested-selectors.md#ssr).
{% endhint %}
6 changes: 0 additions & 6 deletions ssr/next.js.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Next.js

{% hint style="success" %}
**MUI**: Theses instructions are for the peoples using `tss-react` as a standalone solution.  

MUI users can refer to [the MUI documentation relative to SSR](https://mui.com/material-ui/guides/server-rendering/) and ignore this. 
{% endhint %}

{% hint style="info" %}
Next.js + React 18 -> SSR will only work with Next.js 12.1.7-canary.4 or newer.
{% endhint %}
Expand Down
8 changes: 1 addition & 7 deletions ssr/other-backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ description: Configure SSR in in frameworks other than Next.js like for example

# Other backends

{% hint style="success" %}
**MUI**: Theses instructions are for the peoples using `tss-react` as a standalone solution.  

MUI users can refer to [the MUI documentation relative to SSR](https://mui.com/material-ui/guides/server-rendering/) and ignore this. 
{% endhint %}

```
yarn add @emotion/server
```
Expand Down Expand Up @@ -97,6 +91,6 @@ export function App(){
}
```

{% hint style="danger" %}
{% hint style="warning" %}
If you are using nested selectors, you may need to provide [uniq identifiers to your stylesheet](../nested-selectors.md#ssr).
{% endhint %}

0 comments on commit 4be6a71

Please sign in to comment.