Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/react-jss-nested-function-values
Browse files Browse the repository at this point in the history
* master:
  Use componentDidMount for WithStyles (#1157)
  Use mui like global ponyfill (#1153)
  HOC should not attach sheets until mount (#1149)
  v10.0.0-alpha.22
  add react-dom dev dependenncy
  Fix SSR for Hooks based implementation (#1148)
  React-JSS id prop docs and improvements (#1147)
  v10.0.0-alpha.21
  fix changelog
  add support hint to the changelog (#1145)
  Sheets management for css() (#1137)

# Conflicts:
#	packages/react-jss/.size-snapshot.json
  • Loading branch information
Henri Beck committed Jul 7, 2019
2 parents 3dab41e + 808acb4 commit aa5c69c
Show file tree
Hide file tree
Showing 71 changed files with 539 additions and 703 deletions.
31 changes: 31 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
## Next

Since you are interested in what happens next, in case, you work for a for-profit company that benefits from using the project, please consider supporting it on https://opencollective.com/jss.

---

### Bug fixes

- [react-jss] withStyles shouldn't attach() on SSR ([#1149](https://github.com/cssinjs/jss/pull/1149), [#1157](https://github.com/cssinjs/jss/pull/1157))

### Improvements

- [jss] Improve treeshaking for webpack by not using `global`. ([#1153](https://github.com/cssinjs/jss/pull/1153))

## 10.0.0-alpha.22 (2019-7-2)

### Breaking Changes

- [jss] SheetsRegistry.toString(options) will now return all sheets by default, no matter detached or attached. You can specify which one you want by using the option `registry.toString({attached: true})` ([1140](https://github.com/cssinjs/jss/pull/1140))

### Bug fixes

- [react-jss] SSR for the hooks based API will now work with the registry as expected ([1140](https://github.com/cssinjs/jss/pull/1140))
- [react-jss] When id options passed to JssProvider, we need to create a new `generateId` function ([#1147](https://github.com/cssinjs/jss/pull/1147))

### Improvements

- [react-jss] Document `id` prop for JssProvider, add "Class name generator options" to the docs. ([#1147](https://github.com/cssinjs/jss/pull/1147))
- [react-jss] Use component name or displayName as a class name prefix also in production by default ([#1147](https://github.com/cssinjs/jss/pull/1147))

## 10.0.0-alpha.21 (2019-6-22)

### Bug fixes

- [jss-plugin-vendor-prefixer] Upgrade css-vendor package to v2.0.5 ([#1142](https://github.com/cssinjs/jss/pull/1142))
- [css-jss] Slows down in benchmark after 10k rules ([#1137](https://github.com/cssinjs/jss/pull/1137))

## 10.0.0-alpha.20 (2019-6-17)

Expand Down
8 changes: 6 additions & 2 deletions docs/jss-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,19 @@ You need to have the [jss-plugin-global](https://github.com/cssinjs/jss/tree/mas
`SheetsRegistry`

When rendering on the server, you will need to get all rendered styles as a CSS string.
The `SheetsRegistry` class allows you to **manually** aggregate and stringify them. Read [more about SSR](ssr.md).
The `SheetsRegistry` class allows you to aggregate and stringify them. Read [more about SSR](ssr.md).

In case you are using the `SheetsRegistry` in the browser and you want to get Style Sheets which are `attached` or `detached` only, you can use the option `attached`.

```javascript
import jss, {SheetsRegistry} from 'jss'

const sheets = new SheetsRegistry()
const sheet = jss.createStyleSheet()
sheets.add(sheet)
sheets.toString() // Returns CSS of all attached Style Sheets together.
sheets.toString() // Returns all Style Sheets as a CSS string.
sheets.toString({attached: true}) // Returns all attached Style Sheets as a CSS string.
sheets.toString({attached: false}) // Returns all detached Style Sheets as a CSS string.
```

## Style Sheets Manager
Expand Down
Loading

0 comments on commit aa5c69c

Please sign in to comment.