From f5ef0b9dde6e432d80b19804911a1ce5c29140a9 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sun, 22 Sep 2019 11:34:25 +0200 Subject: [PATCH 1/6] bump safari ios to v10 --- browsers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browsers.json b/browsers.json index bb5e28944..efccd152f 100644 --- a/browsers.json +++ b/browsers.json @@ -37,7 +37,7 @@ "BS_MobileSafari": { "base": "BrowserStack", "os": "ios", - "os_version": "9.0", + "os_version": "10", "browser": "iphone", "real_mobile": false }, From 10852c34e102a18b8f10a5fb6d368558406ced45 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sun, 22 Sep 2019 14:25:13 +0200 Subject: [PATCH 2/6] don't rerender rules in IE after detach if they are still in a valid CSSStyleSheet --- packages/css-jss/.size-snapshot.json | 12 ++++---- .../.size-snapshot.json | 12 ++++---- .../jss-preset-default/.size-snapshot.json | 12 ++++---- packages/jss-starter-kit/.size-snapshot.json | 12 ++++---- packages/jss/.size-snapshot.json | 28 +++++++++---------- packages/jss/src/DomRenderer.js | 14 +++++++--- packages/react-jss/.size-snapshot.json | 12 ++++---- 7 files changed, 54 insertions(+), 48 deletions(-) diff --git a/packages/css-jss/.size-snapshot.json b/packages/css-jss/.size-snapshot.json index 0ff5f481b..aeca99d4b 100644 --- a/packages/css-jss/.size-snapshot.json +++ b/packages/css-jss/.size-snapshot.json @@ -1,13 +1,13 @@ { "dist/css-jss.js": { - "bundled": 57609, - "minified": 20272, - "gzipped": 6826 + "bundled": 57635, + "minified": 20287, + "gzipped": 6833 }, "dist/css-jss.min.js": { - "bundled": 56847, - "minified": 19810, - "gzipped": 6612 + "bundled": 56873, + "minified": 19825, + "gzipped": 6619 }, "dist/css-jss.cjs.js": { "bundled": 2919, diff --git a/packages/jss-plugin-vendor-prefixer/.size-snapshot.json b/packages/jss-plugin-vendor-prefixer/.size-snapshot.json index 5ec81782a..f8ee37ef8 100644 --- a/packages/jss-plugin-vendor-prefixer/.size-snapshot.json +++ b/packages/jss-plugin-vendor-prefixer/.size-snapshot.json @@ -1,13 +1,13 @@ { "dist/jss-plugin-vendor-prefixer.js": { - "bundled": 17752, - "minified": 5687, - "gzipped": 2218 + "bundled": 17778, + "minified": 5702, + "gzipped": 2224 }, "dist/jss-plugin-vendor-prefixer.min.js": { - "bundled": 17752, - "minified": 5687, - "gzipped": 2218 + "bundled": 17778, + "minified": 5702, + "gzipped": 2224 }, "dist/jss-plugin-vendor-prefixer.cjs.js": { "bundled": 1375, diff --git a/packages/jss-preset-default/.size-snapshot.json b/packages/jss-preset-default/.size-snapshot.json index 979bcfd49..e611c34fe 100644 --- a/packages/jss-preset-default/.size-snapshot.json +++ b/packages/jss-preset-default/.size-snapshot.json @@ -1,13 +1,13 @@ { "dist/jss-preset-default.js": { - "bundled": 54853, - "minified": 19506, - "gzipped": 6479 + "bundled": 54879, + "minified": 19521, + "gzipped": 6486 }, "dist/jss-preset-default.min.js": { - "bundled": 54091, - "minified": 19044, - "gzipped": 6264 + "bundled": 54117, + "minified": 19059, + "gzipped": 6271 }, "dist/jss-preset-default.cjs.js": { "bundled": 1329, diff --git a/packages/jss-starter-kit/.size-snapshot.json b/packages/jss-starter-kit/.size-snapshot.json index e135dc57c..9a9a9a6f3 100644 --- a/packages/jss-starter-kit/.size-snapshot.json +++ b/packages/jss-starter-kit/.size-snapshot.json @@ -1,13 +1,13 @@ { "dist/jss-starter-kit.js": { - "bundled": 70395, - "minified": 29546, - "gzipped": 9102 + "bundled": 70421, + "minified": 29561, + "gzipped": 9109 }, "dist/jss-starter-kit.min.js": { - "bundled": 69633, - "minified": 29084, - "gzipped": 8889 + "bundled": 69659, + "minified": 29099, + "gzipped": 8896 }, "dist/jss-starter-kit.cjs.js": { "bundled": 2592, diff --git a/packages/jss/.size-snapshot.json b/packages/jss/.size-snapshot.json index f50329a30..b4a4317be 100644 --- a/packages/jss/.size-snapshot.json +++ b/packages/jss/.size-snapshot.json @@ -1,30 +1,30 @@ { "dist/jss.js": { - "bundled": 60687, - "minified": 22508, - "gzipped": 6791 + "bundled": 60970, + "minified": 22613, + "gzipped": 6824 }, "dist/jss.min.js": { - "bundled": 59310, - "minified": 21739, - "gzipped": 6432 + "bundled": 59593, + "minified": 21844, + "gzipped": 6463 }, "dist/jss.cjs.js": { - "bundled": 55476, - "minified": 24408, - "gzipped": 6785 + "bundled": 55751, + "minified": 24513, + "gzipped": 6812 }, "dist/jss.esm.js": { - "bundled": 54944, - "minified": 23973, - "gzipped": 6695, + "bundled": 55219, + "minified": 24078, + "gzipped": 6723, "treeshaked": { "rollup": { - "code": 19736, + "code": 19841, "import_statements": 352 }, "webpack": { - "code": 21203 + "code": 21308 } } } diff --git a/packages/jss/src/DomRenderer.js b/packages/jss/src/DomRenderer.js index e98ffb6cf..4d35a897d 100644 --- a/packages/jss/src/DomRenderer.js +++ b/packages/jss/src/DomRenderer.js @@ -335,10 +335,9 @@ export default class DomRenderer { insertStyle(this.element, this.sheet.options) // When rules are inserted using `insertRule` API, after `sheet.detach().attach()` - // browsers remove those rules. - // TODO figure out if its a bug and if it is known. - // Workaround is to redeploy the sheet. - if (this.hasInsertedRules && !(this.sheet && !this.sheet.deployed)) { + // most browsers create a new CSSStyleSheet, except of all IEs. + const deployed = Boolean(this.sheet && this.sheet.deployed) + if (this.hasInsertedRules && deployed) { this.hasInsertedRules = false this.deploy() } @@ -397,6 +396,13 @@ export default class DomRenderer { return latestNativeParent } + // IE keeps the CSSStyleSheet after style node has been reattached, + // so we need to check if the `renderable` reference the right style sheet and not + // rerender those rules. + if (rule.renderable && rule.renderable.parentStyleSheet === this.element.sheet) { + return rule.renderable + } + const ruleStr = rule.toString() if (!ruleStr) return false diff --git a/packages/react-jss/.size-snapshot.json b/packages/react-jss/.size-snapshot.json index ab6977da3..2e905c3f4 100644 --- a/packages/react-jss/.size-snapshot.json +++ b/packages/react-jss/.size-snapshot.json @@ -1,13 +1,13 @@ { "dist/react-jss.js": { - "bundled": 169130, - "minified": 58285, - "gzipped": 19051 + "bundled": 169156, + "minified": 58300, + "gzipped": 19059 }, "dist/react-jss.min.js": { - "bundled": 112454, - "minified": 41676, - "gzipped": 14130 + "bundled": 112480, + "minified": 41691, + "gzipped": 14139 }, "dist/react-jss.cjs.js": { "bundled": 27019, From 3f29c6bf02b75f5e20cc33c01aa09bf4fcc36a68 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sun, 22 Sep 2019 14:26:58 +0200 Subject: [PATCH 3/6] bigger bundle requires more time to bootstrap the app --- karma.conf.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index ffd77cf85..85610f2d5 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -57,7 +57,8 @@ module.exports = config => { browserDisconnectTolerance: 3, // My current OS plan allows max 10 parallel connections. concurrency: 10, - retryLimit: 5 + retryLimit: 5, + browserNoActivityTimeout: 100000 }) config.browserStack = { From 0b823e13ed724bd056e434d6aa3f6a99aa78d420 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sun, 22 Sep 2019 14:50:34 +0200 Subject: [PATCH 4/6] fix the keys in package.json --- browsers.json | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/browsers.json b/browsers.json index efccd152f..d7fe8167d 100644 --- a/browsers.json +++ b/browsers.json @@ -1,19 +1,19 @@ { - "BS_Safari": { + "BS_Safari Yosemite": { "base": "BrowserStack", "os": "OS X", "os_version": "Yosemite", "browser": "safari", "browser_version": "8.0" }, - "BS_Safari": { + "BS_Safari Mavericks": { "base": "BrowserStack", "os": "OS X", "os_version": "Mavericks", "browser": "safari", "browser_version": "7.0" }, - "BS_Chrome": { + "BS_Chrome MacOS": { "base": "BrowserStack", "os": "OS X", "os_version": "Yosemite", @@ -27,13 +27,6 @@ "browser": "firefox", "browser_version": "45.0" }, - "BS_MobileSafari": { - "base": "BrowserStack", - "os": "ios", - "os_version": "8.0", - "browser": "iphone", - "real_mobile": false - }, "BS_MobileSafari": { "base": "BrowserStack", "os": "ios", @@ -41,7 +34,7 @@ "browser": "iphone", "real_mobile": false }, - "BS_Chrome": { + "BS_Chrome Windows": { "base": "BrowserStack", "os": "Windows", "os_version": "8.1", From 7832745b566bb3fdeb7a45d555f4249e917fa92b Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sun, 22 Sep 2019 14:57:17 +0200 Subject: [PATCH 5/6] fix ios safari version --- browsers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browsers.json b/browsers.json index d7fe8167d..17e6e495e 100644 --- a/browsers.json +++ b/browsers.json @@ -30,7 +30,7 @@ "BS_MobileSafari": { "base": "BrowserStack", "os": "ios", - "os_version": "10", + "os_version": "10.3", "browser": "iphone", "real_mobile": false }, From 96b7a6c7e67145b3c09e1007ff224f4f71260dc9 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sun, 22 Sep 2019 15:16:26 +0200 Subject: [PATCH 6/6] Update changelog.md --- changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog.md b/changelog.md index 50a57fd7d..0dc402131 100755 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,11 @@ Since you are interested in what happens next, in case, you work for a for-profi --- +## Bug fixes + +- [jss] Fix dynamic rule updating after sheet re-attach in IE ([1194](https://github.com/cssinjs/jss/pull/1194)) +- [ci] Fix browsers.json, bump suported ios Safari to 10.3. + ## 10.0.0-alpha.25 (2019-9-16) ### Bug fixes