Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Do not rely oncssText#16611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Timer merged 4 commits intovercel:canaryfromTimer:hotfix/do-not-rely-on-csstext
Aug 27, 2020
Merged

Conversation

@Timer
Copy link
Member

@TimerTimer commentedAug 26, 2020
edited by ijjk
Loading

Browsers do not reliably handlecssText forCSSRule classes returned fromdocument.styleSheets.

For example, Safari'scssText property has been broken since 2013:
https://bugs.webkit.org/show_bug.cgi?id=107149

image


Fixes#16610

Browsers to not reliably handle `cssText` for `CSSRule` classes returned from `document.styleSheets`.For example, Safari's `cssText` property has been broken since 2013:https://bugs.webkit.org/show_bug.cgi?id=107149---Fixesvercel#16610
ijjk
ijjk previously approved these changesAug 26, 2020
@ijjk
Copy link
Member

Stats from current PR

Default Server Mode (Increase detected⚠️)
General Overall decrease ✓
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
buildDuration11.9s11.9s⚠️ +11ms
nodeModulesSize57.5 MB57.5 MB-1.18 kB
Page Load Tests Overall increase ✓
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
/ failed reqs00
/ total time (seconds)2.1522.176⚠️ +0.02
/ avg req/sec1161.851148.8⚠️ -13.05
/error-in-render failed reqs00
/error-in-render total time (seconds)1.2021.148-0.05
/error-in-render avg req/sec2079.012177.92+98.91
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
677f882d2ed8..7f47.js gzip10.3 kB10.3 kB
framework.HASH.js gzip39 kB39 kB
main-da593e2..abf1.js gzip7.32 kB7.24 kB-79 B
webpack-e067..f178.js gzip751 B751 B
Overall change57.3 kB57.3 kB-79 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
677f882d2ed8..dule.js gzip6.15 kB6.15 kB
framework.HA..dule.js gzip39 kB39 kB
main-34d17c2..dule.js gzip6.39 kB6.32 kB-71 B
webpack-07c5..dule.js gzip751 B751 B
Overall change52.3 kB52.2 kB-71 B
Legacy Client Bundles (polyfills)
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
polyfills-4b..e242.js gzip31 kB31 kB
Overall change31 kB31 kB
Client Pages
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_app-9a0b9e1..b37e.js gzip1.28 kB1.28 kB
_error-28298..e0c9.js gzip3.44 kB3.44 kB
hooks-89731c..c609.js gzip887 B887 B
index-17468f..5d83.js gzip227 B227 B
link-000f151..65d4.js gzip1.29 kB1.29 kB
routerDirect..924c.js gzip284 B284 B
withRouter-7..c13d.js gzip284 B284 B
Overall change7.69 kB7.69 kB
Client Pages Modern
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_app-75d3a82..dule.js gzip625 B625 B
_error-65c8a..dule.js gzip2.29 kB2.29 kB
hooks-cbf13f..dule.js gzip387 B387 B
index-b9a643..dule.js gzip226 B226 B
link-4cfda7a..dule.js gzip1.26 kB1.26 kB
routerDirect..dule.js gzip284 B284 B
withRouter-f..dule.js gzip282 B282 B
Overall change5.35 kB5.35 kB
Client Build Manifests
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_buildManifest.js gzip322 B322 B
_buildManife..dule.js gzip330 B330 B
Overall change652 B652 B
Rendered Page Sizes
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
index.html gzip972 B972 B
link.html gzip979 B979 B
withRouter.html gzip964 B964 B
Overall change2.92 kB2.92 kB

Diffs

Diff formain-08c9f8a..ce93003d7.js
@@ -323,29 +323,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([         return [].slice.call(input);       };-      var pageLoader = new _pageLoader["default"](-        buildId,-        prefix,-        page,-        looseToArray(document.styleSheets)-          .filter(function(el) {-            return (-              el.ownerNode &&-              el.ownerNode.tagName === "LINK" &&-              el.ownerNode.hasAttribute("data-n-p")-            );-          })-          .map(function(sheet) {-            return {-              href: sheet.ownerNode.getAttribute("href"),-              text: looseToArray(sheet.cssRules)-                .map(function(r) {-                  return r.cssText;-                })-                .join("")-            };-          })-      );+      var pageLoader = new _pageLoader["default"](buildId, prefix, page);        var register = function register(_ref) {         var _ref2 = _slicedToArray(_ref, 2),@@ -1681,16 +1659,10 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([       }        var PageLoader = /*#__PURE__*/ (function() {-        function PageLoader(-          buildId,-          assetPrefix,-          initialPage,-          initialStyleSheets-        ) {+        function PageLoader(buildId, assetPrefix, initialPage) {           _classCallCheck(this, PageLoader);            this.initialPage = void 0;-          this.initialStyleSheets = void 0;           this.buildId = void 0;           this.assetPrefix = void 0;           this.pageCache = void 0;@@ -1700,7 +1672,6 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([           this.promisedSsgManifest = void 0;           this.promisedDevPagesManifest = void 0;           this.initialPage = initialPage;-          this.initialStyleSheets = initialStyleSheets;           this.buildId = buildId;           this.assetPrefix = assetPrefix;           this.pageCache = {};@@ -2025,27 +1996,32 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([                var promisedDeps = // Shared styles will already be on the page:                 route === "/_app" || false // We use `style-loader` in development:-                  ? Promise.resolve([])-                  : route === this.initialPage-                  ? Promise.resolve(this.initialStyleSheets) // Tests that this does not block hydration:+                  ? Promise.resolve([]) // Tests that this does not block hydration:                   : // test/integration/css-fixtures/hydrate-without-deps/-                    this.getDependencies(route)-                      .then(function(deps) {-                        return deps.filter(function(d) {-                          return d.endsWith(".css");-                        });-                      })-                      .then(function(cssFiles) {-                        return (-                          // These files should've already been fetched by now, so this-                          // should resolve pretty much instantly.-                          Promise.all(-                            cssFiles.map(function(d) {-                              return fetchStyleSheet(d);+                    (route === this.initialPage+                      ? Promise.resolve(+                          [].slice+                            .call(document.querySelectorAll("link[data-n-p]"))+                            .map(function(e) {+                              return e.getAttribute("href");                             })-                          )-                        );-                      });+                        )+                      : this.getDependencies(route).then(function(deps) {+                          return deps.filter(function(d) {+                            return d.endsWith(".css");+                          });+                        })+                    ).then(function(cssFiles) {+                      return (+                        // These files should've already been fetched by now, so this+                        // should resolve instantly.+                        Promise.all(+                          cssFiles.map(function(d) {+                            return fetchStyleSheet(d);+                          })+                        )+                      );+                    });               promisedDeps.then(                 function(deps) {                   return register(deps);
Diff formain-53b6374..43.module.js
@@ -241,24 +241,7 @@        var looseToArray = input => [].slice.call(input);-      var pageLoader = new _pageLoader.default(-        buildId,-        prefix,-        page,-        looseToArray(document.styleSheets)-          .filter(-            el =>-              el.ownerNode &&-              el.ownerNode.tagName === "LINK" &&-              el.ownerNode.hasAttribute("data-n-p")-          )-          .map(sheet => ({-            href: sheet.ownerNode.getAttribute("href"),-            text: looseToArray(sheet.cssRules)-              .map(r => r.cssText)-              .join("")-          }))-      );+      var pageLoader = new _pageLoader.default(buildId, prefix, page);        var register = _ref => {         var [r, f] = _ref;@@ -1338,9 +1321,8 @@       }        class PageLoader {-        constructor(buildId, assetPrefix, initialPage, initialStyleSheets) {+        constructor(buildId, assetPrefix, initialPage) {           this.initialPage = void 0;-          this.initialStyleSheets = void 0;           this.buildId = void 0;           this.assetPrefix = void 0;           this.pageCache = void 0;@@ -1350,7 +1332,6 @@           this.promisedSsgManifest = void 0;           this.promisedDevPagesManifest = void 0;           this.initialPage = initialPage;-          this.initialStyleSheets = initialStyleSheets;           this.buildId = buildId;           this.assetPrefix = assetPrefix;           this.pageCache = {};@@ -1623,18 +1604,23 @@            var promisedDeps = // Shared styles will already be on the page:             route === "/_app" || false // We use `style-loader` in development:-              ? Promise.resolve([])-              : route === this.initialPage-              ? Promise.resolve(this.initialStyleSheets) // Tests that this does not block hydration:+              ? Promise.resolve([]) // Tests that this does not block hydration:               : // test/integration/css-fixtures/hydrate-without-deps/-                this.getDependencies(route)-                  .then(deps => deps.filter(d => d.endsWith(".css")))-                  .then((-                    cssFiles // These files should've already been fetched by now, so this-                  ) =>-                    // should resolve pretty much instantly.-                    Promise.all(cssFiles.map(d => fetchStyleSheet(d)))-                  );+                (route === this.initialPage+                  ? Promise.resolve(+                      [].slice+                        .call(document.querySelectorAll("link[data-n-p]"))+                        .map(e => e.getAttribute("href"))+                    )+                  : this.getDependencies(route).then(deps =>+                      deps.filter(d => d.endsWith(".css"))+                    )+                ).then((+                  cssFiles // These files should've already been fetched by now, so this+                ) =>+                  // should resolve instantly.+                  Promise.all(cssFiles.map(d => fetchStyleSheet(d)))+                );           promisedDeps.then(             deps => register(deps),             error => {
Diff forindex.html
@@ -7,7 +7,7 @@     <noscript data-n-css="true"></noscript>     <link       rel="preload"-      href="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      href="/_next/static/chunks/main-ab01a2feee63c40a7eda.module.js"       as="script"       crossorigin="anonymous"     />@@ -82,13 +82,13 @@       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"     ></script>     <script-      src="/_next/static/chunks/main-08c9f8ab982ce93003d7.js"+      src="/_next/static/chunks/main-acd71993db72b9788c3b.js"       async=""       crossorigin="anonymous"       nomodule=""     ></script>     <script-      src="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      src="/_next/static/chunks/main-ab01a2feee63c40a7eda.module.js"       async=""       crossorigin="anonymous"       type="module"
Diff forlink.html
@@ -7,7 +7,7 @@     <noscript data-n-css="true"></noscript>     <link       rel="preload"-      href="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      href="/_next/static/chunks/main-ab01a2feee63c40a7eda.module.js"       as="script"       crossorigin="anonymous"     />@@ -87,13 +87,13 @@       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"     ></script>     <script-      src="/_next/static/chunks/main-08c9f8ab982ce93003d7.js"+      src="/_next/static/chunks/main-acd71993db72b9788c3b.js"       async=""       crossorigin="anonymous"       nomodule=""     ></script>     <script-      src="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      src="/_next/static/chunks/main-ab01a2feee63c40a7eda.module.js"       async=""       crossorigin="anonymous"       type="module"
Diff forwithRouter.html
@@ -7,7 +7,7 @@     <noscript data-n-css="true"></noscript>     <link       rel="preload"-      href="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      href="/_next/static/chunks/main-ab01a2feee63c40a7eda.module.js"       as="script"       crossorigin="anonymous"     />@@ -82,13 +82,13 @@       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"     ></script>     <script-      src="/_next/static/chunks/main-08c9f8ab982ce93003d7.js"+      src="/_next/static/chunks/main-acd71993db72b9788c3b.js"       async=""       crossorigin="anonymous"       nomodule=""     ></script>     <script-      src="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      src="/_next/static/chunks/main-ab01a2feee63c40a7eda.module.js"       async=""       crossorigin="anonymous"       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
buildDuration13.6s13.5s-142ms
nodeModulesSize57.5 MB57.5 MB-1.18 kB
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
677f882d2ed8..7f47.js gzip10.3 kB10.3 kB
framework.HASH.js gzip39 kB39 kB
main-da593e2..abf1.js gzip7.32 kBN/AN/A
webpack-e067..f178.js gzip751 B751 B
main-c7c1581..cec2.js gzipN/A7.24 kBN/A
Overall change57.3 kB57.3 kB-79 B
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
677f882d2ed8..dule.js gzip6.15 kB6.15 kB
framework.HA..dule.js gzip39 kB39 kB
main-34d17c2..dule.js gzip6.39 kBN/AN/A
webpack-07c5..dule.js gzip751 B751 B
main-a8d947a..dule.js gzipN/A6.32 kBN/A
Overall change52.3 kB52.2 kB-71 B
Legacy Client Bundles (polyfills)
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
polyfills-4b..e242.js gzip31 kB31 kB
Overall change31 kB31 kB
Client Pages
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_app-9a0b9e1..b37e.js gzip1.28 kB1.28 kB
_error-28298..e0c9.js gzip3.44 kB3.44 kB
hooks-89731c..c609.js gzip887 B887 B
index-17468f..5d83.js gzip227 B227 B
link-000f151..65d4.js gzip1.29 kB1.29 kB
routerDirect..924c.js gzip284 B284 B
withRouter-7..c13d.js gzip284 B284 B
Overall change7.69 kB7.69 kB
Client Pages Modern
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_app-75d3a82..dule.js gzip625 B625 B
_error-65c8a..dule.js gzip2.29 kB2.29 kB
hooks-cbf13f..dule.js gzip387 B387 B
index-b9a643..dule.js gzip226 B226 B
link-4cfda7a..dule.js gzip1.26 kB1.26 kB
routerDirect..dule.js gzip284 B284 B
withRouter-f..dule.js gzip282 B282 B
Overall change5.35 kB5.35 kB
Client Build Manifests
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_buildManifest.js gzip322 B322 B
_buildManife..dule.js gzip330 B330 B
Overall change652 B652 B
Serverless bundles
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_error.js1.03 MB1.03 MB
404.html4.22 kB4.22 kB
hooks.html3.86 kB3.86 kB
index.js1.03 MB1.03 MB
link.js1.07 MB1.07 MB
routerDirect.js1.07 MB1.07 MB
withRouter.js1.07 MB1.07 MB
Overall change5.28 MB5.28 MB
Commit:ec76fc7

@ijjk
Copy link
Member

Failing test suites

Commit:ec76fc7

test/integration/css/test/index.test.js

  • CSS Support > Page reload on CSS missing > Production Mode > should fall back to server-side transition on missing CSS
Expand output

● CSS Support › Page reload on CSS missing › Production Mode › should fall back to server-side transition on missing CSS

thrown: "Exceeded timeout of 120000 ms for a test.Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."  1308 |       }  1309 | > 1310 |       it('should fall back to server-side transition on missing CSS', async () => {       |       ^  1311 |         const browser = await webdriver(appPort, '/')  1312 |         try {  1313 |           await checkBlackTitle(browser)  at tests (integration/css/test/index.test.js:1310:7)  at integration/css/test/index.test.js:1352:7  at integration/css/test/index.test.js:1329:5  at integration/css/test/index.test.js:1297:3

@ijjk
Copy link
Member

Stats from current PR

Default Server Mode (Increase detected⚠️)
General Overall increase⚠️
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
buildDuration11.3s11.5s⚠️ +207ms
nodeModulesSize57.5 MB57.5 MB⚠️ +797 B
Page Load Tests Overall increase ✓
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
/ failed reqs00
/ total time (seconds)2.1342.108-0.03
/ avg req/sec1171.421185.94+14.52
/error-in-render failed reqs00
/error-in-render total time (seconds)1.1791.153-0.03
/error-in-render avg req/sec2120.422167.73+47.31
Client Bundles (main, webpack, commons) Overall increase⚠️
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
677f882d2ed8..7f47.js gzip10.3 kB10.3 kB
framework.HASH.js gzip39 kB39 kB
main-da593e2..abf1.js gzip7.32 kB7.36 kB⚠️ +34 B
webpack-e067..f178.js gzip751 B751 B
Overall change57.3 kB57.4 kB⚠️ +34 B
Client Bundles (main, webpack, commons) Modern Overall increase⚠️
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
677f882d2ed8..dule.js gzip6.15 kB6.15 kB
framework.HA..dule.js gzip39 kB39 kB
main-34d17c2..dule.js gzip6.39 kB6.42 kB⚠️ +33 B
webpack-07c5..dule.js gzip751 B751 B
Overall change52.3 kB52.3 kB⚠️ +33 B
Legacy Client Bundles (polyfills)
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
polyfills-4b..e242.js gzip31 kB31 kB
Overall change31 kB31 kB
Client Pages
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_app-9a0b9e1..b37e.js gzip1.28 kB1.28 kB
_error-28298..e0c9.js gzip3.44 kB3.44 kB
hooks-89731c..c609.js gzip887 B887 B
index-17468f..5d83.js gzip227 B227 B
link-000f151..65d4.js gzip1.29 kB1.29 kB
routerDirect..924c.js gzip284 B284 B
withRouter-7..c13d.js gzip284 B284 B
Overall change7.69 kB7.69 kB
Client Pages Modern
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_app-75d3a82..dule.js gzip625 B625 B
_error-65c8a..dule.js gzip2.29 kB2.29 kB
hooks-cbf13f..dule.js gzip387 B387 B
index-b9a643..dule.js gzip226 B226 B
link-4cfda7a..dule.js gzip1.26 kB1.26 kB
routerDirect..dule.js gzip284 B284 B
withRouter-f..dule.js gzip282 B282 B
Overall change5.35 kB5.35 kB
Client Build Manifests
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_buildManifest.js gzip322 B322 B
_buildManife..dule.js gzip330 B330 B
Overall change652 B652 B
Rendered Page Sizes Overall increase⚠️
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
index.html gzip972 B973 B⚠️ +1 B
link.html gzip979 B979 B
withRouter.html gzip964 B965 B⚠️ +1 B
Overall change2.92 kB2.92 kB⚠️ +2 B

Diffs

Diff formain-08c9f8a..ce93003d7.js
@@ -275,7 +275,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([        var _headManager = _interopRequireDefault(__webpack_require__("DqTX"));-      var _pageLoader = _interopRequireDefault(__webpack_require__("zmvN"));+      var _pageLoader = _interopRequireWildcard3(__webpack_require__("zmvN"));        var _performanceRelayer = _interopRequireDefault(         __webpack_require__("bGXG")@@ -319,33 +319,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([         asPath = (0, _router.delBasePath)(asPath);       }-      var looseToArray = function looseToArray(input) {-        return [].slice.call(input);-      };--      var pageLoader = new _pageLoader["default"](-        buildId,-        prefix,-        page,-        looseToArray(document.styleSheets)-          .filter(function(el) {-            return (-              el.ownerNode &&-              el.ownerNode.tagName === "LINK" &&-              el.ownerNode.hasAttribute("data-n-p")-            );-          })-          .map(function(sheet) {-            return {-              href: sheet.ownerNode.getAttribute("href"),-              text: looseToArray(sheet.cssRules)-                .map(function(r) {-                  return r.cssText;-                })-                .join("")-            };-          })-      );+      var pageLoader = new _pageLoader["default"](buildId, prefix, page);        var register = function register(_ref) {         var _ref2 = _slicedToArray(_ref, 2),@@ -1017,7 +991,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([             return false;           }-          var currentStyleTags = looseToArray(+          var currentStyleTags = (0, _pageLoader.looseToArray)(             document.querySelectorAll("style[data-n-href]")           );           var currentHrefs = new Set(@@ -1054,7 +1028,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([                 return s.href;               })             );-            var currentStyleTags = looseToArray(+            var currentStyleTags = (0, _pageLoader.looseToArray)(               document.querySelectorAll("style[data-n-href]")             );             var currentHrefs = currentStyleTags.map(function(tag) {@@ -1094,11 +1068,11 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([               });             } // Finally, clean up server rendered stylesheets:-            looseToArray(document.querySelectorAll("link[data-n-p]")).forEach(-              function(el) {-                el.parentNode.removeChild(el);-              }-            ); // Force browser to recompute layout, which should prevent a flash of+            (0, _pageLoader.looseToArray)(+              document.querySelectorAll("link[data-n-p]")+            ).forEach(function(el) {+              el.parentNode.removeChild(el);+            }); // Force browser to recompute layout, which should prevent a flash of             // unstyled content:              getComputedStyle(document.body, "height");@@ -1581,7 +1555,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([       var _interopRequireDefault = __webpack_require__("TqRt");        exports.__esModule = true;-      exports["default"] = void 0;+      exports["default"] = exports.looseToArray = void 0;        var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));@@ -1605,6 +1579,33 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([        var _routeRegex = __webpack_require__("YTqd");+      var looseToArray = function looseToArray(input) {+        return [].slice.call(input);+      };++      exports.looseToArray = looseToArray;++      function getInitialStylesheets() {+        return looseToArray(document.styleSheets)+          .filter(function(el) {+            return (+              el.ownerNode &&+              el.ownerNode.tagName === "LINK" &&+              el.ownerNode.hasAttribute("data-n-p")+            );+          })+          .map(function(sheet) {+            return {+              href: sheet.ownerNode.getAttribute("href"),+              text: looseToArray(sheet.cssRules)+                .map(function(r) {+                  return r.cssText;+                })+                .join("")+            };+          });+      }+       function hasRel(rel, link) {         try {           link = document.createElement("link");@@ -1681,16 +1682,10 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([       }        var PageLoader = /*#__PURE__*/ (function() {-        function PageLoader(-          buildId,-          assetPrefix,-          initialPage,-          initialStyleSheets-        ) {+        function PageLoader(buildId, assetPrefix, initialPage) {           _classCallCheck(this, PageLoader);            this.initialPage = void 0;-          this.initialStyleSheets = void 0;           this.buildId = void 0;           this.assetPrefix = void 0;           this.pageCache = void 0;@@ -1700,7 +1695,6 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([           this.promisedSsgManifest = void 0;           this.promisedDevPagesManifest = void 0;           this.initialPage = initialPage;-          this.initialStyleSheets = initialStyleSheets;           this.buildId = buildId;           this.assetPrefix = assetPrefix;           this.pageCache = {};@@ -2023,29 +2017,38 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([                 });               }+              var isInitialLoad = route === this.initialPage;               var promisedDeps = // Shared styles will already be on the page:                 route === "/_app" || false // We use `style-loader` in development:-                  ? Promise.resolve([])-                  : route === this.initialPage-                  ? Promise.resolve(this.initialStyleSheets) // Tests that this does not block hydration:+                  ? Promise.resolve([]) // Tests that this does not block hydration:                   : // test/integration/css-fixtures/hydrate-without-deps/-                    this.getDependencies(route)-                      .then(function(deps) {-                        return deps.filter(function(d) {-                          return d.endsWith(".css");-                        });-                      })-                      .then(function(cssFiles) {-                        return (-                          // These files should've already been fetched by now, so this-                          // should resolve pretty much instantly.-                          Promise.all(-                            cssFiles.map(function(d) {-                              return fetchStyleSheet(d);-                            })-                          )-                        );-                      });+                    (isInitialLoad+                      ? Promise.resolve(+                          looseToArray(+                            document.querySelectorAll("link[data-n-p]")+                          ).map(function(e) {+                            return e.getAttribute("href");+                          })+                        )+                      : this.getDependencies(route).then(function(deps) {+                          return deps.filter(function(d) {+                            return d.endsWith(".css");+                          });+                        })+                    ).then(function(cssFiles) {+                      return (+                        // These files should've already been fetched by now, so this+                        // should resolve instantly.+                        Promise.all(+                          cssFiles.map(function(d) {+                            return fetchStyleSheet(d);+                          })+                        )["catch"](function(err) {+                          if (isInitialLoad) return getInitialStylesheets();+                          throw err;+                        })+                      );+                    });               promisedDeps.then(                 function(deps) {                   return register(deps);
Diff formain-53b6374..43.module.js
@@ -193,7 +193,7 @@        var _headManager = _interopRequireDefault(__webpack_require__("DqTX"));-      var _pageLoader = _interopRequireDefault(__webpack_require__("zmvN"));+      var _pageLoader = _interopRequireWildcard3(__webpack_require__("zmvN"));        var _performanceRelayer = _interopRequireDefault(         __webpack_require__("bGXG")@@ -239,26 +239,7 @@         asPath = (0, _router.delBasePath)(asPath);       }-      var looseToArray = input => [].slice.call(input);--      var pageLoader = new _pageLoader.default(-        buildId,-        prefix,-        page,-        looseToArray(document.styleSheets)-          .filter(-            el =>-              el.ownerNode &&-              el.ownerNode.tagName === "LINK" &&-              el.ownerNode.hasAttribute("data-n-p")-          )-          .map(sheet => ({-            href: sheet.ownerNode.getAttribute("href"),-            text: looseToArray(sheet.cssRules)-              .map(r => r.cssText)-              .join("")-          }))-      );+      var pageLoader = new _pageLoader.default(buildId, prefix, page);        var register = _ref => {         var [r, f] = _ref;@@ -747,7 +728,7 @@             return false;           }-          var currentStyleTags = looseToArray(+          var currentStyleTags = (0, _pageLoader.looseToArray)(             document.querySelectorAll("style[data-n-href]")           );           var currentHrefs = new Set(@@ -777,7 +758,7 @@             !canceled           ) {             var desiredHrefs = new Set(styleSheets.map(s => s.href));-            var currentStyleTags = looseToArray(+            var currentStyleTags = (0, _pageLoader.looseToArray)(               document.querySelectorAll("style[data-n-href]")             );             var currentHrefs = currentStyleTags.map(tag =>@@ -817,11 +798,11 @@               });             } // Finally, clean up server rendered stylesheets:-            looseToArray(document.querySelectorAll("link[data-n-p]")).forEach(-              el => {-                el.parentNode.removeChild(el);-              }-            ); // Force browser to recompute layout, which should prevent a flash of+            (0, _pageLoader.looseToArray)(+              document.querySelectorAll("link[data-n-p]")+            ).forEach(el => {+              el.parentNode.removeChild(el);+            }); // Force browser to recompute layout, which should prevent a flash of             // unstyled content:              getComputedStyle(document.body, "height");@@ -1240,7 +1221,7 @@       var _interopRequireDefault = __webpack_require__("TqRt");        exports.__esModule = true;-      exports.default = void 0;+      exports.default = exports.looseToArray = void 0;        var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));@@ -1264,6 +1245,26 @@        var _routeRegex = __webpack_require__("YTqd");+      var looseToArray = input => [].slice.call(input);++      exports.looseToArray = looseToArray;++      function getInitialStylesheets() {+        return looseToArray(document.styleSheets)+          .filter(+            el =>+              el.ownerNode &&+              el.ownerNode.tagName === "LINK" &&+              el.ownerNode.hasAttribute("data-n-p")+          )+          .map(sheet => ({+            href: sheet.ownerNode.getAttribute("href"),+            text: looseToArray(sheet.cssRules)+              .map(r => r.cssText)+              .join("")+          }));+      }+       function hasRel(rel, link) {         try {           link = document.createElement("link");@@ -1338,9 +1339,8 @@       }        class PageLoader {-        constructor(buildId, assetPrefix, initialPage, initialStyleSheets) {+        constructor(buildId, assetPrefix, initialPage) {           this.initialPage = void 0;-          this.initialStyleSheets = void 0;           this.buildId = void 0;           this.assetPrefix = void 0;           this.pageCache = void 0;@@ -1350,7 +1350,6 @@           this.promisedSsgManifest = void 0;           this.promisedDevPagesManifest = void 0;           this.initialPage = initialPage;-          this.initialStyleSheets = initialStyleSheets;           this.buildId = buildId;           this.assetPrefix = assetPrefix;           this.pageCache = {};@@ -1621,20 +1620,31 @@             });           }+          var isInitialLoad = route === this.initialPage;           var promisedDeps = // Shared styles will already be on the page:             route === "/_app" || false // We use `style-loader` in development:-              ? Promise.resolve([])-              : route === this.initialPage-              ? Promise.resolve(this.initialStyleSheets) // Tests that this does not block hydration:+              ? Promise.resolve([]) // Tests that this does not block hydration:               : // test/integration/css-fixtures/hydrate-without-deps/-                this.getDependencies(route)-                  .then(deps => deps.filter(d => d.endsWith(".css")))-                  .then((-                    cssFiles // These files should've already been fetched by now, so this-                  ) =>-                    // should resolve pretty much instantly.-                    Promise.all(cssFiles.map(d => fetchStyleSheet(d)))-                  );+                (isInitialLoad+                  ? Promise.resolve(+                      looseToArray(+                        document.querySelectorAll("link[data-n-p]")+                      ).map(e => e.getAttribute("href"))+                    )+                  : this.getDependencies(route).then(deps =>+                      deps.filter(d => d.endsWith(".css"))+                    )+                ).then((+                  cssFiles // These files should've already been fetched by now, so this+                ) =>+                  // should resolve instantly.+                  Promise.all(cssFiles.map(d => fetchStyleSheet(d))).catch(+                    err => {+                      if (isInitialLoad) return getInitialStylesheets();+                      throw err;+                    }+                  )+                );           promisedDeps.then(             deps => register(deps),             error => {
Diff forindex.html
@@ -7,7 +7,7 @@     <noscript data-n-css="true"></noscript>     <link       rel="preload"-      href="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      href="/_next/static/chunks/main-62d89d6c0fd63280aa76.module.js"       as="script"       crossorigin="anonymous"     />@@ -82,13 +82,13 @@       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"     ></script>     <script-      src="/_next/static/chunks/main-08c9f8ab982ce93003d7.js"+      src="/_next/static/chunks/main-a169554ad39d61f3e3ab.js"       async=""       crossorigin="anonymous"       nomodule=""     ></script>     <script-      src="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      src="/_next/static/chunks/main-62d89d6c0fd63280aa76.module.js"       async=""       crossorigin="anonymous"       type="module"
Diff forlink.html
@@ -7,7 +7,7 @@     <noscript data-n-css="true"></noscript>     <link       rel="preload"-      href="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      href="/_next/static/chunks/main-62d89d6c0fd63280aa76.module.js"       as="script"       crossorigin="anonymous"     />@@ -87,13 +87,13 @@       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"     ></script>     <script-      src="/_next/static/chunks/main-08c9f8ab982ce93003d7.js"+      src="/_next/static/chunks/main-a169554ad39d61f3e3ab.js"       async=""       crossorigin="anonymous"       nomodule=""     ></script>     <script-      src="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      src="/_next/static/chunks/main-62d89d6c0fd63280aa76.module.js"       async=""       crossorigin="anonymous"       type="module"
Diff forwithRouter.html
@@ -7,7 +7,7 @@     <noscript data-n-css="true"></noscript>     <link       rel="preload"-      href="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      href="/_next/static/chunks/main-62d89d6c0fd63280aa76.module.js"       as="script"       crossorigin="anonymous"     />@@ -82,13 +82,13 @@       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"     ></script>     <script-      src="/_next/static/chunks/main-08c9f8ab982ce93003d7.js"+      src="/_next/static/chunks/main-a169554ad39d61f3e3ab.js"       async=""       crossorigin="anonymous"       nomodule=""     ></script>     <script-      src="/_next/static/chunks/main-53b6374c64b7ade65c43.module.js"+      src="/_next/static/chunks/main-62d89d6c0fd63280aa76.module.js"       async=""       crossorigin="anonymous"       type="module"

Serverless Mode (Increase detected⚠️)
General Overall increase⚠️
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
buildDuration13.5s13.2s-278ms
nodeModulesSize57.5 MB57.5 MB⚠️ +797 B
Client Bundles (main, webpack, commons) Overall increase⚠️
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
677f882d2ed8..7f47.js gzip10.3 kB10.3 kB
framework.HASH.js gzip39 kB39 kB
main-da593e2..abf1.js gzip7.32 kBN/AN/A
webpack-e067..f178.js gzip751 B751 B
main-dc83a65..69bb.js gzipN/A7.36 kBN/A
Overall change57.3 kB57.4 kB⚠️ +34 B
Client Bundles (main, webpack, commons) Modern Overall increase⚠️
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
677f882d2ed8..dule.js gzip6.15 kB6.15 kB
framework.HA..dule.js gzip39 kB39 kB
main-34d17c2..dule.js gzip6.39 kBN/AN/A
webpack-07c5..dule.js gzip751 B751 B
main-529b07f..dule.js gzipN/A6.42 kBN/A
Overall change52.3 kB52.3 kB⚠️ +33 B
Legacy Client Bundles (polyfills)
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
polyfills-4b..e242.js gzip31 kB31 kB
Overall change31 kB31 kB
Client Pages
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_app-9a0b9e1..b37e.js gzip1.28 kB1.28 kB
_error-28298..e0c9.js gzip3.44 kB3.44 kB
hooks-89731c..c609.js gzip887 B887 B
index-17468f..5d83.js gzip227 B227 B
link-000f151..65d4.js gzip1.29 kB1.29 kB
routerDirect..924c.js gzip284 B284 B
withRouter-7..c13d.js gzip284 B284 B
Overall change7.69 kB7.69 kB
Client Pages Modern
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_app-75d3a82..dule.js gzip625 B625 B
_error-65c8a..dule.js gzip2.29 kB2.29 kB
hooks-cbf13f..dule.js gzip387 B387 B
index-b9a643..dule.js gzip226 B226 B
link-4cfda7a..dule.js gzip1.26 kB1.26 kB
routerDirect..dule.js gzip284 B284 B
withRouter-f..dule.js gzip282 B282 B
Overall change5.35 kB5.35 kB
Client Build Manifests
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_buildManifest.js gzip322 B322 B
_buildManife..dule.js gzip330 B330 B
Overall change652 B652 B
Serverless bundles
vercel/next.js canaryTimer/next.js hotfix/do-not-rely-on-csstextChange
_error.js1.03 MB1.03 MB
404.html4.22 kB4.22 kB
hooks.html3.86 kB3.86 kB
index.js1.03 MB1.03 MB
link.js1.07 MB1.07 MB
routerDirect.js1.07 MB1.07 MB
withRouter.js1.07 MB1.07 MB
Overall change5.28 MB5.28 MB
Commit:e9feb03

@TimerTimer merged commit328abb7 intovercel:canaryAug 27, 2020
@TimerTimer deleted the hotfix/do-not-rely-on-csstext branchAugust 27, 2020 02:13
@vercelvercel locked asresolvedand limited conversation to collaboratorsJan 30, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@ijjkijjkijjk left review comments

@lfadeslfadesAwaiting requested review from lfades

@timneutkenstimneutkensAwaiting requested review from timneutkens

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Do not rely on browsercssText field

2 participants

@Timer@ijjk

[8]ページ先頭

©2009-2025 Movatter.jp