Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,37 @@ Since you are interested in what happens next, in case, you work for a for-profi

---

### Bug fixes
## 10.6.0 (2021-03-11)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version is generated upon release

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I'll remove it then.


### Improvements

- [jss] `Styles` now supports `ClassNames`, `Props`/`Data`, and `Theme` as type parameters (eg. `Styles<Names, Data, Theme>`). [1460](https://github.com/cssinjs/jss/pull/1460)
- [react-jss] `withStyles` and `createUseStyles` now support `ClassNames`, `Props`, and `Theme` as type parameters (eg. `createUseStyles<Names, Props, Theme>`). [1460](https://github.com/cssinjs/jss/pull/1460)
- [react-jss] `useStyles` finally expects the correct argument type: a `Props` object with an optional `Theme` property (both determined from `createUseStyles`). [1460](https://github.com/cssinjs/jss/pull/1460)

### Breaking Changes

- [react-jss] `Theme` is no longer the first generic type parameter for `createUseStyles`. [1460](https://github.com/cssinjs/jss/pull/1460)
- There are two main ways to tell TypeScript your `Theme`'s type without reaching over the other type parameters:

Using the function argument. (Recommended)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't encourage using this interface until we decide what to do with it, we had a discussion to remove it for various reasons

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I wasn't aware. I'll remove the "Recommended" piece then. Should the functional example be removed as well or should it stay?


```typescript
const useStyles = createUseStyles(theme: Theme => ({
className: { /* ... */ };
}))
```

Using the object argument with a function. (You will only need to specify the `Theme` type once.)

```typescript
const useStyles = createUseStyles({
className: ({theme}: {theme: Theme}) => ({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

className is misleading, because it would mean it's actual classname, where actual class name is generated, this is what we call a rule name

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair. I'll rename it to ruleName then.

/* ... */
})
})
```

## 10.5.1 (2021-1-23)

### Bug fixes
Expand All @@ -34,7 +61,7 @@ Since you are interested in what happens next, in case, you work for a for-profi
- [*] Remove test files from the package [1406](https://github.com/cssinjs/jss/pull/1406)
- [*] Upgrade rollup [1426](https://github.com/cssinjs/jss/pull/1426)
- [*] Upgrade flow to 0.138.0 [1425](https://github.com/cssinjs/jss/pull/1425)
- [jss-plugin-default-unit] aAdd gap unit [1403](https://github.com/cssinjs/jss/pull/1403)
- [jss-plugin-default-unit] Add gap unit [1403](https://github.com/cssinjs/jss/pull/1403)
- [jss-plugin-default-unit] Add default units to logical properties [1415](https://github.com/cssinjs/jss/pull/1415)
- [jss] Improve deleteRule() performance [1424](https://github.com/cssinjs/jss/pull/1424)

Expand Down Expand Up @@ -436,3 +463,7 @@ Republish of alpha 5 with properly building the code.
- [jss-plugin-vendor-prefixer](https://github.com/cssinjs/jss-vendor-prefixer/blob/master/changelog.md)
- [jss-preset-default](https://github.com/cssinjs/jss-preset-default/blob/master/changelog.md)
- [react-jss](./docs/react-jss.md/blob/master/changelog.md)

```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that one's confusing to me. 🤔 It definitely wasn't intentional. Glad you noticed it though.


```