From 210398219ebbae3e5590e8061a35274e852e62ae Mon Sep 17 00:00:00 2001 From: ITenthusiasm <47364027+ITenthusiasm@users.noreply.github.com> Date: Thu, 11 Mar 2021 17:20:45 -0500 Subject: [PATCH 1/2] Update Changelog (v10.6.0) --- changelog.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 100c40294..c5acfa011 100755 --- a/changelog.md +++ b/changelog.md @@ -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) ### Improvements +- [jss] `Styles` now supports `ClassNames`, `Props`/`Data`, and `Theme` as type parameters (eg. `Styles`). [1460](https://github.com/cssinjs/jss/pull/1460) +- [react-jss] `withStyles` and `createUseStyles` now support `ClassNames`, `Props`, and `Theme` as type parameters (eg. `createUseStyles`). [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) + +```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}) => ({ + /* ... */ + }) +}) +``` + ## 10.5.1 (2021-1-23) ### Bug fixes @@ -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) @@ -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) + +``` + +``` From 0ae85a7b86d357a2ede65fb10d84a05a65b8f631 Mon Sep 17 00:00:00 2001 From: ITenthusiasm <47364027+ITenthusiasm@users.noreply.github.com> Date: Fri, 12 Mar 2021 10:44:27 -0500 Subject: [PATCH 2/2] Apply Requested Changes (Part 1) --- changelog.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index c5acfa011..6488f2c2a 100755 --- a/changelog.md +++ b/changelog.md @@ -4,8 +4,6 @@ Since you are interested in what happens next, in case, you work for a for-profi --- -## 10.6.0 (2021-03-11) - ### Improvements - [jss] `Styles` now supports `ClassNames`, `Props`/`Data`, and `Theme` as type parameters (eg. `Styles`). [1460](https://github.com/cssinjs/jss/pull/1460) @@ -17,11 +15,11 @@ Since you are interested in what happens next, in case, you work for a for-profi - [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) +Using the function argument. ```typescript const useStyles = createUseStyles(theme: Theme => ({ - className: { /* ... */ }; + ruleName: { /* ... */ }; })) ``` @@ -29,7 +27,7 @@ Using the object argument with a function. (You will only need to specify the `T ```typescript const useStyles = createUseStyles({ - className: ({theme}: {theme: Theme}) => ({ + ruleName: ({theme}: {theme: Theme}) => ({ /* ... */ }) }) @@ -463,7 +461,3 @@ 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) - -``` - -```