cwa-website icon indicating copy to clipboard operation
cwa-website copied to clipboard

eventregistration.js triggers build warning regarding size limit

Open MikeMcC399 opened this issue 4 years ago • 7 comments

Where to find the issue

https://github.com/corona-warn-app/cwa-website/blob/master/src/assets/js/eventregistration.js

Describe the issue

When the website is built through https://github.com/corona-warn-app/cwa-website/blob/master/.github/workflows/build.yml a warning is shown regarding eventregistration.js.

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  eventregistration.js (658 KiB)

For example the pull request https://github.com/corona-warn-app/cwa-website/pull/1167 triggered the action which is shown in the logs under https://github.com/corona-warn-app/cwa-website/actions/runs/788829128. Here is the relevant part of the log:

Built at: 04/27/2021 11:00:24 AM
               Asset     Size  Chunks                    Chunk Names
              app.js  139 KiB       0  [emitted]         app
eventregistration.js  658 KiB       1  [emitted]  [big]  eventregistration
Entrypoint app = app.js
Entrypoint eventregistration [big] = eventregistration.js

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  eventregistration.js (658 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  eventregistration (658 KiB)
      eventregistration.js


WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

Suggested change

Please consider if something should be done to avoid this warning appearing.


Internal Tracking ID: EXPOSUREAPP-13404

MikeMcC399 avatar Apr 27 '21 16:04 MikeMcC399

It seems that #1575 may partially address this issue.

MikeMcC399 avatar Aug 07 '21 15:08 MikeMcC399

PR #1772 causes the warning to no longer appear

[17:42:45] Version: webpack 4.46.0
Built at: 29/09/2021 17:42:45
               Asset      Size  Chunks                    Chunk Names
              app.js   140 KiB       0  [emitted]         app
eventregistration.js   679 KiB       1  [emitted]  [big]  eventregistration
      screenshots.js  90.1 KiB       2  [emitted]         screenshots
Entrypoint app = app.js
Entrypoint eventregistration [big] = eventregistration.js
Entrypoint screenshots = screenshots.js

eventregistration.js is still labelled as [big] though.

It seems that performance hints have been disabled:

https://github.com/corona-warn-app/cwa-website/blob/8d3a36a769375f4be50461052ff23cb87acc0fad/gulpfile.js#L270-L272

https://webpack.js.org/configuration/performance/#performancehints


Closing, since the symptoms no longer appear.

MikeMcC399 avatar Sep 29 '21 15:09 MikeMcC399

PR https://github.com/corona-warn-app/cwa-website/pull/1774 reverted the change to gulpfile.js which suppressed the performance warning from webpack, so this issue is re-opened.

MikeMcC399 avatar Sep 30 '21 15:09 MikeMcC399

I wonder if the label bug is correct here, as this is not a bug, or? The warning message appears as intended.

Ein-Tim avatar Apr 15 '22 16:04 Ein-Tim

@Ein-Tim

I wonder if the label bug is correct here, as this is not a bug, or? The warning message appears as intended.

This is a question for a JavaScript expert.

"bug" is the correct label until an expert qualifies the issue and says it can be dismissed or the issue has been addressed. The Open Source Team has so far not responded.

In the meantime the npm run build reports that eventregistration.js has grown even further in size

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  eventregistration.js (993 KiB)

and that there is a problem additionally with cwaa.js

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  cwaa.js (813 KiB)

MikeMcC399 avatar Apr 18 '22 15:04 MikeMcC399

Lighthouse shows a performance impact due to JavaScript size in mobile mode for the Event registration page https://www.coronawarn.app/en/eventregistration/.

The most improvement however would be gained through enabling text compression.

  • See open issue https://github.com/corona-warn-app/cwa-website/issues/60

Steps to reproduce report

  1. Open https://www.coronawarn.app/en/eventregistration/ in Google Chrome Incognito mode
  2. Press F12
  3. Select Performance and Mobile or Desktop, then click on Generate report
Device Lighthouse
Performance score (0-100)
Highest opportunity
Mobile 58 Enable text compression
Desktop 97 Enable text compression

MikeMcC399 avatar Jun 16 '22 07:06 MikeMcC399

@MikeMcC399 Thank you for reporting the issue and all the information. Internal Tracking ID: EXPOSUREAPP-13404

thorbenkuro avatar Jun 20 '22 09:06 thorbenkuro

@MikeMcC399 Just FYI, we had forwarded the issue, however were told that enable compressing would request to much ressources on CDN side, and that it would not be implemented.

dsarkar avatar Feb 06 '23 13:02 dsarkar

@dsarkar

Thank you for the update. I had closed this issue assuming that there would be no more work done on performance due to ramp down.

MikeMcC399 avatar Feb 06 '23 13:02 MikeMcC399