next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Optimize CSS class names in production builds.

Open Tylerian opened this issue 5 years ago • 62 comments

Motivation

Next.js is generating very verbose CSS class names in production builds, thus increasing the size of the final bundle considerably, especially for big applications.

Solution

The most affordable solution is to use single-character class names, a suggested practice that produces smaller application output while guaranteeing class name uniqueness across the entire application.

With this pull request Next.js will be able to generate incrementally unique class names for production builds while keeping the more developer-friendly verbose class names for development.

As an example, Next.js will be able to generate the class name A from the original class name index_redText__3CwEB generated by CSS modules.

Alternatives I considered

I considered the proposals by @Timer, especially the one cited below:

Deduping of Styles: If multiple classes define common sets of attributes, we may hoist those attributes out into a new class and then transparently compose the emitted classes (think Atomic CSS).

This is indeed the optimal way to go but IMHO it would be a great effort to implement for CSS modules / non-js based styles.

Disclaimer

This feature is based on the great work made by the people at Styletron, using a modified version of their MIT Licensed SequentialIDGenerator.


Fixes #15910 Fixes #9888

Tylerian avatar Jun 15 '20 17:06 Tylerian

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.8s 12.7s -121ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.04 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 2.199 2.241 ⚠️ +0.04
/ avg req/sec 1137.05 1115.46 -21.59
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.463 1.522 ⚠️ +0.06
/error-in-render avg req/sec 1708.61 1642.38 -66.23
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 13.5s 13.8s ⚠️ +266ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.04 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

ijjk avatar Jun 15 '20 17:06 ijjk

Failing test suites

test/integration/css-features/test/index.test.js

  • CSS Modules: Import Global CSS > should've emitted a single CSS file
Expand output

● CSS Modules: Import Global CSS › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Modules: Import Global CSS should've emitted a single CSS file 1`

Snapshot: "a .styles_foo__31qlD{all:initial}"
Received: "a .ae{all:initial}"

  199 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  200 | 
> 201 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  202 |       `"a .styles_foo__31qlD{all:initial}"`
  203 |     )
  204 |   })

  at Object.<anonymous> (integration/css-features/test/index.test.js:201:59)

test/integration/scss-modules/test/index.test.js

  • 3rd Party CSS Module Support > should've emitted a single CSS file
  • 3rd Party CSS Module Support > should've injected the CSS on server render
  • Basic SCSS Module Support > should've emitted a single CSS file
  • Basic SCSS Module Support > should've injected the CSS on server render
  • CSS Module Composes Usage (Basic) > should've emitted a single CSS file
  • CSS Module Composes Usage (External) > should've emitted a single CSS file
  • Catch-all Route CSS Module Usage > should've emitted a single CSS file
  • Dynamic Route CSS Module Usage > should've emitted a single CSS file
  • Valid CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid CSS Module Usage from within node_modules > should've emitted a single CSS file
  • Valid Nested CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid Nested CSS Module Usage from within node_modules > should've emitted a single CSS file
Expand output

● Basic SCSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic SCSS Module Support should've emitted a single CSS file 1`

Snapshot: ".index_redText__2VIiM{color:red}"
Received: ".ae{color:red}"

  53 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  54 | 
> 55 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
     |                                                           ^
  56 |       `".index_redText__2VIiM{color:red}"`
  57 |     )
  58 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:55:59)

● Basic SCSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic SCSS Module Support should've injected the CSS on server render 1`

Snapshot: "index_redText__2VIiM"
Received: "ae"

  70 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  71 | 
> 72 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(
     |                                            ^
  73 |       `"index_redText__2VIiM"`
  74 |     )
  75 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:72:44)

● 3rd Party CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".index_foo__9_fxH{position:relative}.index_foo__9_fxH .bar,.index_foo__9_fxH .baz{height:100%;overflow:hidden}.index_foo__9_fxH .lol,.index_foo__9_fxH>.lel{width:80%}"
Received: ".ae{position:relative}.ae .bar,.ae .baz{height:100%;overflow:hidden}.ae .lol,.ae>.lel{width:80%}"

  109 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  110 | 
> 111 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  112 |       `".index_foo__9_fxH{position:relative}.index_foo__9_fxH .bar,.index_foo__9_fxH .baz{height:100%;overflow:hidden}.index_foo__9_fxH .lol,.index_foo__9_fxH>.lel{width:80%}"`
  113 |     )
  114 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:111:59)

● 3rd Party CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've injected the CSS on server render 1`

Snapshot: "index_foo__9_fxH"
Received: "ae"

  126 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  127 | 
> 128 |     expect($('#verify-div').attr('class')).toMatchInlineSnapshot(
      |                                            ^
  129 |       `"index_foo__9_fxH"`
  130 |     )
  131 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:128:44)

● Valid CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"redText\":\"example_redText__1hNNA\"}"
Received: "{\"message\":\"Why hello there\"} {\"redText\":\"ae\"}"

  311 | 
  312 |     const cssPreload = $('#nm-div')
> 313 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  314 |       `"{\\"message\\":\\"Why hello there\\"} {\\"redText\\":\\"example_redText__1hNNA\\"}"`
  315 |     )
  316 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:313:31)

● Valid CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".example_redText__1hNNA{color:red}"
Received: ".ae{color:red}"

  325 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  326 | 
> 327 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  328 |       `".example_redText__1hNNA{color:red}"`
  329 |     )
  330 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:327:59)

● Valid Nested CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"other2\":\"example_other2__1pnJV\",\"subClass\":\"example_subClass__2EbKX other_className__E6nd8\"}"
Received: "{\"message\":\"Why hello there\"} {\"other2\":\"ae\",\"subClass\":\"af ah\"}"

  364 | 
  365 |     const cssPreload = $('#nm-div')
> 366 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  367 |       `"{\\"message\\":\\"Why hello there\\"} {\\"other2\\":\\"example_other2__1pnJV\\",\\"subClass\\":\\"example_subClass__2EbKX other_className__E6nd8\\"}"`
  368 |     )
  369 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:366:31)

● Valid Nested CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".other_other3__ZPN-Y{color:violet}.other_className__E6nd8{background:red;color:#ff0}.example_other2__1pnJV{color:red}.example_subClass__2EbKX{background:#00f}"
Received: ".ag{color:violet}.ah{background:red;color:#ff0}.ae{color:red}.af{background:#00f}"

  378 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  379 | 
> 380 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  381 |       `".other_other3__ZPN-Y{color:violet}.other_className__E6nd8{background:red;color:#ff0}.example_other2__1pnJV{color:red}.example_subClass__2EbKX{background:#00f}"`
  382 |     )
  383 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:380:59)

● CSS Module Composes Usage (Basic) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (Basic) should've emitted a single CSS file 1`

Snapshot: ".index_className__2O8Wt{background:red;color:#ff0}.index_subClass__3e6Re{background:#00f}"
Received: ".ae{background:red;color:#ff0}.af{background:#00f}"

  411 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  412 | 
> 413 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  414 |       `".index_className__2O8Wt{background:red;color:#ff0}.index_subClass__3e6Re{background:#00f}"`
  415 |     )
  416 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:413:59)

● CSS Module Composes Usage (External) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (External) should've emitted a single CSS file 1`

Snapshot: ".other_className__2VTl4{background:red;color:#ff0}.index_subClass__3e6Re{background:#00f}"
Received: ".af{background:red;color:#ff0}.ae{background:#00f}"

  444 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  445 | 
> 446 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  447 |       `".other_className__2VTl4{background:red;color:#ff0}.index_subClass__3e6Re{background:#00f}"`
  448 |     )
  449 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:446:59)

● Dynamic Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Dynamic Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: "._post__home__3F5yW{background:red}"
Received: ".ae{background:red}"

  482 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  483 | 
> 484 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  485 |       `"._post__home__3F5yW{background:red}"`
  486 |     )
  487 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:484:59)

● Catch-all Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Catch-all Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".___post__home__psZf9{background:red}"
Received: ".ae{background:red}"

  540 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  541 | 
> 542 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  543 |       `".___post__home__psZf9{background:red}"`
  544 |     )
  545 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:542:59)

test/integration/css-modules/test/index.test.js

  • 3rd Party CSS Module Support > should've emitted a single CSS file
  • 3rd Party CSS Module Support > should've injected the CSS on server render
  • Basic CSS Module Support > should've emitted a single CSS file
  • Basic CSS Module Support > should've injected the CSS on server render
  • CSS Module Composes Usage (Basic) > should've emitted a single CSS file
  • CSS Module Composes Usage (External) > should've emitted a single CSS file
  • Catch-all Route CSS Module Usage > should've emitted a single CSS file
  • Dynamic Route CSS Module Usage > should've emitted a single CSS file
  • Valid CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid CSS Module Usage from within node_modules > should've emitted a single CSS file
  • Valid Nested CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid Nested CSS Module Usage from within node_modules > should've emitted a single CSS file
Expand output

● Basic CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".index_redText__3CwEB{color:red}"
Received: ".ae{color:red}"

  54 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  55 | 
> 56 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
     |                                                           ^
  57 |       `".index_redText__3CwEB{color:red}"`
  58 |     )
  59 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:56:59)

● Basic CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've injected the CSS on server render 1`

Snapshot: "index_redText__3CwEB"
Received: "ae"

  71 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  72 | 
> 73 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(
     |                                            ^
  74 |       `"index_redText__3CwEB"`
  75 |     )
  76 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:73:44)

● 3rd Party CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".index_foo__29BAH{position:relative}.index_foo__29BAH .bar,.index_foo__29BAH .baz{height:100%;overflow:hidden}.index_foo__29BAH .lol,.index_foo__29BAH>.lel{width:80%}"
Received: ".ae{position:relative}.ae .bar,.ae .baz{height:100%;overflow:hidden}.ae .lol,.ae>.lel{width:80%}"

  110 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  111 | 
> 112 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  113 |       `".index_foo__29BAH{position:relative}.index_foo__29BAH .bar,.index_foo__29BAH .baz{height:100%;overflow:hidden}.index_foo__29BAH .lol,.index_foo__29BAH>.lel{width:80%}"`
  114 |     )
  115 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:112:59)

● 3rd Party CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've injected the CSS on server render 1`

Snapshot: "index_foo__29BAH"
Received: "ae"

  127 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  128 | 
> 129 |     expect($('#verify-div').attr('class')).toMatchInlineSnapshot(
      |                                            ^
  130 |       `"index_foo__29BAH"`
  131 |     )
  132 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:129:44)

● Valid CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"redText\":\"example_redText__1rb5g\"}"
Received: "{\"message\":\"Why hello there\"} {\"redText\":\"ae\"}"

  312 | 
  313 |     const cssPreload = $('#nm-div')
> 314 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  315 |       `"{\\"message\\":\\"Why hello there\\"} {\\"redText\\":\\"example_redText__1rb5g\\"}"`
  316 |     )
  317 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:314:31)

● Valid CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".example_redText__1rb5g{color:red}"
Received: ".ae{color:red}"

  326 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  327 | 
> 328 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  329 |       `".example_redText__1rb5g{color:red}"`
  330 |     )
  331 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:328:59)

● Valid Nested CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"subClass\":\"example_subClass__2YUgj other_className__bt_-E\"}"
Received: "{\"message\":\"Why hello there\"} {\"subClass\":\"ae af\"}"

  365 | 
  366 |     const cssPreload = $('#nm-div')
> 367 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  368 |       `"{\\"message\\":\\"Why hello there\\"} {\\"subClass\\":\\"example_subClass__2YUgj other_className__bt_-E\\"}"`
  369 |     )
  370 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:367:31)

● Valid Nested CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".other3_other3__1f9h7{color:violet}.other_className__bt_-E{background:red;color:#ff0}.other2_other2__2PUfY{color:red}.example_subClass__2YUgj{background:#00f}"
Received: ".ah{color:violet}.af{background:red;color:#ff0}.ag{color:red}.ae{background:#00f}"

  379 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  380 | 
> 381 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  382 |       `".other3_other3__1f9h7{color:violet}.other_className__bt_-E{background:red;color:#ff0}.other2_other2__2PUfY{color:red}.example_subClass__2YUgj{background:#00f}"`
  383 |     )
  384 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:381:59)

● CSS Module Composes Usage (Basic) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (Basic) should've emitted a single CSS file 1`

Snapshot: ".index_className__3gr_q{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"
Received: ".ae{background:red;color:#ff0}.af{background:#00f}"

  412 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  413 | 
> 414 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  415 |       `".index_className__3gr_q{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"`
  416 |     )
  417 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:414:59)

● CSS Module Composes Usage (External) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (External) should've emitted a single CSS file 1`

Snapshot: ".other_className__21NIP{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"
Received: ".af{background:red;color:#ff0}.ae{background:#00f}"

  445 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  446 | 
> 447 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  448 |       `".other_className__21NIP{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"`
  449 |     )
  450 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:447:59)

● Dynamic Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Dynamic Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: "._post__home__2Cy-L{background:red}"
Received: ".ae{background:red}"

  493 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  494 | 
> 495 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  496 |       `"._post__home__2Cy-L{background:red}"`
  497 |     )
  498 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:495:59)

● Catch-all Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Catch-all Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".___post__home__38gR-{background:red}.__55css_home__qxXcH{color:green}"
Received: ".ae{background:red}.af{color:green}"

  543 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  544 | 
> 545 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  546 |       `".___post__home__38gR-{background:red}.__55css_home__qxXcH{color:green}"`
  547 |     )
  548 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:545:59)

ijjk avatar Jun 15 '20 17:06 ijjk

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.2s 12.1s -105ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.04 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 2.066 2.134 ⚠️ +0.07
/ avg req/sec 1210.32 1171.42 -38.9
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.402 1.423 ⚠️ +0.02
/error-in-render avg req/sec 1783.17 1757.31 -25.86
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 13.2s 13.2s ⚠️ +79ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.04 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

ijjk avatar Jun 15 '20 18:06 ijjk

Failing test suites

test/integration/css-features/test/index.test.js

  • CSS Modules: Import Global CSS > should've emitted a single CSS file
Expand output

● CSS Modules: Import Global CSS › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Modules: Import Global CSS should've emitted a single CSS file 1`

Snapshot: "a .styles_foo__31qlD{all:initial}"
Received: "a .a{all:initial}"

  199 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  200 | 
> 201 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  202 |       `"a .styles_foo__31qlD{all:initial}"`
  203 |     )
  204 |   })

  at Object.<anonymous> (integration/css-features/test/index.test.js:201:59)

test/integration/css-modules/test/index.test.js

  • 3rd Party CSS Module Support > should've emitted a single CSS file
  • 3rd Party CSS Module Support > should've injected the CSS on server render
  • Basic CSS Module Support > should've emitted a single CSS file
  • Basic CSS Module Support > should've injected the CSS on server render
  • CSS Module Composes Usage (Basic) > should've emitted a single CSS file
  • CSS Module Composes Usage (External) > should've emitted a single CSS file
  • Catch-all Route CSS Module Usage > should've emitted a single CSS file
  • Dynamic Route CSS Module Usage > should've emitted a single CSS file
  • Valid CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid CSS Module Usage from within node_modules > should've emitted a single CSS file
  • Valid Nested CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid Nested CSS Module Usage from within node_modules > should've emitted a single CSS file
Expand output

● Basic CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".index_redText__3CwEB{color:red}"
Received: ".a{color:red}"

  54 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  55 | 
> 56 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
     |                                                           ^
  57 |       `".index_redText__3CwEB{color:red}"`
  58 |     )
  59 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:56:59)

● Basic CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've injected the CSS on server render 1`

Snapshot: "index_redText__3CwEB"
Received: "a"

  71 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  72 | 
> 73 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(
     |                                            ^
  74 |       `"index_redText__3CwEB"`
  75 |     )
  76 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:73:44)

● 3rd Party CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".index_foo__29BAH{position:relative}.index_foo__29BAH .bar,.index_foo__29BAH .baz{height:100%;overflow:hidden}.index_foo__29BAH .lol,.index_foo__29BAH>.lel{width:80%}"
Received: ".a{position:relative}.a .bar,.a .baz{height:100%;overflow:hidden}.a .lol,.a>.lel{width:80%}"

  110 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  111 | 
> 112 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  113 |       `".index_foo__29BAH{position:relative}.index_foo__29BAH .bar,.index_foo__29BAH .baz{height:100%;overflow:hidden}.index_foo__29BAH .lol,.index_foo__29BAH>.lel{width:80%}"`
  114 |     )
  115 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:112:59)

● 3rd Party CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've injected the CSS on server render 1`

Snapshot: "index_foo__29BAH"
Received: "a"

  127 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  128 | 
> 129 |     expect($('#verify-div').attr('class')).toMatchInlineSnapshot(
      |                                            ^
  130 |       `"index_foo__29BAH"`
  131 |     )
  132 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:129:44)

● Valid CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"redText\":\"example_redText__1rb5g\"}"
Received: "{\"message\":\"Why hello there\"} {\"redText\":\"a\"}"

  312 | 
  313 |     const cssPreload = $('#nm-div')
> 314 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  315 |       `"{\\"message\\":\\"Why hello there\\"} {\\"redText\\":\\"example_redText__1rb5g\\"}"`
  316 |     )
  317 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:314:31)

● Valid CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".example_redText__1rb5g{color:red}"
Received: ".a{color:red}"

  326 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  327 | 
> 328 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  329 |       `".example_redText__1rb5g{color:red}"`
  330 |     )
  331 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:328:59)

● Valid Nested CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"subClass\":\"example_subClass__2YUgj other_className__bt_-E\"}"
Received: "{\"message\":\"Why hello there\"} {\"subClass\":\"a b\"}"

  365 | 
  366 |     const cssPreload = $('#nm-div')
> 367 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  368 |       `"{\\"message\\":\\"Why hello there\\"} {\\"subClass\\":\\"example_subClass__2YUgj other_className__bt_-E\\"}"`
  369 |     )
  370 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:367:31)

● Valid Nested CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".other3_other3__1f9h7{color:violet}.other_className__bt_-E{background:red;color:#ff0}.other2_other2__2PUfY{color:red}.example_subClass__2YUgj{background:#00f}"
Received: ".d{color:violet}.b{background:red;color:#ff0}.c{color:red}.a{background:#00f}"

  379 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  380 | 
> 381 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  382 |       `".other3_other3__1f9h7{color:violet}.other_className__bt_-E{background:red;color:#ff0}.other2_other2__2PUfY{color:red}.example_subClass__2YUgj{background:#00f}"`
  383 |     )
  384 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:381:59)

● CSS Module Composes Usage (Basic) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (Basic) should've emitted a single CSS file 1`

Snapshot: ".index_className__3gr_q{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"
Received: ".a{background:red;color:#ff0}.b{background:#00f}"

  412 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  413 | 
> 414 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  415 |       `".index_className__3gr_q{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"`
  416 |     )
  417 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:414:59)

● CSS Module Composes Usage (External) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (External) should've emitted a single CSS file 1`

Snapshot: ".other_className__21NIP{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"
Received: ".b{background:red;color:#ff0}.a{background:#00f}"

  445 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  446 | 
> 447 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  448 |       `".other_className__21NIP{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"`
  449 |     )
  450 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:447:59)

● Dynamic Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Dynamic Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: "._post__home__2Cy-L{background:red}"
Received: ".a{background:red}"

  493 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  494 | 
> 495 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  496 |       `"._post__home__2Cy-L{background:red}"`
  497 |     )
  498 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:495:59)

● Catch-all Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Catch-all Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".___post__home__38gR-{background:red}.__55css_home__qxXcH{color:green}"
Received: ".a{background:red}.b{color:green}"

  543 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  544 | 
> 545 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  546 |       `".___post__home__38gR-{background:red}.__55css_home__qxXcH{color:green}"`
  547 |     )
  548 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:545:59)

ijjk avatar Jun 15 '20 18:06 ijjk

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12s 12.2s ⚠️ +249ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.31 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 1.996 2.026 ⚠️ +0.03
/ avg req/sec 1252.64 1233.67 -18.97
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.183 1.217 ⚠️ +0.03
/error-in-render avg req/sec 2112.42 2054.87 -57.55
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 13s 13s ⚠️ +1ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.31 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

ijjk avatar Jun 15 '20 18:06 ijjk

Failing test suites

test/integration/css-features/test/index.test.js

  • CSS Modules: Import Global CSS > should've emitted a single CSS file
Expand output

● CSS Modules: Import Global CSS › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Modules: Import Global CSS should've emitted a single CSS file 1`

Snapshot: "a .styles_foo__31qlD{all:initial}"
Received: "a .a{all:initial}"

  199 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  200 | 
> 201 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  202 |       `"a .styles_foo__31qlD{all:initial}"`
  203 |     )
  204 |   })

  at Object.<anonymous> (integration/css-features/test/index.test.js:201:59)

test/integration/css-modules/test/index.test.js

  • 3rd Party CSS Module Support > should've emitted a single CSS file
  • 3rd Party CSS Module Support > should've injected the CSS on server render
  • Basic CSS Module Support > should've emitted a single CSS file
  • Basic CSS Module Support > should've injected the CSS on server render
  • CSS Module Composes Usage (Basic) > should've emitted a single CSS file
  • CSS Module Composes Usage (External) > should've emitted a single CSS file
  • Catch-all Route CSS Module Usage > should've emitted a single CSS file
  • Dynamic Route CSS Module Usage > should've emitted a single CSS file
  • Valid CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid CSS Module Usage from within node_modules > should've emitted a single CSS file
  • Valid Nested CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid Nested CSS Module Usage from within node_modules > should've emitted a single CSS file
Expand output

● Basic CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".index_redText__3CwEB{color:red}"
Received: ".a{color:red}"

  54 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  55 | 
> 56 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
     |                                                           ^
  57 |       `".index_redText__3CwEB{color:red}"`
  58 |     )
  59 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:56:59)

● Basic CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've injected the CSS on server render 1`

Snapshot: "index_redText__3CwEB"
Received: "a"

  71 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  72 | 
> 73 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(
     |                                            ^
  74 |       `"index_redText__3CwEB"`
  75 |     )
  76 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:73:44)

● 3rd Party CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".index_foo__29BAH{position:relative}.index_foo__29BAH .bar,.index_foo__29BAH .baz{height:100%;overflow:hidden}.index_foo__29BAH .lol,.index_foo__29BAH>.lel{width:80%}"
Received: ".a{position:relative}.a .bar,.a .baz{height:100%;overflow:hidden}.a .lol,.a>.lel{width:80%}"

  110 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  111 | 
> 112 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  113 |       `".index_foo__29BAH{position:relative}.index_foo__29BAH .bar,.index_foo__29BAH .baz{height:100%;overflow:hidden}.index_foo__29BAH .lol,.index_foo__29BAH>.lel{width:80%}"`
  114 |     )
  115 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:112:59)

● 3rd Party CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've injected the CSS on server render 1`

Snapshot: "index_foo__29BAH"
Received: "a"

  127 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  128 | 
> 129 |     expect($('#verify-div').attr('class')).toMatchInlineSnapshot(
      |                                            ^
  130 |       `"index_foo__29BAH"`
  131 |     )
  132 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:129:44)

● Valid CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"redText\":\"example_redText__1rb5g\"}"
Received: "{\"message\":\"Why hello there\"} {\"redText\":\"a\"}"

  312 | 
  313 |     const cssPreload = $('#nm-div')
> 314 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  315 |       `"{\\"message\\":\\"Why hello there\\"} {\\"redText\\":\\"example_redText__1rb5g\\"}"`
  316 |     )
  317 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:314:31)

● Valid CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".example_redText__1rb5g{color:red}"
Received: ".a{color:red}"

  326 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  327 | 
> 328 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  329 |       `".example_redText__1rb5g{color:red}"`
  330 |     )
  331 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:328:59)

● Valid Nested CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"subClass\":\"example_subClass__2YUgj other_className__bt_-E\"}"
Received: "{\"message\":\"Why hello there\"} {\"subClass\":\"a b\"}"

  365 | 
  366 |     const cssPreload = $('#nm-div')
> 367 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  368 |       `"{\\"message\\":\\"Why hello there\\"} {\\"subClass\\":\\"example_subClass__2YUgj other_className__bt_-E\\"}"`
  369 |     )
  370 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:367:31)

● Valid Nested CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".other3_other3__1f9h7{color:violet}.other_className__bt_-E{background:red;color:#ff0}.other2_other2__2PUfY{color:red}.example_subClass__2YUgj{background:#00f}"
Received: ".d{color:violet}.b{background:red;color:#ff0}.c{color:red}.a{background:#00f}"

  379 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  380 | 
> 381 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  382 |       `".other3_other3__1f9h7{color:violet}.other_className__bt_-E{background:red;color:#ff0}.other2_other2__2PUfY{color:red}.example_subClass__2YUgj{background:#00f}"`
  383 |     )
  384 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:381:59)

● CSS Module Composes Usage (Basic) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (Basic) should've emitted a single CSS file 1`

Snapshot: ".index_className__3gr_q{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"
Received: ".a{background:red;color:#ff0}.b{background:#00f}"

  412 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  413 | 
> 414 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  415 |       `".index_className__3gr_q{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"`
  416 |     )
  417 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:414:59)

● CSS Module Composes Usage (External) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (External) should've emitted a single CSS file 1`

Snapshot: ".other_className__21NIP{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"
Received: ".b{background:red;color:#ff0}.a{background:#00f}"

  445 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  446 | 
> 447 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  448 |       `".other_className__21NIP{background:red;color:#ff0}.index_subClass__FUvW6{background:#00f}"`
  449 |     )
  450 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:447:59)

● Dynamic Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Dynamic Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: "._post__home__2Cy-L{background:red}"
Received: ".a{background:red}"

  493 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  494 | 
> 495 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  496 |       `"._post__home__2Cy-L{background:red}"`
  497 |     )
  498 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:495:59)

● Catch-all Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Catch-all Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".___post__home__38gR-{background:red}.__55css_home__qxXcH{color:green}"
Received: ".a{background:red}.b{color:green}"

  543 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  544 | 
> 545 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  546 |       `".___post__home__38gR-{background:red}.__55css_home__qxXcH{color:green}"`
  547 |     )
  548 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:545:59)

ijjk avatar Jun 15 '20 18:06 ijjk

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.2s 12.7s ⚠️ +439ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.31 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 2.039 2.091 ⚠️ +0.05
/ avg req/sec 1226.22 1195.51 -30.71
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.25 1.202 -0.05
/error-in-render avg req/sec 2000.42 2079.24 ⚠️ +78.82
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 13.2s 13.2s -24ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.31 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

ijjk avatar Jun 15 '20 20:06 ijjk

Failing test suites

test/integration/css-features/test/index.test.js

  • CSS Modules: Import Global CSS > should've emitted a single CSS file
Expand output

● CSS Modules: Import Global CSS › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Modules: Import Global CSS should've emitted a single CSS file 1`

Snapshot: "a .styles_foo__31qlD{all:initial}"
Received: "a .a{all:initial}"

  199 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  200 | 
> 201 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  202 |       `"a .styles_foo__31qlD{all:initial}"`
  203 |     )
  204 |   })

  at Object.<anonymous> (integration/css-features/test/index.test.js:201:59)

ijjk avatar Jun 15 '20 20:06 ijjk

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 11.6s 10.9s -661ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.31 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 1.937 1.9 -0.04
/ avg req/sec 1290.39 1315.95 ⚠️ +25.56
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.141 1.131 -0.01
/error-in-render avg req/sec 2190.23 2211.13 ⚠️ +20.9
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.5s 12.6s ⚠️ +165ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.31 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

ijjk avatar Jun 15 '20 20:06 ijjk

Removing WIP tag as I finished adding tests and they have successfully passed

Tylerian avatar Jun 15 '20 22:06 Tylerian

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.5s 12.6s ⚠️ +63ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.31 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 2.259 2.34 ⚠️ +0.08
/ avg req/sec 1106.89 1068.55 -38.34
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.582 1.565 -0.02
/error-in-render avg req/sec 1580.32 1597.93 ⚠️ +17.61
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 14s 13.3s -694ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +6.31 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

ijjk avatar Jun 15 '20 22:06 ijjk

Adding WIP status again as I'll rethink the algorithm to also include uppercase letters further increasing compression of minified class names

Tylerian avatar Jun 16 '20 06:06 Tylerian

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.2s 13s ⚠️ +783ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +9.66 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 2.021 2.079 ⚠️ +0.06
/ avg req/sec 1236.85 1202.62 -34.23
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.253 1.211 -0.04
/error-in-render avg req/sec 1995.27 2064.28 ⚠️ +69.01
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 13.3s 13.2s -136ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +9.66 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

ijjk avatar Jun 16 '20 08:06 ijjk

@timneutkens Although tests pass, building a project using my local copy is spitting multiple warnings like the one below.

Conflict: Multiple assets emit different content to the same filename static/css/<hash>.css

Is it related to #13937 or is a problem I introduced with this PR?

Tylerian avatar Jun 16 '20 08:06 Tylerian

@timneutkens Although tests pass, building a project using my local copy is spitting multiple warnings like the one below.

Conflict: Multiple assets emit different content to the same filename static/css/<hash>.css

Is it related to #13937 or is a problem I introduced with this PR?

Forget it, I was using an outdated local version

Tylerian avatar Jun 16 '20 09:06 Tylerian

Added missing unit tests and removed the WIP tag.

now that this PR is complete I'm welcoming any feedback you guys may land :)

Tylerian avatar Jun 16 '20 10:06 Tylerian

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 10.6s 10.2s -419ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +9.82 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 1.809 1.725 -0.08
/ avg req/sec 1382.35 1449.68 ⚠️ +67.33
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.118 1.044 -0.07
/error-in-render avg req/sec 2235.71 2394.87 ⚠️ +159.16
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 11.4s 10.8s -679ms
nodeModulesSize 65.2 MB 65.2 MB ⚠️ +9.82 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

ijjk avatar Jun 16 '20 10:06 ijjk

Hopefully @kristoferbaxter can chime in on this! We've previously had discussions regarding optimal class name generation for gzip.

Timer avatar Jun 22 '20 12:06 Timer

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.2s 12.1s -97ms
nodeModulesSize 67.1 MB 67.1 MB ⚠️ +9.8 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 2.039 1.976 -0.06
/ avg req/sec 1226.27 1265.35 ⚠️ +39.08
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.218 1.177 -0.04
/error-in-render avg req/sec 2053.03 2123.34 ⚠️ +70.31
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 954 B 954 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.8s 12.7s -166ms
nodeModulesSize 67.1 MB 67.1 MB ⚠️ +9.8 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 916 kB 916 kB
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB
Commit: 160c7d2109933c178deb2a2ede9610a8bf917f45

ijjk avatar Jun 24 '20 14:06 ijjk

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.2s 12.1s -143ms
nodeModulesSize 67.1 MB 67.1 MB ⚠️ +9.8 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 1.971 2.113 ⚠️ +0.14
/ avg req/sec 1268.15 1183.24 -84.91
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.184 1.215 ⚠️ +0.03
/error-in-render avg req/sec 2110.97 2056.94 -54.03
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 954 B 954 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 13.1s 12.8s -350ms
nodeModulesSize 67.1 MB 67.1 MB ⚠️ +9.8 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 916 kB 916 kB
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB
Commit: 0241e9ab59c1e799f0b3df780a1b37825c2af7a4

ijjk avatar Jun 24 '20 14:06 ijjk

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 11.5s 11.8s ⚠️ +273ms
nodeModulesSize 67.1 MB 67.1 MB ⚠️ +9.8 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 2.045 2.005 -0.04
/ avg req/sec 1222.77 1246.94 ⚠️ +24.17
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.413 1.362 -0.05
/error-in-render avg req/sec 1769.33 1835.06 ⚠️ +65.73
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 954 B 954 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.4s 12.4s -26ms
nodeModulesSize 67.1 MB 67.1 MB ⚠️ +9.8 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 916 kB 916 kB
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB
Commit: f3a01c386df879c8c4fc3ebb07a55cff054ac052

ijjk avatar Jun 24 '20 15:06 ijjk

Failing test suites

Commit: f3a01c386df879c8c4fc3ebb07a55cff054ac052

test/integration/css-features/test/index.test.js

  • CSS Modules: Import Global CSS > should've emitted a single CSS file
Expand output

● CSS Modules: Import Global CSS › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Modules: Import Global CSS should've emitted a single CSS file 1`

Snapshot: "a .A{all:initial}"
Received: "a .a{all:initial}"

  199 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  200 | 
> 201 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  202 |       `"a .A{all:initial}"`
  203 |     )
  204 |   })

  at Object.<anonymous> (integration/css-features/test/index.test.js:201:59)

test/unit/base62.test.js

  • base62 tests > correctly encodes value
Expand output

● base62 tests › correctly encodes value

expect(received).toBe(expected) // Object.is equality

Expected: "a"
Received: "A"

  10 |   it('correctly encodes value', () => {
  11 |     const result1 = base62(36)
> 12 |     expect(result1).toBe('a')
     |                     ^
  13 | 
  14 |     const result2 = base62(123456)
  15 |     expect(result2).toBe('W7E')

  at Object.<anonymous> (unit/base62.test.js:12:21)

ijjk avatar Jun 24 '20 15:06 ijjk

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 10.5s 10.5s -10ms
nodeModulesSize 67.2 MB 67.2 MB ⚠️ +10.5 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 1.704 1.715 ⚠️ +0.01
/ avg req/sec 1466.86 1457.85 -9.01
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.037 1.009 -0.03
/error-in-render avg req/sec 2411.27 2477.68 ⚠️ +66.41
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 954 B 954 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 11.2s 11.1s -146ms
nodeModulesSize 67.2 MB 67.2 MB ⚠️ +10.5 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 916 kB 916 kB
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB
Commit: c95e4e21f98bb4990563021e6b40afd46848b96b

ijjk avatar Jun 24 '20 20:06 ijjk

Failing test suites

Commit: c95e4e21f98bb4990563021e6b40afd46848b96b

test/integration/css-features/test/index.test.js

  • CSS Modules: Import Global CSS > should've emitted a single CSS file
Expand output

● CSS Modules: Import Global CSS › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Modules: Import Global CSS should've emitted a single CSS file 1`

Snapshot: "a .A{all:initial}"
Received: "a .a{all:initial}"

  199 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  200 | 
> 201 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  202 |       `"a .A{all:initial}"`
  203 |     )
  204 |   })

  at Object.<anonymous> (integration/css-features/test/index.test.js:201:59)

test/integration/css-modules/test/index.test.js

  • 3rd Party CSS Module Support > should've emitted a single CSS file
  • 3rd Party CSS Module Support > should've injected the CSS on server render
  • Basic CSS Module Support > should've emitted a single CSS file
  • Basic CSS Module Support > should've injected the CSS on server render
  • CSS Module Composes Usage (Basic) > should've emitted a single CSS file
  • CSS Module Composes Usage (External) > should've emitted a single CSS file
  • Catch-all Route CSS Module Usage > should've emitted a single CSS file
  • Dynamic Route CSS Module Usage > should've emitted a single CSS file
  • Has CSS Module in computed styles in Production > emits optimized class names in Production
  • Valid CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid CSS Module Usage from within node_modules > should've emitted a single CSS file
  • Valid Nested CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid Nested CSS Module Usage from within node_modules > should've emitted a single CSS file
Expand output

● Basic CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".A{color:red}"
Received: ".a{color:red}"

  54 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  55 | 
> 56 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
     |                                                           ^
  57 |       `".A{color:red}"`
  58 |     )
  59 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:56:59)

● Basic CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've injected the CSS on server render 1`

Snapshot: "A"
Received: "a"

  71 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  72 | 
> 73 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(`"A"`)
     |                                            ^
  74 |   })
  75 | })
  76 | 

  at Object.<anonymous> (integration/css-modules/test/index.test.js:73:44)

● 3rd Party CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".A{position:relative}.A .bar,.A .baz{height:100%;overflow:hidden}.A .lol,.A>.lel{width:80%}"
Received: ".a{position:relative}.a .bar,.a .baz{height:100%;overflow:hidden}.a .lol,.a>.lel{width:80%}"

  108 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  109 | 
> 110 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  111 |       `".A{position:relative}.A .bar,.A .baz{height:100%;overflow:hidden}.A .lol,.A>.lel{width:80%}"`
  112 |     )
  113 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:110:59)

● 3rd Party CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've injected the CSS on server render 1`

Snapshot: "A"
Received: "a"

  125 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  126 | 
> 127 |     expect($('#verify-div').attr('class')).toMatchInlineSnapshot(`"A"`)
      |                                            ^
  128 |   })
  129 | })
  130 | 

  at Object.<anonymous> (integration/css-modules/test/index.test.js:127:44)

● Has CSS Module in computed styles in Production › emits optimized class names in Production

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Has CSS Module in computed styles in Production emits optimized class names in Production 1`

Snapshot: "A"
Received: "a"

  199 |     const $ = cheerio.load(content)
  200 | 
> 201 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(`"A"`)
      |                                            ^
  202 |   })
  203 | })
  204 | 

  at Object.<anonymous> (integration/css-modules/test/index.test.js:201:44)

● Valid CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"redText\":\"A\"}"
Received: "{\"message\":\"Why hello there\"} {\"redText\":\"a\"}"

  324 | 
  325 |     const cssPreload = $('#nm-div')
> 326 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  327 |       `"{\\"message\\":\\"Why hello there\\"} {\\"redText\\":\\"A\\"}"`
  328 |     )
  329 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:326:31)

● Valid CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".A{color:red}"
Received: ".a{color:red}"

  338 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  339 | 
> 340 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  341 |       `".A{color:red}"`
  342 |     )
  343 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:340:59)

● Valid Nested CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"subClass\":\"A B\"}"
Received: "{\"message\":\"Why hello there\"} {\"subClass\":\"a b\"}"

  377 | 
  378 |     const cssPreload = $('#nm-div')
> 379 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  380 |       `"{\\"message\\":\\"Why hello there\\"} {\\"subClass\\":\\"A B\\"}"`
  381 |     )
  382 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:379:31)

● Valid Nested CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".D{color:violet}.B{background:red;color:#ff0}.C{color:red}.A{background:#00f}"
Received: ".d{color:violet}.b{background:red;color:#ff0}.c{color:red}.a{background:#00f}"

  391 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  392 | 
> 393 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  394 |       `".D{color:violet}.B{background:red;color:#ff0}.C{color:red}.A{background:#00f}"`
  395 |     )
  396 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:393:59)

● CSS Module Composes Usage (Basic) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (Basic) should've emitted a single CSS file 1`

Snapshot: ".A{background:red;color:#ff0}.B{background:#00f}"
Received: ".a{background:red;color:#ff0}.b{background:#00f}"

  424 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  425 | 
> 426 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  427 |       `".A{background:red;color:#ff0}.B{background:#00f}"`
  428 |     )
  429 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:426:59)

● CSS Module Composes Usage (External) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (External) should've emitted a single CSS file 1`

Snapshot: ".B{background:red;color:#ff0}.A{background:#00f}"
Received: ".b{background:red;color:#ff0}.a{background:#00f}"

  457 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  458 | 
> 459 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  460 |       `".B{background:red;color:#ff0}.A{background:#00f}"`
  461 |     )
  462 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:459:59)

● Dynamic Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Dynamic Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".A{background:red}"
Received: ".a{background:red}"

  505 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  506 | 
> 507 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  508 |       `".A{background:red}"`
  509 |     )
  510 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:507:59)

● Catch-all Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Catch-all Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".A{background:red}.B{color:green}"
Received: ".a{background:red}.b{color:green}"

  555 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  556 | 
> 557 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  558 |       `".A{background:red}.B{color:green}"`
  559 |     )
  560 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:557:59)

test/integration/scss-modules/test/index.test.js

  • 3rd Party CSS Module Support > should've emitted a single CSS file
  • 3rd Party CSS Module Support > should've injected the CSS on server render
  • Basic SCSS Module Support > should've emitted a single CSS file
  • Basic SCSS Module Support > should've injected the CSS on server render
  • CSS Module Composes Usage (Basic) > should've emitted a single CSS file
  • CSS Module Composes Usage (External) > should've emitted a single CSS file
  • Catch-all Route CSS Module Usage > should've emitted a single CSS file
  • Dynamic Route CSS Module Usage > should've emitted a single CSS file
  • Has CSS Module in computed styles in Production > emits optimized class names in Production
  • Valid CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid CSS Module Usage from within node_modules > should've emitted a single CSS file
  • Valid Nested CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid Nested CSS Module Usage from within node_modules > should've emitted a single CSS file
Expand output

● Basic SCSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic SCSS Module Support should've emitted a single CSS file 1`

Snapshot: ".A{color:red}"
Received: ".a{color:red}"

  53 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  54 | 
> 55 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
     |                                                           ^
  56 |       `".A{color:red}"`
  57 |     )
  58 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:55:59)

● Basic SCSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic SCSS Module Support should've injected the CSS on server render 1`

Snapshot: "A"
Received: "a"

  70 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  71 | 
> 72 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(`"A"`)
     |                                            ^
  73 |   })
  74 | })
  75 | 

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:72:44)

● 3rd Party CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".A{position:relative}.A .bar,.A .baz{height:100%;overflow:hidden}.A .lol,.A>.lel{width:80%}"
Received: ".a{position:relative}.a .bar,.a .baz{height:100%;overflow:hidden}.a .lol,.a>.lel{width:80%}"

  107 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  108 | 
> 109 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  110 |       `".A{position:relative}.A .bar,.A .baz{height:100%;overflow:hidden}.A .lol,.A>.lel{width:80%}"`
  111 |     )
  112 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:109:59)

● 3rd Party CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've injected the CSS on server render 1`

Snapshot: "A"
Received: "a"

  124 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  125 | 
> 126 |     expect($('#verify-div').attr('class')).toMatchInlineSnapshot(`"A"`)
      |                                            ^
  127 |   })
  128 | })
  129 | 

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:126:44)

● Has CSS Module in computed styles in Production › emits optimized class names in Production

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Has CSS Module in computed styles in Production emits optimized class names in Production 1`

Snapshot: "A"
Received: "a"

  198 |     const $ = cheerio.load(content)
  199 | 
> 200 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(`"A"`)
      |                                            ^
  201 |   })
  202 | })
  203 | 

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:200:44)

● Valid CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"redText\":\"A\"}"
Received: "{\"message\":\"Why hello there\"} {\"redText\":\"a\"}"

  323 | 
  324 |     const cssPreload = $('#nm-div')
> 325 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  326 |       `"{\\"message\\":\\"Why hello there\\"} {\\"redText\\":\\"A\\"}"`
  327 |     )
  328 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:325:31)

● Valid CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".A{color:red}"
Received: ".a{color:red}"

  337 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  338 | 
> 339 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  340 |       `".A{color:red}"`
  341 |     )
  342 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:339:59)

● Valid Nested CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"other2\":\"A\",\"subClass\":\"B D\"}"
Received: "{\"message\":\"Why hello there\"} {\"other2\":\"a\",\"subClass\":\"b d\"}"

  376 | 
  377 |     const cssPreload = $('#nm-div')
> 378 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  379 |       `"{\\"message\\":\\"Why hello there\\"} {\\"other2\\":\\"A\\",\\"subClass\\":\\"B D\\"}"`
  380 |     )
  381 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:378:31)

● Valid Nested CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".C{color:violet}.D{background:red;color:#ff0}.A{color:red}.B{background:#00f}"
Received: ".c{color:violet}.d{background:red;color:#ff0}.a{color:red}.b{background:#00f}"

  390 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  391 | 
> 392 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  393 |       `".C{color:violet}.D{background:red;color:#ff0}.A{color:red}.B{background:#00f}"`
  394 |     )
  395 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:392:59)

● CSS Module Composes Usage (Basic) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (Basic) should've emitted a single CSS file 1`

Snapshot: ".A{background:red;color:#ff0}.B{background:#00f}"
Received: ".a{background:red;color:#ff0}.b{background:#00f}"

  423 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  424 | 
> 425 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  426 |       `".A{background:red;color:#ff0}.B{background:#00f}"`
  427 |     )
  428 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:425:59)

● CSS Module Composes Usage (External) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (External) should've emitted a single CSS file 1`

Snapshot: ".B{background:red;color:#ff0}.A{background:#00f}"
Received: ".b{background:red;color:#ff0}.a{background:#00f}"

  456 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  457 | 
> 458 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  459 |       `".B{background:red;color:#ff0}.A{background:#00f}"`
  460 |     )
  461 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:458:59)

● Dynamic Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Dynamic Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".A{background:red}"
Received: ".a{background:red}"

  494 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  495 | 
> 496 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  497 |       `".A{background:red}"`
  498 |     )
  499 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:496:59)

● Catch-all Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Catch-all Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".A{background:red}"
Received: ".a{background:red}"

  552 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  553 | 
> 554 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  555 |       `".A{background:red}"`
  556 |     )
  557 |   })

  at Object.<anonymous> (integration/scss-modules/test/index.test.js:554:59)

ijjk avatar Jun 24 '20 20:06 ijjk

I came to an edge case where a generated class name could potentially cause conflict when using a third party CSS library (example: fa class in fontawesome).

I've thought of two possible approaches to solve this:

  • Give the user the possibility to create a class name blacklist under next.config.js.
  • Give the user the possibility to set a prefix for the generated class names.

@Timer WDYT?

Tylerian avatar Jun 24 '20 20:06 Tylerian

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 11.5s 11.5s -44ms
nodeModulesSize 67.2 MB 67.2 MB ⚠️ +10.4 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 1.892 1.869 -0.02
/ avg req/sec 1321.62 1337.75 ⚠️ +16.13
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.164 1.135 -0.03
/error-in-render avg req/sec 2147.4 2202.21 ⚠️ +54.81
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 954 B 954 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.3s 12.3s ⚠️ +26ms
nodeModulesSize 67.2 MB 67.2 MB ⚠️ +10.4 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 916 kB 916 kB
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB
Commit: a474ad15c92d0186ab52c8b2d4fbb59f9893ef32

ijjk avatar Jun 24 '20 20:06 ijjk

Failing test suites

Commit: a474ad15c92d0186ab52c8b2d4fbb59f9893ef32

test/unit/base62.test.js

Expand output

● Test suite failed to run

Cannot find module 'next/dist/build/webpack/config/blocks/css/loaders/utils/base62' from 'base62.test.js'

> 1 | import base62 from 'next/dist/build/webpack/config/blocks/css/loaders/utils/base62'
    | ^
  2 | 
  3 | describe('base62 tests', () => {
  4 |   it('returns first word in dictionary if input equals 0', () => {

  at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:259:17)
  at Object.<anonymous> (unit/base62.test.js:1:1)

test/unit/sequential-id-generator.test.js

Expand output

● Test suite failed to run

Cannot find module 'next/dist/build/webpack/config/blocks/css/loaders/utils/SequentialIDGenerator' from 'sequential-id-generator.test.js'

> 1 | import SequentialIDGenerator from 'next/dist/build/webpack/config/blocks/css/loaders/utils/SequentialIDGenerator'
    | ^
  2 | 
  3 | describe('', () => {
  4 |   let generator

  at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:259:17)
  at Object.<anonymous> (unit/sequential-id-generator.test.js:1:1)

test/integration/css-features/test/index.test.js

  • CSS Modules: Import Global CSS > should've emitted a single CSS file
Expand output

● CSS Modules: Import Global CSS › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Modules: Import Global CSS should've emitted a single CSS file 1`

Snapshot: "a .A{all:initial}"
Received: "a .a{all:initial}"

  199 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  200 | 
> 201 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  202 |       `"a .A{all:initial}"`
  203 |     )
  204 |   })

  at Object.<anonymous> (integration/css-features/test/index.test.js:201:59)

test/integration/css-modules/test/index.test.js

  • 3rd Party CSS Module Support > should've emitted a single CSS file
  • 3rd Party CSS Module Support > should've injected the CSS on server render
  • Basic CSS Module Support > should've emitted a single CSS file
  • Basic CSS Module Support > should've injected the CSS on server render
  • CSS Module Composes Usage (Basic) > should've emitted a single CSS file
  • CSS Module Composes Usage (External) > should've emitted a single CSS file
  • Catch-all Route CSS Module Usage > should've emitted a single CSS file
  • Dynamic Route CSS Module Usage > should've emitted a single CSS file
  • Has CSS Module in computed styles in Production > emits optimized class names in Production
  • Valid CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid CSS Module Usage from within node_modules > should've emitted a single CSS file
  • Valid Nested CSS Module Usage from within node_modules > should've prerendered with relevant data
  • Valid Nested CSS Module Usage from within node_modules > should've emitted a single CSS file
Expand output

● Basic CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".A{color:red}"
Received: ".a{color:red}"

  54 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  55 | 
> 56 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
     |                                                           ^
  57 |       `".A{color:red}"`
  58 |     )
  59 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:56:59)

● Basic CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Basic CSS Module Support should've injected the CSS on server render 1`

Snapshot: "A"
Received: "a"

  71 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  72 | 
> 73 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(`"A"`)
     |                                            ^
  74 |   })
  75 | })
  76 | 

  at Object.<anonymous> (integration/css-modules/test/index.test.js:73:44)

● 3rd Party CSS Module Support › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've emitted a single CSS file 1`

Snapshot: ".A{position:relative}.A .bar,.A .baz{height:100%;overflow:hidden}.A .lol,.A>.lel{width:80%}"
Received: ".a{position:relative}.a .bar,.a .baz{height:100%;overflow:hidden}.a .lol,.a>.lel{width:80%}"

  108 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  109 | 
> 110 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  111 |       `".A{position:relative}.A .bar,.A .baz{height:100%;overflow:hidden}.A .lol,.A>.lel{width:80%}"`
  112 |     )
  113 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:110:59)

● 3rd Party CSS Module Support › should've injected the CSS on server render

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `3rd Party CSS Module Support should've injected the CSS on server render 1`

Snapshot: "A"
Received: "a"

  125 |     expect(cssSheet.attr('href')).toMatch(/^\/_next\/static\/css\/.*\.css$/)
  126 | 
> 127 |     expect($('#verify-div').attr('class')).toMatchInlineSnapshot(`"A"`)
      |                                            ^
  128 |   })
  129 | })
  130 | 

  at Object.<anonymous> (integration/css-modules/test/index.test.js:127:44)

● Has CSS Module in computed styles in Production › emits optimized class names in Production

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Has CSS Module in computed styles in Production emits optimized class names in Production 1`

Snapshot: "A"
Received: "a"

  199 |     const $ = cheerio.load(content)
  200 | 
> 201 |     expect($('#verify-red').attr('class')).toMatchInlineSnapshot(`"A"`)
      |                                            ^
  202 |   })
  203 | })
  204 | 

  at Object.<anonymous> (integration/css-modules/test/index.test.js:201:44)

● Valid CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"redText\":\"A\"}"
Received: "{\"message\":\"Why hello there\"} {\"redText\":\"a\"}"

  324 | 
  325 |     const cssPreload = $('#nm-div')
> 326 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  327 |       `"{\\"message\\":\\"Why hello there\\"} {\\"redText\\":\\"A\\"}"`
  328 |     )
  329 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:326:31)

● Valid CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".A{color:red}"
Received: ".a{color:red}"

  338 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  339 | 
> 340 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  341 |       `".A{color:red}"`
  342 |     )
  343 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:340:59)

● Valid Nested CSS Module Usage from within node_modules › should've prerendered with relevant data

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've prerendered with relevant data 1`

Snapshot: "{\"message\":\"Why hello there\"} {\"subClass\":\"A B\"}"
Received: "{\"message\":\"Why hello there\"} {\"subClass\":\"a b\"}"

  377 | 
  378 |     const cssPreload = $('#nm-div')
> 379 |     expect(cssPreload.text()).toMatchInlineSnapshot(
      |                               ^
  380 |       `"{\\"message\\":\\"Why hello there\\"} {\\"subClass\\":\\"A B\\"}"`
  381 |     )
  382 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:379:31)

● Valid Nested CSS Module Usage from within node_modules › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Valid Nested CSS Module Usage from within node_modules should've emitted a single CSS file 1`

Snapshot: ".D{color:violet}.B{background:red;color:#ff0}.C{color:red}.A{background:#00f}"
Received: ".d{color:violet}.b{background:red;color:#ff0}.c{color:red}.a{background:#00f}"

  391 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  392 | 
> 393 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  394 |       `".D{color:violet}.B{background:red;color:#ff0}.C{color:red}.A{background:#00f}"`
  395 |     )
  396 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:393:59)

● CSS Module Composes Usage (Basic) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (Basic) should've emitted a single CSS file 1`

Snapshot: ".A{background:red;color:#ff0}.B{background:#00f}"
Received: ".a{background:red;color:#ff0}.b{background:#00f}"

  424 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  425 | 
> 426 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  427 |       `".A{background:red;color:#ff0}.B{background:#00f}"`
  428 |     )
  429 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:426:59)

● CSS Module Composes Usage (External) › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Module Composes Usage (External) should've emitted a single CSS file 1`

Snapshot: ".B{background:red;color:#ff0}.A{background:#00f}"
Received: ".b{background:red;color:#ff0}.a{background:#00f}"

  457 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  458 | 
> 459 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  460 |       `".B{background:red;color:#ff0}.A{background:#00f}"`
  461 |     )
  462 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:459:59)

● Dynamic Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Dynamic Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".A{background:red}"
Received: ".a{background:red}"

  505 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  506 | 
> 507 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  508 |       `".A{background:red}"`
  509 |     )
  510 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:507:59)

● Catch-all Route CSS Module Usage › should've emitted a single CSS file

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `Catch-all Route CSS Module Usage should've emitted a single CSS file 1`

Snapshot: ".A{background:red}.B{color:green}"
Received: ".a{background:red}.b{color:green}"

  555 |     const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
  556 | 
> 557 |     expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot(
      |                                                           ^
  558 |       `".A{background:red}.B{color:green}"`
  559 |     )
  560 |   })

  at Object.<anonymous> (integration/css-modules/test/index.test.js:557:59)

ijjk avatar Jun 24 '20 20:06 ijjk

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 10s 10.7s ⚠️ +638ms
nodeModulesSize 67.2 MB 67.2 MB ⚠️ +10.4 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 1.682 1.608 -0.07
/ avg req/sec 1486.29 1554.75 ⚠️ +68.46
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.003 0.988 -0.01
/error-in-render avg req/sec 2491.31 2529.21 ⚠️ +37.9
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 954 B 954 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 10.7s 10.5s -155ms
nodeModulesSize 67.2 MB 67.2 MB ⚠️ +10.4 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 916 kB 916 kB
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB
Commit: b08729831634b25e06e3f46d4b642f76b8c09abe

ijjk avatar Jun 24 '20 21:06 ijjk

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 12.6s 13.1s ⚠️ +562ms
nodeModulesSize 67.2 MB 67.2 MB ⚠️ +10.4 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
/ failed reqs 0 0
/ total time (seconds) 2.175 2.122 -0.05
/ avg req/sec 1149.54 1178.17 ⚠️ +28.63
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.311 1.269 -0.04
/error-in-render avg req/sec 1906.32 1970.82 ⚠️ +64.5
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
index.html gzip 954 B 954 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
buildDuration 13.3s 13.5s ⚠️ +226ms
nodeModulesSize 67.2 MB 67.2 MB ⚠️ +10.4 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..14a7.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.1 kB 57.1 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
main-HASH.module.js gzip 5.57 kB 5.57 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 7.07 kB 7.07 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary Tylerian/next.js feature/optimized-css-classnames Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 916 kB 916 kB
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB
Commit: 96dec00e65ab006ae1ac54ec061a56a0220deda0

ijjk avatar Jun 24 '20 21:06 ijjk

Failing test suites

Commit: b08729831634b25e06e3f46d4b642f76b8c09abe

test/unit/sequential-css-module-local-ident-generator.test.js

Expand output

● Test suite failed to run

Cannot find module 'next/dist/build/webpack/config/blocks/css/loaders/utils/SequentialCSSModuleLocalIdentGenerator' from 'sequential-css-module-local-ident-generator.test.js'

> 1 | import SequentialCSSModuleLocalIdentGenerator from 'next/dist/build/webpack/config/blocks/css/loaders/utils/SequentialCSSModuleLocalIdentGenerator'
    | ^
  2 | 
  3 | describe('', () => {
  4 |   let generator

  at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:259:17)
  at Object.<anonymous> (unit/sequential-css-module-local-ident-generator.test.js:1:1)

ijjk avatar Jun 24 '20 21:06 ijjk