Skip to content

Commit 7f1fe82

Browse files
iamstarkovkof
authored andcommitted
Fix/warning adjustment (#1170)
* adjust warning text about not found referenced rule Currently, it is confusing to parse it because investigation pointers (rule, Component) are in the same flow as warning's text itself. This subtle change aims to put focus on important parts of the warning. Before: Warning: [JSS] Could not find the referenced rule icon in Button, Themed, Static. After Warning: [JSS] Could not find the referenced rule "icon" in "Button, Themed, Static". * update snapshots * fix warning text * changelog
1 parent 845d41c commit 7f1fe82

9 files changed

Lines changed: 43 additions & 42 deletions

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Since you are interested in what happens next, in case, you work for a for-profi
66

77
- [react-jss] Improve TypeScript definitions and add missing definition for `createUseStyles` ([1155](https://github.com/cssinjs/jss/pull/1155))
88
- [jss-plugin-default-unit] Consistent usage of the CSS browser API ([1168](https://github.com/cssinjs/jss/pull/1168))
9+
- [jss-plugin-nested] Better warning text ([1170](https://github.com/cssinjs/jss/pull/1170))
910

1011
### Bug fixes
1112

packages/css-jss/.size-snapshot.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"dist/css-jss.js": {
3-
"bundled": 57627,
4-
"minified": 20283,
5-
"gzipped": 6831
3+
"bundled": 57609,
4+
"minified": 20272,
5+
"gzipped": 6826
66
},
77
"dist/css-jss.min.js": {
8-
"bundled": 56873,
9-
"minified": 19825,
10-
"gzipped": 6619
8+
"bundled": 56847,
9+
"minified": 19810,
10+
"gzipped": 6612
1111
},
1212
"dist/css-jss.cjs.js": {
1313
"bundled": 2919,

packages/jss-plugin-nested/.size-snapshot.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"dist/jss-plugin-nested.js": {
3-
"bundled": 4512,
4-
"minified": 1552,
5-
"gzipped": 852
3+
"bundled": 4520,
4+
"minified": 1556,
5+
"gzipped": 857
66
},
77
"dist/jss-plugin-nested.min.js": {
88
"bundled": 4082,
99
"minified": 1340,
1010
"gzipped": 726
1111
},
1212
"dist/jss-plugin-nested.cjs.js": {
13-
"bundled": 3643,
14-
"minified": 1412,
15-
"gzipped": 762
13+
"bundled": 3651,
14+
"minified": 1416,
15+
"gzipped": 768
1616
},
1717
"dist/jss-plugin-nested.esm.js": {
18-
"bundled": 3409,
19-
"minified": 1233,
20-
"gzipped": 681,
18+
"bundled": 3417,
19+
"minified": 1237,
20+
"gzipped": 685,
2121
"treeshaked": {
2222
"rollup": {
2323
"code": 64,

packages/jss-plugin-nested/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default function jssNested(): Plugin {
2525

2626
warning(
2727
false,
28-
`[JSS] Could not find the referenced rule ${key} in ${container.options.meta ||
29-
container.toString()}.`
28+
`[JSS] Could not find the referenced rule "${key}" in "${container.options.meta ||
29+
container.toString()}".`
3030
)
3131
return key
3232
}

packages/jss-plugin-nested/src/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ describe('jss-plugin-nested', () => {
405405
expect(spy.callCount).to.be(1)
406406
expect(
407407
spy.calledWithExactly(
408-
'Warning: [JSS] Could not find the referenced rule b in .a-id {\n & $b: [object Object];\n}.'
408+
'Warning: [JSS] Could not find the referenced rule "b" in ".a-id {\n & $b: [object Object];\n}".'
409409
)
410410
).to.be(true)
411411
})

packages/jss-plugin-vendor-prefixer/.size-snapshot.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"dist/jss-plugin-vendor-prefixer.js": {
3-
"bundled": 17778,
4-
"minified": 5702,
5-
"gzipped": 2224
3+
"bundled": 17752,
4+
"minified": 5687,
5+
"gzipped": 2218
66
},
77
"dist/jss-plugin-vendor-prefixer.min.js": {
8-
"bundled": 17778,
9-
"minified": 5702,
10-
"gzipped": 2224
8+
"bundled": 17752,
9+
"minified": 5687,
10+
"gzipped": 2218
1111
},
1212
"dist/jss-plugin-vendor-prefixer.cjs.js": {
1313
"bundled": 1375,

packages/jss-preset-default/.size-snapshot.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"dist/jss-preset-default.js": {
3-
"bundled": 54871,
4-
"minified": 19517,
5-
"gzipped": 6483
3+
"bundled": 54853,
4+
"minified": 19506,
5+
"gzipped": 6479
66
},
77
"dist/jss-preset-default.min.js": {
8-
"bundled": 54117,
9-
"minified": 19059,
10-
"gzipped": 6271
8+
"bundled": 54091,
9+
"minified": 19044,
10+
"gzipped": 6264
1111
},
1212
"dist/jss-preset-default.cjs.js": {
1313
"bundled": 1329,

packages/jss-starter-kit/.size-snapshot.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"dist/jss-starter-kit.js": {
3-
"bundled": 70413,
4-
"minified": 29557,
5-
"gzipped": 9109
3+
"bundled": 70395,
4+
"minified": 29546,
5+
"gzipped": 9102
66
},
77
"dist/jss-starter-kit.min.js": {
8-
"bundled": 69659,
9-
"minified": 29099,
10-
"gzipped": 8896
8+
"bundled": 69633,
9+
"minified": 29084,
10+
"gzipped": 8889
1111
},
1212
"dist/jss-starter-kit.cjs.js": {
1313
"bundled": 2592,

packages/react-jss/.size-snapshot.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"dist/react-jss.js": {
3-
"bundled": 169148,
4-
"minified": 58296,
5-
"gzipped": 19053
3+
"bundled": 169130,
4+
"minified": 58285,
5+
"gzipped": 19051
66
},
77
"dist/react-jss.min.js": {
8-
"bundled": 112480,
9-
"minified": 41691,
10-
"gzipped": 14139
8+
"bundled": 112454,
9+
"minified": 41676,
10+
"gzipped": 14130
1111
},
1212
"dist/react-jss.cjs.js": {
1313
"bundled": 27019,

0 commit comments

Comments
 (0)