Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Warning during asset compilation: application.js exceeding recommended size limit #711

Open
aaronskiba opened this issue Apr 4, 2024 · 3 comments

Comments

@aaronskiba
Copy link
Collaborator

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

  • Upcoming v4.1.0 upgrade

Terminal Output
The following is copied from the Compile Assets step of the postgresql GitHub Action here:

Run bundle exec rails assets:precompile
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
Copying Bootstrap glyphicons to the public directory ...
Copying TinyMCE skins to the public directory ...
yarn install v1.22.22
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.27s.
yarn run v1.22.22
$ webpack --config ./config/webpack/webpack.config.js
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Running via Spring preloader in process 4788
Running via Spring preloader in process 4792
asset application.js 1.73 MiB [emitted] [minimized] [big] (name: application) 1 related asset
orphan modules 555 KiB [orphan] 67 modules
runtime modules 939 bytes 4 modules
modules by path ./node_modules/core-js/ 541 KiB 521 modules
modules by path ./node_modules/tinymce/ 2.68 MiB 17 modules
modules by path ./app/javascript/ 569 KiB 16 modules
modules by path ./node_modules/jquery-ui/ui/ 209 KiB
  modules by path ./node_modules/jquery-ui/ui/*.js 40.2 KiB 9 modules
  modules by path ./node_modules/jquery-ui/ui/widgets/*.js 169 KiB 5 modules
modules by path ./node_modules/bootstrap/ 73.6 KiB
  ./node_modules/bootstrap/dist/js/npm.js 484 bytes [built] [code generated]
  + [12](https://github.com/portagenetwork/roadmap/actions/runs/8396151602/job/22996926017?pr=700#step:17:13) modules
modules by path ./node_modules/number-to-text/ 4.09 KiB
  ./node_modules/number-to-text/converters/en-us.js 2.74 KiB [built] [code generated]
  + 2 modules
+ 5 modules

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

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  application (1.73 MiB)
      application.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/

webpack 5.79.0 compiled with 3 warnings in 23968 ms
Done in 24.62s.
yarn install v1.[22](https://github.com/portagenetwork/roadmap/actions/runs/8396151602/job/22996926017?pr=700#step:17:23).22
[1/4] Resolving packages...
success Already up-to-date.
@aaronskiba aaronskiba pinned this issue Apr 4, 2024
@aaronskiba aaronskiba unpinned this issue Apr 4, 2024
@aaronskiba
Copy link
Collaborator Author

Note that the same warnings exist within the DMP Roadmap codebase. Their warning also states application.js (1.73 MiB) link.

@aaronskiba
Copy link
Collaborator Author

The following check was performed after performing rails assets:clobber && rails assets:precompile each time:

// deployment-portage with webpacker
aaron@ubuntu:~/Documents/GitHub/roadmap
$ ls -lh public/packs/js/application-f9a747a97913655770dd.js
-rw-rw-r-- 1 aaron aaron 1.9M Apr  5 15:23 public/packs/js/application-f9a747a97913655770dd.js

// v4.1.1 upgrade with jsbundling-rails
aaron@ubuntu:~/Documents/GitHub/roadmap
$ ls -lh app/assets/builds/application.js
-rw-rw-r-- 1 aaron aaron 1.8M Apr  5 15:25 app/assets/builds/application.js

Although both files far exceed Webpack's recommended size limit, application.js is slightly smaller after the upgrade.

@aaronskiba
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant